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

Function EnsureProgram

engine/PoseidonGL33/EngineGL33_ShadowDepth.cpp:81–105  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79}
80
81bool EnsureProgram()
82{
83 if (s_prog)
84 return true;
85 GLuint vs = CompileOne(GL_VERTEX_SHADER, kVS);
86 GLuint fs = CompileOne(GL_FRAGMENT_SHADER, kFS);
87 if (!vs || !fs)
88 return false;
89 GLuint prog = glCreateProgram();
90 glAttachShader(prog, vs);
91 glAttachShader(prog, fs);
92 glLinkProgram(prog);
93 glDeleteShader(vs);
94 glDeleteShader(fs);
95 GLint ok = 0;
96 glGetProgramiv(prog, GL_LINK_STATUS, &ok);
97 if (!ok)
98 {
99 glDeleteProgram(prog);
100 return false;
101 }
102 s_prog = prog;
103 s_locVP = glGetUniformLocation(prog, "uLightVP");
104 return true;
105}
106
107bool EnsureTarget(int res)
108{

Callers 2

RenderDepthFBOFunction · 0.85
RenderCascadeArrayFunction · 0.85

Calls 1

CompileOneFunction · 0.85

Tested by

no test coverage detected