mirror of
https://github.com/love2d/love.git
synced 2026-08-19 12:14:20 +02:00
Fixed OpenGL ES function loading on some Android devices.
This commit is contained in:
@@ -40,6 +40,10 @@
|
|||||||
#include <SDL_syswm.h>
|
#include <SDL_syswm.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef LOVE_ANDROID
|
||||||
|
#include <dlfcn.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace love
|
namespace love
|
||||||
{
|
{
|
||||||
namespace graphics
|
namespace graphics
|
||||||
@@ -47,6 +51,17 @@ namespace graphics
|
|||||||
namespace opengl
|
namespace opengl
|
||||||
{
|
{
|
||||||
|
|
||||||
|
static void *LOVEGetProcAddress(const char *name)
|
||||||
|
{
|
||||||
|
#ifdef LOVE_ANDROID
|
||||||
|
void *proc = dlsym(RTLD_DEFAULT, name);
|
||||||
|
if (proc)
|
||||||
|
return proc;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
return SDL_GL_GetProcAddress(name);
|
||||||
|
}
|
||||||
|
|
||||||
OpenGL::OpenGL()
|
OpenGL::OpenGL()
|
||||||
: stats()
|
: stats()
|
||||||
, contextInitialized(false)
|
, contextInitialized(false)
|
||||||
@@ -67,7 +82,7 @@ bool OpenGL::initContext()
|
|||||||
if (contextInitialized)
|
if (contextInitialized)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (!gladLoadGLLoader(SDL_GL_GetProcAddress))
|
if (!gladLoadGLLoader(LOVEGetProcAddress))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
initOpenGLFunctions();
|
initOpenGLFunctions();
|
||||||
|
|||||||
Reference in New Issue
Block a user