Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8176 in orxonox.OLD for branches/atmospheric_engine


Ignore:
Timestamp:
Jun 6, 2006, 6:34:22 PM (18 years ago)
Author:
amaechler
Message:
 
Location:
branches/atmospheric_engine/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/atmospheric_engine/src/lib/graphics/shader.cc

    r7221 r8176  
    220220}
    221221
     222void Shader::bindShader(const char* name, const float* value, size_t size)
     223{
     224        if (likely (this->shaderProgram != 0)) {
     225                glUseProgramObjectARB(this->shaderProgram);
     226
     227                unsigned int location = glGetUniformLocationARB(this->shaderProgram, name);
     228                /* This is EXPENSIVE and should be avoided. */
     229
     230                if      (size == 1)  glUniform1fvARB(location, 1, value);
     231                else if (size == 2)  glUniform2fvARB(location, 1, value);
     232                else if (size == 3)  glUniform3fvARB(location, 1, value);
     233                else if (size == 4)  glUniform4fvARB(location, 1, value);
     234                else if (size == 9)  glUniformMatrix3fvARB(location, 1, false, value);
     235                else if (size == 16) glUniformMatrix4fvARB(location, 1, false, value);
     236
     237        }
     238}
     239
    222240void Shader::deactivateShader()
    223241{
  • branches/atmospheric_engine/src/lib/graphics/shader.h

    r7785 r8176  
    3434  bool loadShaderProgramm(SHADER_TYPE type, const std::string& fileName);
    3535  void activateShader();
     36  void bindShader(const char* name, const float* value, size_t size);
    3637  static void deactivateShader();
    3738  void deleteProgram(SHADER_TYPE type);
  • branches/atmospheric_engine/src/world_entities/effects/billboard.cc

    r8050 r8176  
    9292  this->sizeY = sizeY;
    9393
    94   PRINTF(0)("sizeX: %f sizeY: %f", sizeX, sizeY);
     94  PRINTF(0)("sizeX: %f sizeY: %f\n", sizeX, sizeY);
    9595}
    9696
Note: See TracChangeset for help on using the changeset viewer.