//
// cocos2d::CCGLProgram::compileShader from 0x100417640 to 0x1004176e7 (167 bytes)
//
// 2 xrefs:
// > cocos2d::CCGLProgram::initWithVertexShaderByteArray @ 0x1004175d8
// > cocos2d::CCGLProgram::initWithVertexShaderByteArray @ 0x1004175f5
//
// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:30:11 +0000
//
bool __fastcall cocos2d::CCGLProgram::compileShader(__int64 a1, GLuint *a2, GLenum a3, GLchar *a4)
{
GLuint Shader; // eax
GLint v6; // [rsp+8h] [rbp-28h] BYREF
GLint params; // [rsp+Ch] [rbp-24h] BYREF
GLchar *string[2]; // [rsp+10h] [rbp-20h] BYREF
if ( !a4 )
return 0;
string[0] = "uniform mat4 CC_PMatrix;\n"
"uniform mat4 CC_MVMatrix;\n"
"uniform mat4 CC_MVPMatrix;\n"
"uniform vec4 CC_Time;\n"
"uniform vec4 CC_SinTime;\n"
"uniform vec4 CC_CosTime;\n"
"uniform vec4 CC_Random01;\n"
"//CC INCLUDES END\n"
"\n";
string[1] = a4;
Shader = glCreateShader(a3);
*a2 = Shader;
glShaderSource(Shader, 2, (const GLchar *const *)string, nullptr);
glCompileShader(*a2);
glGetShaderiv(*a2, 0x8B81u, ¶ms);
if ( !params )
sub_1009A6720(&v6);
return params == 1;
}