MCPcopy Create free account
hub / github.com/atraczyk/2d-engine / GL_initializeShaders

Function GL_initializeShaders

engine/src/game.cpp:1330–1361  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1328}
1329
1330void GL_initializeShaders()
1331{
1332 GL_loadShader(game.shaders.horizontalBlur, "shaders/post_GHB.v.glsl",
1333 "shaders/post_GHB.f.glsl");
1334 GL_loadShader(game.shaders.verticalBlur, "shaders/post_GVB.v.glsl",
1335 "shaders/post_GVB.f.glsl");
1336 GL_loadShader(game.shaders.wave, "shaders/post.v.glsl",
1337 "shaders/post_VW.f.glsl");
1338 GL_loadShader(game.shaders.bilinear, "shaders/post.v.glsl",
1339 "shaders/post_CB.f.glsl");
1340 GL_loadShader(game.shaders.sky, "shaders/none.v.glsl",
1341 "shaders/sky.f.glsl");
1342 GL_loadShader(game.shaders.curvature, "shaders/post.v.glsl",
1343 "shaders/post_CURV.f.glsl");
1344
1345 game.shaders.uniformHBlurSize =
1346 glGetUniformLocation(game.shaders.horizontalBlur, "blurSize");
1347 game.shaders.uniformVBlurSize =
1348 glGetUniformLocation(game.shaders.verticalBlur, "blurSize");
1349 game.shaders.uniformOffset =
1350 glGetUniformLocation(game.shaders.wave, "offset");
1351 game.shaders.uniformHBilinearSize =
1352 glGetUniformLocation(game.shaders.bilinear, "xSize");
1353 game.shaders.uniformVBilinearSize =
1354 glGetUniformLocation(game.shaders.bilinear, "ySize");
1355 game.shaders.uniformCurvature =
1356 glGetUniformLocation(game.shaders.curvature, "curvature");
1357
1358 glUseProgramObjectARB(game.shaders.sky);
1359 glUniform2f(glGetUniformLocationARB(game.shaders.sky, "resolution"),
1360 game.sceneRect.w / 4, game.sceneRect.h / 4);
1361}
1362
1363void P_cleanup()
1364{

Callers 1

GL_initializeGLObjectsFunction · 0.85

Calls 1

GL_loadShaderFunction · 0.85

Tested by

no test coverage detected