//
// sub_1800DEF60 from 0x1800def60 to 0x1800df147 (487 bytes)
//
// 5 xrefs:
// > sub_1800D6480 @ 0x1800d650b
// > ??> @ 0x1801434f8
// > ??> @ 0x180143508
// > ??> @ 0x1801baf38
// > ??> @ 0x1801baf44
//
// 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 sub_1800DEF60()
{
const CHAR *v0; // rax
__int64 v2; // rbx
FARPROC OSMesaGetProcAddress; // rax
_QWORD v4[2]; // [rsp+28h] [rbp-20h]
v0 = "libOSMesa.dll";
v4[0] = "OSMesa.dll";
v4[1] = 0;
if ( qword_1801AC220 )
return 1;
v2 = 0;
do
{
qword_1801AC220 = LoadLibraryA(v0);
if ( qword_1801AC220 )
break;
v0 = (const CHAR *)v4[v2++];
}
while ( v0 );
if ( qword_1801AC220 )
{
OSMesaCreateContextExt = (__int64 (__fastcall *)(_QWORD, _QWORD, _QWORD, _QWORD, _QWORD))GetProcAddress(
qword_1801AC220,
"OSMesaCreateContextExt");
OSMesaCreateContextAttribs = (__int64)GetProcAddress(qword_1801AC220, "OSMesaCreateContextAttribs");
OSMesaDestroyContext = (__int64)GetProcAddress(qword_1801AC220, "OSMesaDestroyContext");
OSMesaMakeCurrent = (__int64)GetProcAddress(qword_1801AC220, "OSMesaMakeCurrent");
OSMesaGetColorBuffer = (__int64)GetProcAddress(qword_1801AC220, "OSMesaGetColorBuffer");
OSMesaGetDepthBuffer = (__int64)GetProcAddress(qword_1801AC220, "OSMesaGetDepthBuffer");
OSMesaGetProcAddress = GetProcAddress(qword_1801AC220, "OSMesaGetProcAddress");
qword_1801AC258 = (__int64)OSMesaGetProcAddress;
if ( OSMesaCreateContextExt
&& OSMesaDestroyContext
&& OSMesaMakeCurrent
&& OSMesaGetColorBuffer
&& OSMesaGetDepthBuffer
&& OSMesaGetProcAddress )
{
return 1;
}
sub_1800D3530(0x10008u, "OSMesa: Failed to load required entry points");
if ( qword_1801AC220 )
{
FreeLibrary(qword_1801AC220);
qword_1801AC220 = nullptr;
}
return 0;
}
else
{
sub_1800D3530(0x10006u, "OSMesa: Library not found");
return 0;
}
}