Changeset 8255 in orxonox.OLD for trunk/src/lib/graphics/shader.cc
- Timestamp:
- Jun 8, 2006, 3:44:12 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/shader.cc
r8037 r8255 201 201 } 202 202 203 void Shader::bindShader(const char* name, const float* value, size_t size) 204 { 205 if (likely (this->shaderProgram != 0)) { 206 glUseProgramObjectARB(this->shaderProgram); 207 208 unsigned int location = glGetUniformLocationARB(this->shaderProgram, name); 209 /* This is EXPENSIVE and should be avoided. */ 210 211 if (size == 1) glUniform1fvARB(location, 1, value); 212 else if (size == 2) glUniform2fvARB(location, 1, value); 213 else if (size == 3) glUniform3fvARB(location, 1, value); 214 else if (size == 4) glUniform4fvARB(location, 1, value); 215 else if (size == 9) glUniformMatrix3fvARB(location, 1, false, value); 216 else if (size == 16) glUniformMatrix4fvARB(location, 1, false, value); 217 218 } 219 } 220 203 221 void Shader::deactivateShader() 204 222 {
Note: See TracChangeset
for help on using the changeset viewer.