//
// cocos2d::CCEGLView::setupWindow from 0x180078a60 to 0x180078c8d (557 bytes)
//
// 4 xrefs:
// > cocos2d::CCEGLView::initWithRect @ 0x18007736c
// > cocos2d::CCEGLView::toggleFullScreen @ 0x180078f7a
// > ??> @ 0x1801438a8
// > ??> @ 0x1801b4ad0
//
// 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
//
// Hidden C++ exception states: #wind=1
__int64 __fastcall cocos2d::CCEGLView::setupWindow(cocos2d::CCEGLView *this, struct cocos2d::CCRect *a2)
{
__int64 v3; // rax
HWND v4; // rax
__int64 v5; // rax
_QWORD *v6; // rax
unsigned int ThrdAddr[4]; // [rsp+40h] [rbp-18h] BYREF
v3 = sub_1800D44F0(
(int)(float)(*((float *)this + 48) * a2->size.width),
(int)(float)(*((float *)this + 48) * a2->size.height),
(int)this + 48,
*((_QWORD *)this + 26),
0);
*((_QWORD *)this + 25) = v3;
if ( *((_BYTE *)this + 232) && *((_BYTE *)this + 233) && *((_BYTE *)this + 234) )
{
v4 = (HWND)sub_1800D8320(v3);
SetWindowPos(v4, HWND_MESSAGE|0x2LL, 0, 0, 0, 0, 0x53u);
}
sub_1800D33F0(*((_QWORD *)this + 25));
sub_1800D5B00(*((_QWORD *)this + 25), sub_180077810);
sub_1800D57B0(*((_QWORD *)this + 25), sub_1800775B0);
sub_1800D5AC0(*((_QWORD *)this + 25), 0);
sub_1800D5A80(*((_QWORD *)this + 25), 0);
v5 = sub_1800D8320(*((_QWORD *)this + 25));
if ( !byte_1801A8528 )
{
qword_1801A8520 = v5;
byte_1801A8528 = 1;
v6 = operator new(8u);
if ( v6 )
*v6 = &qword_1801A8520;
else
v6 = nullptr;
*(_QWORD *)ThrdAddr = beginthreadex(nullptr, 0, (_beginthreadex_proc_type)StartAddress, v6, 0, &ThrdAddr[2]);
if ( !*(_QWORD *)ThrdAddr )
{
ThrdAddr[2] = 0;
std::_Throw_Cpp_error(6);
JUMPOUT(0x180078C8CLL);
}
if ( dword_1801A8538 )
terminate();
unk_1801A8530 = *(_OWORD *)ThrdAddr;
}
sub_1800D4BE0(*((_QWORD *)this + 25), sub_180077C40);
sub_1800D4A90(*((_QWORD *)this + 25), sub_180077E00);
sub_1800D4C70(*((_QWORD *)this + 25), sub_180077C90);
sub_1800D4B10(*((_QWORD *)this + 25), cocos2d::CCNode::updateTweenActionInt);
sub_1800D5830(*((_QWORD *)this + 25), sub_1800776C0);
sub_1800D4BA0(*((_QWORD *)this + 25), sub_180077BE0);
sub_1800D57F0(*((_QWORD *)this + 25), sub_180077670);
return sub_1800D4B60(*((_QWORD *)this + 25), sub_180077B90);
}