Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7982 in orxonox.OLD for branches/water/src/lib


Ignore:
Timestamp:
May 30, 2006, 3:30:47 PM (18 years ago)
Author:
stefalie
Message:

branches/water: light!

Location:
branches/water/src/lib/graphics
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/water/src/lib/graphics/importer/material.cc

    r7788 r7982  
    107107  if (unlikely(this == Material::selectedMaterial))
    108108      return true;
     109  else if (likely(Material::selectedMaterial != NULL))
     110  {
     111  Material::unselect();
     112//     for(unsigned int i = 0; i < Material::selectedMaterial->textures.size(); ++i)
     113//     {
     114//         glActiveTexture(Material::glTextureArbs[i]);
     115//         glBindTexture(GL_TEXTURE_2D, 0);
     116//         glDisable(GL_TEXTURE_2D);
     117//     }
     118  }
    109119
    110120
     
    137147  else if (this->illumModel >= 2)
    138148    glShadeModel(GL_SMOOTH);
    139 
    140   if (likely(Material::selectedMaterial != NULL))
    141   {
    142     for(unsigned int i = 0; i < Material::selectedMaterial->textures.size(); ++i)
    143     {
    144         glActiveTexture(Material::glTextureArbs[i]);
    145         glBindTexture(GL_TEXTURE_2D, 0);
    146         glDisable(GL_TEXTURE_2D);
    147     }
    148   }
    149149
    150150  for(unsigned int i = 0; i < this->textures.size(); ++i)
     
    172172}
    173173
     174void Material::unselect()
     175{
     176  Material::selectedMaterial = NULL;
     177    for(unsigned int i = 0; i < 8; ++i)
     178    {
     179        glActiveTexture(Material::glTextureArbs[i]);
     180        glBindTexture(GL_TEXTURE_2D, 0);
     181        glDisable(GL_TEXTURE_2D);
     182    }
     183}
     184
    174185/**
    175186 *  Sets the Material Illumination Model.
  • branches/water/src/lib/graphics/importer/material.h

    r7788 r7982  
    3232
    3333    bool select () const;
     34    static void unselect();
    3435
    3536    void setIllum (int illum);
  • branches/water/src/lib/graphics/shader.h

    r7835 r7982  
    2323  {
    2424  public:
    25     Uniform(const Shader* shader, const std::string& location) { glGetUniformLocationARB(shader->getProgram(), location.c_str()) ; }
    26     Uniform(const Shader& shader, const std::string& location) { glGetUniformLocation(shader.getProgram(), location.c_str()) ; };
    27     Uniform(GLhandleARB shaderProgram, const std::string& location) { glGetUniformLocation(shaderProgram, location.c_str()) ; };
     25    Uniform(const Shader* shader, const std::string& location) { this->uniform = glGetUniformLocationARB(shader->getProgram(), location.c_str()) ; }
     26    Uniform(const Shader& shader, const std::string& location) { this->uniform = glGetUniformLocation(shader.getProgram(), location.c_str()) ; };
     27    Uniform(GLhandleARB shaderProgram, const std::string& location) { this->uniform = glGetUniformLocation(shaderProgram, location.c_str()) ; };
    2828
    2929    void set(float v0) const { glUniform1f(this->uniform, v0); }
Note: See TracChangeset for help on using the changeset viewer.