mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-01 08:23:15 +00:00
ANDROID: Add GLAD support
This commit is contained in:
parent
a9418f8f63
commit
1c18c269dc
@ -223,8 +223,7 @@ void AndroidGraphicsManager::touchControlNotifyChanged() {
|
||||
void *AndroidGraphicsManager::getProcAddress(const char *name) const {
|
||||
ENTER("%s", name);
|
||||
|
||||
// TODO: Support dynamically loaded OpenGL
|
||||
return nullptr;
|
||||
return androidGLgetProcAddress(name);
|
||||
}
|
||||
|
||||
bool AndroidGraphicsManager::notifyMousePosition(Common::Point &mouse) {
|
||||
|
@ -134,8 +134,6 @@ protected:
|
||||
|
||||
void refreshScreen();
|
||||
|
||||
void *getProcAddress(const char *name) const;
|
||||
|
||||
private:
|
||||
void initOverlay();
|
||||
|
||||
|
@ -40,6 +40,7 @@
|
||||
// for the Android port
|
||||
#define FORBIDDEN_SYMBOL_EXCEPTION_printf
|
||||
|
||||
#include <EGL/egl.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/resource.h>
|
||||
#include <sys/system_properties.h>
|
||||
@ -120,6 +121,11 @@ void checkGlError(const char *expr, const char *file, int line) {
|
||||
}
|
||||
#endif
|
||||
|
||||
void *androidGLgetProcAddress(const char *name) {
|
||||
// This exists since Android 2.3 (API Level 9)
|
||||
return (void *)eglGetProcAddress(name);
|
||||
}
|
||||
|
||||
OSystem_Android::OSystem_Android(int audio_sample_rate, int audio_buffer_size) :
|
||||
_audio_sample_rate(audio_sample_rate),
|
||||
_audio_buffer_size(audio_buffer_size),
|
||||
|
@ -93,6 +93,8 @@ extern void checkGlError(const char *expr, const char *file, int line);
|
||||
#define GLTHREADCHECK do { } while (false)
|
||||
#endif
|
||||
|
||||
void *androidGLgetProcAddress(const char *name);
|
||||
|
||||
class OSystem_Android : public ModularGraphicsBackend, Common::EventSource {
|
||||
private:
|
||||
// passed from the dark side
|
||||
|
@ -40,6 +40,7 @@
|
||||
// for the Android port
|
||||
#define FORBIDDEN_SYMBOL_EXCEPTION_printf
|
||||
|
||||
#include <EGL/egl.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/resource.h>
|
||||
#include <sys/system_properties.h>
|
||||
@ -118,6 +119,11 @@ void checkGlError(const char *expr, const char *file, int line) {
|
||||
}
|
||||
#endif
|
||||
|
||||
void *androidGLgetProcAddress(const char *name) {
|
||||
// This exists since Android 2.3 (API Level 9)
|
||||
return (void *)eglGetProcAddress(name);
|
||||
}
|
||||
|
||||
OSystem_Android::OSystem_Android(int audio_sample_rate, int audio_buffer_size) :
|
||||
_audio_sample_rate(audio_sample_rate),
|
||||
_audio_buffer_size(audio_buffer_size),
|
||||
|
@ -100,6 +100,8 @@ extern void checkGlError(const char *expr, const char *file, int line);
|
||||
#define GLTHREADCHECK do { } while (false)
|
||||
#endif
|
||||
|
||||
void *androidGLgetProcAddress(const char *name);
|
||||
|
||||
class OSystem_Android : public ModularGraphicsBackend, Common::EventSource {
|
||||
private:
|
||||
// passed from the dark side
|
||||
|
@ -114,8 +114,6 @@ protected:
|
||||
|
||||
void refreshScreen();
|
||||
|
||||
void *getProcAddress(const char *name) const;
|
||||
|
||||
private:
|
||||
void setCursorPaletteInternal(const byte *colors, uint start, uint num);
|
||||
void disableCursorPalette();
|
||||
|
6
configure
vendored
6
configure
vendored
@ -5334,10 +5334,12 @@ if test "$_opengl_mode" != none ; then
|
||||
android)
|
||||
# We require API level 16 while GLES2 APIs have been added in level 8 so we are safe for compilation
|
||||
_opengl_mode=gles2
|
||||
_opengl_glad=yes
|
||||
;;
|
||||
android3d)
|
||||
# We require API level 16 while GLES2 APIs have been added in level 8 so we are safe for compilation
|
||||
_opengl_mode=gles2
|
||||
_opengl_glad=yes
|
||||
;;
|
||||
openpandora)
|
||||
# Enable GLES only if user explicitely requested it
|
||||
@ -6125,7 +6127,7 @@ case $_host_os in
|
||||
system_libs=''
|
||||
for lib in $LIBS; do
|
||||
case $lib in
|
||||
-lz|-lm|-ldl|-lGLESv2)
|
||||
-lz|-lm|-ldl)
|
||||
system_libs="$system_libs $lib"
|
||||
;;
|
||||
*)
|
||||
@ -6137,7 +6139,7 @@ case $_host_os in
|
||||
# -lgcc is carefully placed here - we want to catch
|
||||
# all toolchain symbols in *our* libraries rather
|
||||
# than pick up anything unhygenic from the Android libs.
|
||||
LIBS="-Wl,-Bstatic $static_libs -Wl,-Bdynamic -lgcc $system_libs -llog -landroid -ljnigraphics -lGLESv2"
|
||||
LIBS="-Wl,-Bstatic $static_libs -Wl,-Bdynamic -lgcc $system_libs -llog -landroid -ljnigraphics -lEGL"
|
||||
;;
|
||||
ds)
|
||||
# Moved -Wl,--gc-sections here to avoid it interfering with the library checks
|
||||
|
@ -38,6 +38,15 @@
|
||||
static GLADapiproc loadFunc(void *userptr, const char *name) {
|
||||
return (GLADapiproc)SDL_GL_GetProcAddress(name);
|
||||
}
|
||||
|
||||
#elif defined(__ANDROID__)
|
||||
// To keep includes light, don't include EGL here and don't include Android headers
|
||||
void *androidGLgetProcAddress(const char *name);
|
||||
|
||||
static GLADapiproc loadFunc(void *userptr, const char *name) {
|
||||
return (GLADapiproc)androidGLgetProcAddress(name);
|
||||
}
|
||||
|
||||
#else
|
||||
#error Not implemented
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user