Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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


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

orxonox/trunk: some minor file-handling

Location:
trunk/src/lib/graphics
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/graphics/importer/objModel.cc

    r5300 r5319  
    176176  Material* tmpMat = NULL;
    177177
    178   while(fgets(buffer, PARSELINELENGTH, stream))
     178  while(fgets(buffer, PARSELINELENGTH, stream) != NULL)
    179179    {
    180180      PRINTF(5)("found line in mtlFile: %s\n", buffer);
  • trunk/src/lib/graphics/shader.cc

    r5318 r5319  
    9191bool Shader::loadShaderProgramm(SHADER_TYPE type, const char* fileName)
    9292{
    93   GLenum shader = 0;
     93  GLhandleARB shader = 0;
    9494
    9595  if (type != SHADER_VERTEX && type != SHADER_FRAGMENT)
     
    119119
    120120  if (shader != 0)
    121     {
    122       glShaderSourceARB(shader, program->getCount(), (const GLcharARB**)program->getArray(), NULL);
    123         glCompileShaderARB(shader);
    124           this->printError(shader);
    125       glAttachObjectARB(this->shaderProgram, shader);
    126     }
    127     delete program;
     121  {
     122    glShaderSourceARB(shader, program->getCount(), (const GLcharARB**)program->getArray(), NULL);
     123      glCompileShaderARB(shader);
     124        this->printError(shader);
     125    glAttachObjectARB(this->shaderProgram, shader);
     126  }
     127  for (unsigned int i=0; i< program->getCount(); i++)
     128    delete[] program->getArray()[i];
     129  delete program;
    128130}
    129131
     
    218220
    219221
    220 void Shader::printError(GLenum program)
     222void Shader::printError(GLhandleARB program)
    221223{
    222224  if (program == 0)
  • trunk/src/lib/graphics/shader.h

    r5318 r5319  
    4545
    4646
    47   void printError(GLenum program);
     47  void printError(GLhandleARB program);
    4848  void debug() const;
    4949
     
    5353   char*                  fragmentShaderFile;
    5454   char*                  vertexShaderFile;
    55    GLenum                 shaderProgram;
    56    GLenum                 vertexShader;
    57    GLenum                 fragmentShader;
     55   GLhandleARB            shaderProgram;
     56   GLhandleARB            vertexShader;
     57   GLhandleARB            fragmentShader;
    5858
    5959   static Shader*         storedShader;
Note: See TracChangeset for help on using the changeset viewer.