Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5321 in orxonox.OLD


Ignore:
Timestamp:
Oct 8, 2005, 3:55:00 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: more error-catchin in the shader

Location:
trunk/src/lib
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/graphics/importer/model.h

    r5304 r5321  
    1515
    1616// FORWARD DEFINITION //
    17 class Vector;
    1817template<class T> class Array;
    1918template<class T> class tList;
  • trunk/src/lib/graphics/shader.cc

    r5320 r5321  
    8585    glDeleteObjectARB(this->vertexShader);
    8686  if (this->shaderProgram != 0)
     87  {
     88    GLint status = 0;
    8789    glDeleteObjectARB(this->shaderProgram);
    88 
     90       // link error checking
     91    glGetObjectParameterivARB(this->shaderProgram, GL_OBJECT_DELETE_STATUS_ARB, &status);
     92    if (status == GL_INVALID_VALUE || status == GL_INVALID_OPERATION)
     93      this->printError(this->shaderProgram);
     94  }
    8995}
    9096
     
    124130  {
    125131    GLint status = 0;
    126     glShaderSourceARB(shader, program->getCount(), (const GLcharARB**)program->getArray(), NULL);
     132    glShaderSourceARB(shader, program->getCount(), (const char**)program->getArray(), NULL);
    127133    glCompileShaderARB(shader);
    128134    // checking on error.
     
    214220    delete[] this->vertexShaderFile;
    215221    this->vertexShaderFile = NULL;
     222    glDetachObjectARB(this->shaderProgram, this->vertexShader);
    216223    glDeleteObjectARB(this->vertexShader);
    217224    glGetObjectParameterivARB(this->vertexShader, GL_OBJECT_DELETE_STATUS_ARB, &status);
     
    224231    delete[] this->fragmentShaderFile;
    225232    this->fragmentShaderFile = NULL;
     233    glDetachObjectARB(this->shaderProgram, this->fragmentShader);
    226234    glDeleteObjectARB(this->fragmentShader);
    227235    glGetObjectParameterivARB(this->fragmentShader, GL_OBJECT_DELETE_STATUS_ARB, &status);
  • trunk/src/lib/util/array.h

    r5262 r5321  
    3737
    3838    /** @returns The array */
    39     inline const T* getArray () const { return this->array; };
     39    inline T* getArray () const { return this->array; };
    4040    inline const T getEntry(unsigned int number) const;
    4141    /** * @returns The Count of entries in the Array*/
Note: See TracChangeset for help on using the changeset viewer.