//
// cocos2d::CCRenderTexture::begin from 0x7e0920 to 0x7e0ac6 (422 bytes)
//
// 8 xrefs:
// > cocos2d::extension::CCControlSwitchSprite::needsLayout @ 0x7aa25e
// > cocos2d::CCTransitionCrossFade::onEnter @ 0x7dae28
// > cocos2d::CCTransitionCrossFade::onEnter @ 0x7daeca
// > cocos2d::CCTransitionProgress::onEnter @ 0x7dbc42
// > cocos2d::CCRenderTexture::beginWithClear @ 0x7e0aea
// > cocos2d::CCRenderTexture::clearDepth @ 0x7e0c08
// > cocos2d::CCRenderTexture::draw @ 0x7e0c5e
// > cocos2d::CCRenderTexture::newCCImage @ 0x7e0dc2
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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:00:49 +0000
//
int __fastcall cocos2d::CCRenderTexture::begin(cocos2d::CCRenderTexture *this)
{
cocos2d::CCDirector *v2; // r0
float *v3; // r5
const cocos2d::CCSize *ContentSizeInPixels; // r0
float v5; // s16
float v6; // s17
cocos2d::CCConfiguration *v7; // r0
int v8; // r0
int v9; // r8
const char *v10; // r8
int result; // r0
float v12; // [sp+10h] [bp-60h] BYREF
float v13; // [sp+14h] [bp-5Ch]
float v14[2]; // [sp+18h] [bp-58h] BYREF
int v15[3]; // [sp+20h] [bp-50h] BYREF
float v16[16]; // [sp+2Ch] [bp-44h] BYREF
kmGLMatrixMode(5889);
kmGLPushMatrix();
kmGLMatrixMode(5888);
kmGLPushMatrix();
v3 = (float *)cocos2d::CCDirector::sharedDirector(v2);
cocos2d::CCDirector::setProjection(v3, *((_DWORD *)v3 + 61));
ContentSizeInPixels = (const cocos2d::CCSize *)cocos2d::CCTexture2D::getContentSizeInPixels(*((cocos2d::CCTexture2D **)this
+ 70));
cocos2d::CCSize::CCSize(&v12, ContentSizeInPixels);
if ( *((float *)this + 82) > 0.0 )
v12 = COERCE_FLOAT(roundf());
if ( *((float *)this + 83) > 0.0 )
v13 = COERCE_FLOAT(roundf());
cocos2d::CCDirector::getWinSizeInPixels((cocos2d::CCDirector *)v14, v3);
v5 = v14[1] / v13;
v6 = v14[0] / v12;
glViewport(0, 0, (int)v12, (int)v13);
kmMat4OrthographicProjection((int)v16, -1.0 / v6, 1.0 / v6, -1.0 / v5, 1.0 / v5, -1.0, 1.0);
kmGLMultMatrix(v16);
glGetIntegerv(0x8CA6u, (GLint *)this + 69);
v7 = (cocos2d::CCConfiguration *)glBindFramebuffer();
v8 = cocos2d::CCConfiguration::sharedConfiguration(v7);
memset(v15, 0, sizeof(v15));
v9 = v8;
std::string::__init(v15, "GL_QCOM", 7u);
v10 = cocos2d::CCConfiguration::checkForGLExtension(v9, (int)v15);
result = std::string::~string((int)v15);
if ( v10 )
{
(*(void (__fastcall **)(_DWORD))(**((_DWORD **)this + 71) + 52))(*((_DWORD *)this + 71));
glFramebufferTexture2D();
glClear(0x4100u);
(*(void (__fastcall **)(_DWORD))(**((_DWORD **)this + 70) + 52))(*((_DWORD *)this + 70));
return glFramebufferTexture2D();
}
return result;
}