added option UseGlshim in AndroidAppSettings.cfg

This commit is contained in:
lubomyr
2016-01-09 19:23:05 +02:00
parent 7cdf3050a4
commit 27944784d8
4 changed files with 27 additions and 1 deletions

View File

@@ -42,6 +42,8 @@ APPLICATION_BUILD_EXCLUDE :=
APPLICATION_CUSTOM_BUILD_SCRIPT :=
USE_GLSHIM :=
SDL_ADDITIONAL_CFLAGS := -DSDL_ANDROID_KEYCODE_MOUSE=UNKNOWN -DSDL_ANDROID_KEYCODE_0=LCTRL -DSDL_ANDROID_KEYCODE_1=LALT -DSDL_ANDROID_KEYCODE_2=SPACE -DSDL_ANDROID_KEYCODE_3=RETURN -DSDL_ANDROID_KEYCODE_4=RETURN
SDL_VERSION := 1.2

View File

@@ -57,6 +57,10 @@ LOCAL_SRC_FILES := $(foreach F, $(SDL_SRCS), $(addprefix $(dir $(F)),$(notdir $(
LOCAL_SHARED_LIBRARIES := sdl_native_helpers # Not really a dependency, needed for CustomBuildScript
ifdef USE_GLSHIM
LOCAL_STATIC_LIBRARIES := glshim
endif
LOCAL_LDLIBS := -lGLESv1_CM -ldl -llog
include $(BUILD_SHARED_LIBRARY)

View File

@@ -61,6 +61,10 @@ If you compile this code with SDL 1.3 or newer, or use in some other way, the li
#define DEBUGOUT(...)
#endif
#ifdef USE_GLSHIM
#include <GL/gl.h>
#endif
static int ANDROID_VideoInit(_THIS, SDL_PixelFormat *vformat);
static SDL_Rect **ANDROID_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
static SDL_Surface *ANDROID_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
@@ -1236,6 +1240,10 @@ static void* ANDROID_GL_GetProcAddress(_THIS, const char *proc)
void * func = dlsym(glLibraryHandle, proc);
if(!func && gl2LibraryHandle)
func = dlsym(gl2LibraryHandle, proc);
#ifdef USE_GLSHIM
if (func==NULL)
func = glXGetProcAddress(proc);
#endif
__android_log_print(ANDROID_LOG_INFO, "libSDL", "ANDROID_GL_GetProcAddress(\"%s\"): %p", proc, func);
return func;
};