mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-11 21:58:31 +09:00
[Feat] (MG_Impl/GLX): Implement glXGetProcAddress.
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
#include "../../../Includes.h"
|
||||
|
||||
MOBILEGL_GLX_API void* glXGetProcAddress(const char* name) {
|
||||
return MG_Impl::GLXImpl::GetProcAddress(name);
|
||||
}
|
||||
|
||||
MOBILEGL_GLX_API void* glXGetProcAddressARB(const char* name) {
|
||||
return MG_Impl::GLXImpl::GetProcAddressARB(name);
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
#include "../../../Includes.h"
|
||||
|
||||
namespace MG_Impl::GLXImpl {
|
||||
void* GetProcAddress(const char* name) {
|
||||
MGLOG_D("glXGetProcAddress(\"%s\")", name);
|
||||
void* proc = dlsym(RTLD_DEFAULT, (const char*)name);
|
||||
|
||||
if (!proc) {
|
||||
MGLOG_W("Failed to get function: %s", (const char*)name);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return proc;
|
||||
}
|
||||
|
||||
void* GetProcAddressARB(const char* name) {
|
||||
return GetProcAddress(name);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
namespace MG_Impl {
|
||||
namespace GLXImpl {
|
||||
void* GetProcAddress(const char* name);
|
||||
void* GetProcAddressARB(const char* name);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user