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

Method setUniformfv

cpp/5_Domain_Specific/smokeParticles/GLSLProgram.cpp:122–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120}
121
122void GLSLProgram::setUniformfv(const GLchar *name, GLfloat *v, int elementSize, int count)
123{
124 GLint loc = glGetUniformLocation(mProg, name);
125
126 if (loc == -1) {
127#ifdef _DEBUG
128 fprintf(stderr, "Error setting parameter '%s'\n", name);
129#endif
130 return;
131 }
132
133 switch (elementSize) {
134 case 1:
135 glUniform1fv(loc, count, v);
136 break;
137
138 case 2:
139 glUniform2fv(loc, count, v);
140 break;
141
142 case 3:
143 glUniform3fv(loc, count, v);
144 break;
145
146 case 4:
147 glUniform4fv(loc, count, v);
148 break;
149 }
150}
151
152void GLSLProgram::bindTexture(const char *name, GLuint tex, GLenum target, GLint unit)
153{

Callers 1

renderSceneFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected