This too.

--HG--
branch : gsoc2013-dfighter
hg/feature/gsoc2013-dfighter
dfighter1985 12 years ago
parent 35429fea43
commit a1cf2c640b

@ -22,6 +22,9 @@ namespace NL3D
if( !program->isLinked() ) if( !program->isLinked() )
return false; return false;
// Release previous program
releaseProgram();
nglUseProgram( program->getProgramId() ); nglUseProgram( program->getProgramId() );
GLenum error = glGetError(); GLenum error = glGetError();
@ -208,11 +211,12 @@ namespace NL3D
void CDriverGL3::releaseProgram() void CDriverGL3::releaseProgram()
{ {
delete p; if( currentProgram == NULL )
p = NULL; return;
vp = NULL;
pp = NULL; delete currentProgram;
currentProgram = NULL; currentProgram = NULL;
#ifndef GLSL #ifndef GLSL
_VertexProgramEnabled = false; _VertexProgramEnabled = false;
#endif #endif

Loading…
Cancel
Save