//
// -[EAGLView setupSurfaceWithSharegroup:] from 0x10049c948 to 0x10049caa0 (344 bytes)
//
// 2 xrefs:
// > -[EAGLView initWithFrame:pixelFormat:depthFormat:preserveBackbuffer:sharegroup:multiSampling:numberOfSamples:] @ 0x10049c6ac
// > ??> @ 0x1009d3860
//
// This function is hookable on this platform (idp: arm, 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:05:59 +0000
//
bool __cdecl -[EAGLView setupSurfaceWithSharegroup:](EAGLView *self, SEL a2, id a3)
{
void *v5; // x21
CCES2Renderer *v6; // x0
CCES2Renderer *v7; // x20
GLenum Error; // w0
v5 = -[EAGLView layer](self, "layer");
objc_msgSend(v5, "setOpaque:", 1);
objc_msgSend(
v5,
"setDrawableProperties:",
+[NSDictionary dictionaryWithObjectsAndKeys:](
&OBJC_CLASS___NSDictionary,
"dictionaryWithObjectsAndKeys:",
+[NSNumber numberWithBool:](&OBJC_CLASS___NSNumber, "numberWithBool:", self->preserveBackbuffer_),
kEAGLDrawablePropertyRetainedBacking,
self->pixelformat_,
kEAGLDrawablePropertyColorFormat,
0));
v6 = -[CCES2Renderer initWithDepthFormat:withPixelFormat:withSharegroup:withMultiSampling:withNumberOfSamples:](
objc_alloc(&OBJC_CLASS___CCES2Renderer),
"initWithDepthFormat:withPixelFormat:withSharegroup:withMultiSampling:withNumberOfSamples:",
self->depthFormat_,
-[EAGLView convertPixelFormat:](self, "convertPixelFormat:", self->pixelformat_),
a3,
self->multiSampling_,
self->requestedSamples_);
v7 = v6;
self->renderer_ = (CCESRenderer *)v6;
if ( v6 )
{
self->context_ = -[CCES2Renderer context](v6, "context");
Error = glGetError();
if ( Error )
printf("OpenGL error 0x%04X in %s %d\n", Error, "-[EAGLView setupSurfaceWithSharegroup:]", 246);
}
return v7 != nullptr;
}