| 150 | } |
| 151 | |
| 152 | void GLSLProgram::bindTexture(const char *name, GLuint tex, GLenum target, GLint unit) |
| 153 | { |
| 154 | GLint loc = glGetUniformLocation(mProg, name); |
| 155 | |
| 156 | if (loc >= 0) { |
| 157 | glActiveTexture(GL_TEXTURE0 + unit); |
| 158 | glBindTexture(target, tex); |
| 159 | glUseProgram(mProg); |
| 160 | glUniform1i(loc, unit); |
| 161 | glActiveTexture(GL_TEXTURE0); |
| 162 | } |
| 163 | else { |
| 164 | #if _DEBUG |
| 165 | fprintf(stderr, "Error binding texture '%s'\n", name); |
| 166 | #endif |
| 167 | } |
| 168 | } |
| 169 | |
| 170 | GLuint GLSLProgram::checkCompileStatus(GLuint shader, GLint *status) |
| 171 | { |
no outgoing calls
no test coverage detected