Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5333 in orxonox.OLD for trunk/src


Ignore:
Timestamp:
Oct 9, 2005, 12:11:23 AM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: we do not have to shade the whole world

Location:
trunk/src
Files:
2 edited

Legend:

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

    r5323 r5333  
    283283}
    284284
    285 
     285bool Shader::checkShaderAbility()
     286{
     287  if (GLEW_ARB_shader_objects &&
     288      GLEW_ARB_shading_language_100 &&
     289      GLEW_ARB_vertex_shader &&
     290      GLEW_ARB_fragment_shader)
     291    return true;
     292  else
     293    return false;
     294}
    286295
    287296void Shader::debug() const
  • trunk/src/world_entities/npc2.cc

    r5325 r5333  
    3232
    3333  this->loadModelWithScale("models/ships/bolido.obj", 3);
    34   this->shader = Shader::getShader("shaders/toon.vert", "shaders/toon.frag");
     34  this->shader = NULL;
     35  if (likely(Shader::checkShaderAbility()))
     36    this->shader = Shader::getShader("shaders/toon.vert", "shaders/toon.frag");
    3537
    3638  this->obj = gluNewQuadric();
     
    8587
    8688  if (this->shader != NULL && this->shader != Shader::getActiveShader())
    87   {
    8889    shader->activateShader();
    89   }
    9090  gluSphere(this->obj, 3, 10, 10);
    91   //shader->deactivateShader();
     91  shader->deactivateShader();
    9292
    9393
Note: See TracChangeset for help on using the changeset viewer.