mirror of
https://github.com/minetest/irrlicht.git
synced 2024-11-18 05:33:52 +01:00
Stop dlopening libGL(ESv2).so
GLX/EGL are supposed to abstract exactly this away, this is a bad hack at best and might totally break stuff at worst.
This commit is contained in:
parent
25ae156944
commit
074e81f78f
@ -9,7 +9,6 @@
|
||||
#include "irrString.h"
|
||||
#include "irrArray.h"
|
||||
#include "os.h"
|
||||
#include <dlfcn.h>
|
||||
|
||||
#if defined(_IRR_COMPILE_WITH_ANDROID_DEVICE_)
|
||||
#include <android/native_activity.h>
|
||||
@ -21,7 +20,7 @@ namespace video
|
||||
{
|
||||
|
||||
CEGLManager::CEGLManager() : IContextManager(), EglWindow(0), EglDisplay(EGL_NO_DISPLAY),
|
||||
EglSurface(EGL_NO_SURFACE), EglContext(EGL_NO_CONTEXT), EglConfig(0), MajorVersion(0), MinorVersion(0), libHandle(NULL)
|
||||
EglSurface(EGL_NO_SURFACE), EglContext(EGL_NO_CONTEXT), EglConfig(0), MajorVersion(0), MinorVersion(0)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
setDebugName("CEGLManager");
|
||||
@ -110,9 +109,6 @@ void CEGLManager::terminate()
|
||||
|
||||
MajorVersion = 0;
|
||||
MinorVersion = 0;
|
||||
|
||||
if (libHandle)
|
||||
dlclose(libHandle);
|
||||
}
|
||||
|
||||
bool CEGLManager::generateSurface()
|
||||
@ -596,15 +592,7 @@ const SExposedVideoData& CEGLManager::getContext() const
|
||||
|
||||
void* CEGLManager::getProcAddress(const std::string &procName)
|
||||
{
|
||||
void* proc = NULL;
|
||||
proc = (void*)eglGetProcAddress(procName.c_str());
|
||||
if (!proc) { // fallback
|
||||
if (!libHandle)
|
||||
libHandle = dlopen("libGLESv2.so", RTLD_LAZY);
|
||||
if (libHandle)
|
||||
proc = dlsym(libHandle, procName.c_str());
|
||||
}
|
||||
return proc;
|
||||
return (void*)eglGetProcAddress(procName.c_str());
|
||||
}
|
||||
|
||||
bool CEGLManager::swapBuffers()
|
||||
|
@ -111,8 +111,6 @@ namespace video
|
||||
|
||||
EGLint MajorVersion;
|
||||
EGLint MinorVersion;
|
||||
|
||||
void* libHandle;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,6 @@
|
||||
#ifdef _IRR_COMPILE_WITH_GLX_MANAGER_
|
||||
|
||||
#include "os.h"
|
||||
#include <dlfcn.h>
|
||||
|
||||
#if defined(_IRR_OPENGL_USE_EXTPOINTER_)
|
||||
#define GL_GLEXT_LEGACY 1
|
||||
@ -29,7 +28,7 @@ namespace video
|
||||
{
|
||||
|
||||
CGLXManager::CGLXManager(const SIrrlichtCreationParameters& params, const SExposedVideoData& videodata, int screennr)
|
||||
: Params(params), PrimaryContext(videodata), VisualInfo(0), glxFBConfig(0), GlxWin(0), libHandle(NULL)
|
||||
: Params(params), PrimaryContext(videodata), VisualInfo(0), glxFBConfig(0), GlxWin(0)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
setDebugName("CGLXManager");
|
||||
@ -280,8 +279,6 @@ bool CGLXManager::initialize(const SIrrlichtCreationParameters& params, const SE
|
||||
|
||||
void CGLXManager::terminate()
|
||||
{
|
||||
if (libHandle)
|
||||
dlclose(libHandle);
|
||||
memset((void*)&CurrentContext, 0, sizeof(CurrentContext));
|
||||
}
|
||||
|
||||
@ -469,15 +466,7 @@ void CGLXManager::destroyContext()
|
||||
|
||||
void* CGLXManager::getProcAddress(const std::string &procName)
|
||||
{
|
||||
void* proc = NULL;
|
||||
proc = (void*)glXGetProcAddressARB(reinterpret_cast<const GLubyte*>(procName.c_str()));
|
||||
if (!proc) {
|
||||
if (!libHandle)
|
||||
libHandle = dlopen("libGL.so", RTLD_LAZY);
|
||||
if (libHandle)
|
||||
proc = dlsym(libHandle, procName.c_str());
|
||||
}
|
||||
return proc;
|
||||
return (void*)glXGetProcAddressARB(reinterpret_cast<const GLubyte*>(procName.c_str()));
|
||||
}
|
||||
|
||||
bool CGLXManager::swapBuffers()
|
||||
|
@ -72,7 +72,6 @@ namespace video
|
||||
XVisualInfo* VisualInfo;
|
||||
void* glxFBConfig; // GLXFBConfig
|
||||
XID GlxWin; // GLXWindow
|
||||
void* libHandle; // handle to libGL.so
|
||||
};
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user