MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / setUniforms

Method setUniforms

framework/render/gl20/ogl_2_0_renderer.cpp:268–296  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

266 this->tintLoc = gl20::GetUniformLocation(this->prog, "tint");
267 }
268 void setUniforms(Vec2<int> screenSize, bool flipY, Colour tint = {255, 255, 255, 255},
269 GLint texUnit = 0, GLint palUnit = 1)
270 {
271 if (screenSize != currentScreenSize)
272 {
273 currentScreenSize = screenSize;
274 this->uniform(this->screenSizeLoc, screenSize);
275 }
276 if (texUnit != currentTexUnit)
277 {
278 currentTexUnit = texUnit;
279 this->uniform(this->texLoc, texUnit);
280 }
281 if (palUnit != currentPalUnit)
282 {
283 currentPalUnit = palUnit;
284 this->uniform(this->palLoc, palUnit);
285 }
286 if (currentFlipY != flipY)
287 {
288 currentFlipY = flipY;
289 this->uniform(this->flipYLoc, flipY);
290 }
291 if (tint != currentTint)
292 {
293 currentTint = tint;
294 this->uniform(this->tintLoc, tint);
295 }
296 }
297};
298
299const char *SolidColourProgram_vertexSource = {

Callers

nothing calls this directly

Calls 1

uniformMethod · 0.80

Tested by

no test coverage detected