Changeset 10143 in orxonox.OLD for trunk/src/lib/graphics/shader.h
- Timestamp:
- Dec 23, 2006, 2:04:28 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/graphics/shader.h
r10118 r10143 22 22 { 23 23 public: 24 25 24 Uniform(const Shader& shader, const std::string& location) { if (Shader::isSupported()) this->uniform = glGetUniformLocation(shader.getProgram(), location.c_str()) ; }; 25 Uniform(GLhandleARB shaderProgram, const std::string& location) { if (Shader::isSupported()) this->uniform = glGetUniformLocation(shaderProgram, location.c_str()) ; }; 26 26 27 28 29 30 27 void set(float v0) const { if (Shader::isSupported()) glUniform1f(this->uniform, v0); } 28 void set(float v0, float v1) const { if (Shader::isSupported()) glUniform2f(this->uniform, v0, v1); } 29 void set(float v0, float v1, float v2) const { if (Shader::isSupported()) glUniform3f(this->uniform, v0, v1, v2); } 30 void set(float v0, float v1, float v2, float v3) const { if (Shader::isSupported()) glUniform4f(this->uniform, v0, v1, v2, v3); } 31 31 32 33 34 35 32 void set(int v0) const { if (Shader::isSupported()) glUniform1i(this->uniform, v0); } 33 void set(int v0, int v1) const { if (Shader::isSupported()) glUniform2i(this->uniform, v0, v1); } 34 void set(int v0, int v1, int v2) const { if (Shader::isSupported()) glUniform3i(this->uniform, v0, v1, v2); } 35 void set(int v0, int v1, int v2, int v3) const {if (Shader::isSupported()) glUniform4i(this->uniform, v0, v1, v2, v3); } 36 36 37 37 void setV(unsigned int count, float* vv) const; … … 53 53 54 54 bool load(const std::string& vertexShaderFile, const std::string& fragmentShaderFile = "") 55 55 { return this->data->load(vertexShaderFile, fragmentShaderFile); } 56 56 57 57 … … 71 71 static bool isSupported() { return checkShaderAbility(); }; 72 72 73 73 inline static bool isShaderActive() { return (Shader::storedShader != NULL) ? true : false; }; 74 74 inline static const Shader* getActiveShader() { return Shader::storedShader; }; 75 75 … … 78 78 79 79 private: 80 ShaderData::Pointer data;80 ShaderData::Pointer data; 81 81 82 82 static const Shader* storedShader;
Note: See TracChangeset
for help on using the changeset viewer.