//
// cocos2d::CCRenderTexture::beginWithClear from 0x10046767c to 0x1004677a4 (296 bytes)
//
// 1 xrefs:
// > cocos2d::CCRenderTexture::beginWithClear_1 @ 0x100467678
//
// 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:05:33 +0000
//
void __fastcall cocos2d::CCRenderTexture::beginWithClear(
__int64 a1,
GLint a2,
GLbitfield a3,
GLfloat a4,
GLfloat a5,
GLfloat a6,
GLfloat a7,
GLclampf a8)
{
GLint s[2]; // [xsp+0h] [xbp-60h] BYREF
GLfloat params[2]; // [xsp+8h] [xbp-58h] BYREF
__int64 v17; // [xsp+10h] [xbp-50h]
cocos2d::CCRenderTexture::begin(a1);
*(_QWORD *)params = 0;
v17 = 0;
*(_QWORD *)s = 0;
if ( (a3 & 0x4000) != 0 )
{
glGetFloatv(0xC22u, params);
glClearColor(a4, a5, a6, a7);
if ( (a3 & 0x100) == 0 )
{
LABEL_3:
if ( (a3 & 0x400) == 0 )
goto LABEL_5;
goto LABEL_4;
}
}
else if ( (a3 & 0x100) == 0 )
{
goto LABEL_3;
}
glGetFloatv(0xB73u, (GLfloat *)&s[1]);
glClearDepthf(a8);
if ( (a3 & 0x400) != 0 )
{
LABEL_4:
glGetIntegerv(0xB91u, s);
glClearStencil(a2);
}
LABEL_5:
glClear(a3);
if ( (a3 & 0x4000) != 0 )
{
glClearColor(params[0], params[1], *(GLfloat *)&v17, *((GLfloat *)&v17 + 1));
if ( (a3 & 0x100) == 0 )
{
LABEL_7:
if ( (a3 & 0x400) == 0 )
return;
goto LABEL_8;
}
}
else if ( (a3 & 0x100) == 0 )
{
goto LABEL_7;
}
glClearDepthf(*(GLclampf *)&s[1]);
if ( (a3 & 0x400) == 0 )
return;
LABEL_8:
glClearStencil(s[0]);
}