//
// cocos2d::CCGLProgram::compileShader from 0x1001352e8 to 0x1001353c0 (216 bytes)
//
// 2 xrefs:
// > cocos2d::CCGLProgram::initWithVertexShaderByteArray @ 0x10013528c
// > cocos2d::CCGLProgram::initWithVertexShaderByteArray @ 0x1001352a4
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
bool __fastcall cocos2d::CCGLProgram::compileShader(
cocos2d::CCGLProgram *a1,
unsigned int *a2,
unsigned int a3,
const char *a4)
{
GLchar *v5; // x8
GLuint Shader; // w0
GLint v8; // [xsp+8h] [xbp-38h] BYREF
GLint params; // [xsp+Ch] [xbp-34h] BYREF
GLchar *string[3]; // [xsp+10h] [xbp-30h] BYREF
if ( !a4 )
return 0;
v5 = "precision mediump float;\n";
if ( a3 == 35633 )
v5 = "precision highp float;\n";
string[0] = v5;
string[1] = "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[2] = (GLchar *)a4;
Shader = glCreateShader(a3);
*a2 = Shader;
glShaderSource(Shader, 3, (const GLchar *const *)string, nullptr);
glCompileShader(*a2);
glGetShaderiv(*a2, 0x8B81u, ¶ms);
if ( !params )
sub_10062ECF8(&v8);
return params == 1;
}