MCPcopy Create free account
hub / github.com/NVIDIA/cuda-samples / bindTexture

Method bindTexture

cpp/5_Domain_Specific/smokeParticles/GLSLProgram.cpp:152–168  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

150}
151
152void 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
170GLuint GLSLProgram::checkCompileStatus(GLuint shader, GLint *status)
171{

Callers 4

drawPointSpritesMethod · 0.45
blurLightBufferMethod · 0.45
displayTextureMethod · 0.45
renderSceneFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected