//
// cocos2d::CCEGLView::initWithRect from 0x180079fb0 to 0x18007a1e8 (568 bytes)
//
// 7 xrefs:
// > cocos2d::CCEGLView::create @ 0x1800794fc
// > cocos2d::CCEGLView::createWithFullScreen @ 0x1800796c7
// > cocos2d::CCEGLView::createWithRect @ 0x18007975e
// > cocos2d::CCEGLView::initWithFullScreen @ 0x180079e98
// > cocos2d::CCEGLView::initWithFullscreen @ 0x180079f95
// > ??> @ 0x18014cf68
// > ??> @ 0x1801bec68
//
// This function is hookable on this platform (idp: pc, 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:21:59 +0000
//
char __fastcall cocos2d::CCEGLView::initWithRect(cocos2d::CCEGLView *this, _QWORD *a2, float *a3, float a4)
{
float *v6; // rsi
float *v7; // rax
cocos2d::CCRect *v8; // rax
const char *String; // rdi
HWND v10; // rax
__int64 v12; // rcx
int v13; // r8d
int v14; // [rsp+20h] [rbp-158h] BYREF
float v15[6]; // [rsp+28h] [rbp-150h] BYREF
char Buffer[256]; // [rsp+40h] [rbp-138h] BYREF
if ( *((_BYTE *)this + 232) && *((_BYTE *)this + 233) && *((_BYTE *)this + 234) )
{
v6 = a3 + 3;
a3[2] = a3[2] + 1.0;
a3[3] = a3[3] + 1.0;
}
else
{
v6 = a3 + 3;
}
if ( a2[3] > 0xFu )
a2 = (_QWORD *)*a2;
(*(void (__fastcall **)(cocos2d::CCEGLView *, _QWORD *))(*(_QWORD *)this + 128LL))(this, a2);
*((float *)this + 48) = a4;
sub_1800DCA30(131075, 1);
sub_1800DCA30(135181, 0);
sub_1800DCA30(135184, 1);
v7 = kmVec2Fill(v15, a3[2], *v6);
cocos2d::CCSize::operator=((_DWORD *)this + 54, v7);
v8 = cocos2d::CCRect::CCRect((cocos2d::CCRect *)v15, (const struct cocos2d::CCRect *)a3);
cocos2d::CCEGLView::setupWindow(this, v8);
(*(void (__fastcall **)(cocos2d::CCEGLView *))(*(_QWORD *)this + 48LL))(this);
String = (const char *)glGetString(0x1F02u);
if ( atof(String) >= 1.5 )
{
cocos2d::CCEGLView::initGlew(this);
glEnable(0x8642u);
if ( !*((_QWORD *)this + 26) )
{
v12 = *((_QWORD *)this + 25);
v13 = (int)*((float *)this + 55);
LODWORD(v15[0]) = (int)*((float *)this + 54);
v14 = v13;
sub_1800DC800(v12);
sub_1800DC750(*((_QWORD *)this + 25), v15, &v14);
cocos2d::CCEGLViewProtocol::setFrameSize(this, (float)SLODWORD(v15[0]), (float)v14);
sub_1800DC200(*((_QWORD *)this + 25));
}
cocos2d::CCEGLView::makeBorderlessTop(this);
return 1;
}
else
{
memset(Buffer, 0, sizeof(Buffer));
sub_1800095F0(
Buffer,
"OpenGL 1.5 or higher is required (your version is %s). Please upgrade the driver of your video card.",
String);
v10 = (HWND)sub_1800D9CB0(*((_QWORD *)this + 25));
MessageBoxW(v10, L"OpenGL 1.5 or higher is required", L"OpenGL version too old", 0);
return 0;
}
}