//
// -[EAGLView initWithFrame:shareContext:] from 0x100665980 to 0x100665ae3 (355 bytes)
//
// 2 xrefs:
// > -[EAGLView initWithFrame:] @ 0x10066596e
// > ??> @ 0x10099aee0
//
// 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
//
EAGLView *__cdecl -[EAGLView initWithFrame:shareContext:](EAGLView *self, SEL a2, CGRect a3, id a4)
{
id v5; // rax
id v6; // r15
id v7; // rax
__int64 v8; // r8
__int64 v9; // r9
EAGLView *v10; // rax
__int64 v11; // r14
cocos2d::CCEGLView *v12; // rax
float width; // xmm0_4
float height; // xmm1_4
objc_super v16; // [rsp+40h] [rbp-50h] BYREF
__int128 v17; // [rsp+50h] [rbp-40h] BYREF
v17 = xmmword_100823200;
v5 = objc_alloc((Class)&OBJC_CLASS___NSOpenGLPixelFormat);
v6 = objc_msgSend(v5, "initWithAttributes:", &v17);
if ( !v6 )
NSLog((NSString *)CFSTR("No OpenGL pixel format"));
v7 = objc_autorelease(v6);
v16.receiver = self;
v16.super_class = (Class)&OBJC_CLASS___EAGLView;
v10 = -[EAGLView initWithFrame:pixelFormat:](
&v16,
"initWithFrame:pixelFormat:",
v7,
&OBJC_CLASS___EAGLView,
v8,
v9,
*(_QWORD *)&a3.origin.x,
*(_QWORD *)&a3.origin.y,
*(_QWORD *)&a3.size.width,
*(_QWORD *)&a3.size.height);
v11 = (__int64)v10;
if ( v10 )
{
if ( a4 )
-[EAGLView setOpenGLContext:](v10, "setOpenGLContext:", a4);
*(_QWORD *)(v11 + 8) = +[CCEventDispatcher sharedDispatcher](&OBJC_CLASS___CCEventDispatcher, "sharedDispatcher");
}
v12 = cocos2d::CCEGLView::sharedOpenGLView();
width = a3.size.width;
height = a3.size.height;
((void (__fastcall *)(cocos2d::CCEGLView *, float, float))v12->setFrameSize)(v12, width, height);
*(_DWORD *)(v11 + 80) = 1065353216;
*(_DWORD *)(v11 + 84) = 1065353216;
qword_1009A38D8 = v11;
return (EAGLView *)v11;
}