Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5322 in orxonox.OLD for trunk/src/lib/graphics


Ignore:
Timestamp:
Oct 8, 2005, 4:37:43 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: smooth unloading of Shaders. but not perfect.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/graphics/shader.cc

    r5321 r5322  
    7373Shader::~Shader ()
    7474{
    75   if (storedShader == this)
     75  if (this->shaderProgram == glGetHandleARB(GL_PROGRAM_OBJECT_ARB))
    7676    Shader::deactivateShader();
    7777
     
    8181
    8282  if (this->fragmentShader != 0)
     83  {
     84    glDetachObjectARB(this->shaderProgram, this->fragmentShader);
    8385    glDeleteObjectARB(this->fragmentShader);
     86  }
    8487  if (this->vertexShader != 0)
     88  {
     89    glDetachObjectARB(this->shaderProgram, this->vertexShader);
    8590    glDeleteObjectARB(this->vertexShader);
     91  }
    8692  if (this->shaderProgram != 0)
    8793  {
    8894    GLint status = 0;
     95    //glLinkProgramARB(this->shaderProgram);
    8996    glDeleteObjectARB(this->shaderProgram);
    9097       // link error checking
Note: See TracChangeset for help on using the changeset viewer.