MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / EnsureAlphaProgram

Function EnsureAlphaProgram

engine/PoseidonGL33/EngineGL33_ShadowDepth.cpp:217–242  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

215)";
216
217bool EnsureAlphaProgram()
218{
219 if (s_alphaProg)
220 return true;
221 GLuint vs = CompileOne(GL_VERTEX_SHADER, kAlphaVS);
222 GLuint fs = CompileOne(GL_FRAGMENT_SHADER, kAlphaFS);
223 if (!vs || !fs)
224 return false;
225 GLuint prog = glCreateProgram();
226 glAttachShader(prog, vs);
227 glAttachShader(prog, fs);
228 glLinkProgram(prog);
229 glDeleteShader(vs);
230 glDeleteShader(fs);
231 GLint ok = 0;
232 glGetProgramiv(prog, GL_LINK_STATUS, &ok);
233 if (!ok)
234 {
235 glDeleteProgram(prog);
236 return false;
237 }
238 s_alphaProg = prog;
239 s_alphaLocVP = glGetUniformLocation(prog, "uLightVP");
240 s_alphaLocTex = glGetUniformLocation(prog, "uTex");
241 return true;
242}
243
244bool EnsureAlphaMesh()
245{

Callers 1

RenderCascadeArrayFunction · 0.85

Calls 1

CompileOneFunction · 0.85

Tested by

no test coverage detected