Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5268 in orxonox.OLD for trunk/src


Ignore:
Timestamp:
Sep 27, 2005, 6:21:57 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: better error-handling through try and catch

Location:
trunk/src
Files:
2 edited

Legend:

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

    r5267 r5268  
    5050   if (fragmentShaderFile != NULL)
    5151     this->loadShaderProgramm(SHADER_FRAGMENT, fragmentShaderFile);
    52    glLinkProgramARB(this->shaderProgram);
    53    this->printError(this->shaderProgram);
    54 
     52  try  {
     53   glLinkProgramARB(this->shaderProgram); }
     54  catch(char* str)  {
     55   this->printError(this->shaderProgram); }
    5556}
    5657
     
    8687
    8788    this->vertexShader = glCreateShaderObjectARB(GL_VERTEX_SHADER_ARB);
    88     glShaderSourceARB(this->vertexShader, 1, (const GLcharARB**)&program, NULL);
    89     glCompileShaderARB(this->vertexShader);
    90     glAttachObjectARB(this->shaderProgram, this->vertexShader);
    91     this->printError(this->vertexShader);
     89    try {
     90      glShaderSourceARB(this->vertexShader, 1, (const GLcharARB**)&program, NULL);
     91      glCompileShaderARB(this->vertexShader);
     92      glAttachObjectARB(this->shaderProgram, this->vertexShader);
     93    }
     94    catch (char * tmp)
     95    {
     96      this->printError(this->vertexShader);
     97    }
    9298  }
    9399
     
    98104
    99105    this->fragmentShader = glCreateShaderObjectARB(GL_FRAGMENT_SHADER_ARB);
    100     glShaderSourceARB(this->fragmentShader, 1, (const GLcharARB**)&program, NULL);
    101     glCompileShaderARB(this->fragmentShader);
    102     glAttachObjectARB(this->shaderProgram, this->fragmentShader);
    103     this->printError(this->fragmentShader);
     106    try
     107    {
     108      glShaderSourceARB(this->fragmentShader, 1, (const GLcharARB**)&program, NULL);
     109      glCompileShaderARB(this->fragmentShader);
     110      glAttachObjectARB(this->shaderProgram, this->fragmentShader);
     111    }
     112    catch (char* tmp)
     113    {
     114      this->printError(this->fragmentShader);
     115    }
    104116  }
    105117
  • trunk/src/world_entities/npc2.cc

    r5267 r5268  
    8787
    8888  shader->activateShader();
    89   gluSphere(this->obj, 3, 20, 20);
     89  gluSphere(this->obj, 3, 10, 10);
    9090  shader->deactivateShader();
    9191
Note: See TracChangeset for help on using the changeset viewer.