Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

branches/water: light!

File:
1 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.
Note: See TracChangeset for help on using the changeset viewer.