//
// cocos2d::CCGLProgram::compileShader from 0x1001b35d4 to 0x1001b36ac (216 bytes)
//
// 2 xrefs:
// > cocos2d::CCGLProgram::initWithVertexShaderByteArray @ 0x1001b3578
// > cocos2d::CCGLProgram::initWithVertexShaderByteArray @ 0x1001b3590
//
// This function is hookable on this platform (idp: arm, 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 11:00:09 +0000
//
bool __fastcall cocos2d::CCGLProgram::compileShader(int a1, GLuint *a2, GLenum type, GLchar *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 ( type == 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] = a4;
Shader = glCreateShader(type);
*a2 = Shader;
glShaderSource(Shader, 3, (const GLchar *const *)string, nullptr);
glCompileShader(*a2);
glGetShaderiv(*a2, 0x8B81u, ¶ms);
if ( !params )
sub_100754EC8(&v8);
return params == 1;
}