mirror of
https://github.com/MobileGL-Dev/MobileGlues.git
synced 2025-09-23 03:04:03 -04:00
[Fix] (GLX/Lookup): Implement custom multidraw func for iOS.
This commit is contained in:
parent
7179e591c2
commit
8d1179d232
@ -15,10 +15,10 @@
|
||||
|
||||
#define DEBUG 0
|
||||
|
||||
void* get_multidraw_func(const char* name) {
|
||||
const char* handle_multidraw_func_name(const char* name) {
|
||||
std::string namestr = name;
|
||||
if (namestr != "glMultiDrawElementsBaseVertex" && namestr != "glMultiDrawElements") {
|
||||
return nullptr;
|
||||
return name;
|
||||
} else {
|
||||
namestr = "mg_" + namestr;
|
||||
}
|
||||
@ -44,21 +44,19 @@ void* get_multidraw_func(const char* name) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return dlsym(RTLD_DEFAULT, namestr.c_str());
|
||||
return namestr.c_str();
|
||||
}
|
||||
|
||||
void *glXGetProcAddress(const char *name) {
|
||||
LOG()
|
||||
name = handle_multidraw_func_name(name);
|
||||
#ifdef __APPLE__
|
||||
return dlsym((void*)(~(uintptr_t)0), name);
|
||||
#else
|
||||
|
||||
void* proc = nullptr;
|
||||
|
||||
proc = get_multidraw_func(name);
|
||||
|
||||
if (!proc)
|
||||
proc = dlsym(RTLD_DEFAULT, (const char*)name);
|
||||
proc = dlsym(RTLD_DEFAULT, (const char*)name);
|
||||
|
||||
if (!proc) {
|
||||
fprintf(stderr, "Failed to get OpenGL function %s: %s\n", name, dlerror());
|
||||
|
Loading…
x
Reference in New Issue
Block a user