//
// sub_1800D33F0 from 0x1800d33f0 to 0x1800d3483 (147 bytes)
//
// 4 xrefs:
// > cocos2d::CCEGLView::setupWindow @ 0x180078af8
// > sub_1800D44F0 @ 0x1800d47d3
// > sub_1800D4950 @ 0x1800d49d1
// > ??> @ 0x1801ba53c
//
// 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
//
__int64 __fastcall sub_1800D33F0(__int64 a1)
{
__int64 result; // rax
__int64 v3; // rdx
if ( !*(_DWORD *)&ModuleName )
return sub_1800D3530(65537, nullptr);
result = sub_1800D99B0(&unk_1801AB18C);
v3 = result;
if ( a1 && !*(_DWORD *)(a1 + 512) )
return sub_1800D3530(65546, "Cannot make current with a window that has no OpenGL or OpenGL ES context");
if ( !result )
{
LABEL_10:
if ( !a1 )
return result;
return (*(__int64 (__fastcall **)(__int64, __int64))(a1 + 584))(a1, v3);
}
if ( !a1 || *(_DWORD *)(a1 + 516) != *(_DWORD *)(result + 516) )
{
result = (*(__int64 (__fastcall **)(_QWORD))(result + 584))(0);
goto LABEL_10;
}
return (*(__int64 (__fastcall **)(__int64, __int64))(a1 + 584))(a1, v3);
}