Fixed SDL_GL_GetProcAddress
This commit is contained in:
2
build.sh
2
build.sh
@@ -15,5 +15,5 @@ if ( grep "package $AppFullName;" project/src/Globals.java > /dev/null && [ "`re
|
||||
touch project/src/Globals.java
|
||||
fi
|
||||
|
||||
cd project && env PATH=$NDKBUILDPATH nice -n10 ndk-build -j4 V=1 && ant `test -n "$1" && echo release || echo debug` && test -z "$1" && cd bin && adb install -r DemoActivity-debug.apk
|
||||
cd project && env PATH=$NDKBUILDPATH nice -n10 ndk-build V=1 && ant `test -n "$1" && echo release || echo debug` && test -z "$1" && cd bin && adb install -r DemoActivity-debug.apk
|
||||
|
||||
|
||||
@@ -22,8 +22,8 @@ AppTouchscreenKeyboardKeysAmount=0
|
||||
AppTouchscreenKeyboardKeysAmountAutoFire=0
|
||||
RedefinedKeysScreenKb="LCTRL M T H E C SPACE C S L"
|
||||
MultiABI=n
|
||||
AppVersionCode=218811
|
||||
AppVersionName="2188.11"
|
||||
AppVersionCode=219311
|
||||
AppVersionName="2193.11"
|
||||
CompiledLibraries="sdl_net sdl_mixer sdl_image sdl_ttf png intl"
|
||||
CustomBuildScript=n
|
||||
AppCflags='-finline-functions -O2 -DWITH_ZLIB -DWITH_MIXER -DWITH_XML -DWITH_IMAGE -DWITH_TTF -DWITH_AI=simple'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# The application settings for Android libSDL port
|
||||
AppSettingVersion=15
|
||||
LibSdlVersion=1.3
|
||||
AppSettingVersion=16
|
||||
LibSdlVersion=1.2
|
||||
AppName="GLXGears"
|
||||
AppFullName=org.opengl.glxgears
|
||||
ScreenOrientation=h
|
||||
@@ -20,6 +20,7 @@ NonBlockingSwapBuffers=n
|
||||
RedefinedKeys="RETURN"
|
||||
AppTouchscreenKeyboardKeysAmount=0
|
||||
AppTouchscreenKeyboardKeysAmountAutoFire=0
|
||||
RedefinedKeysScreenKb="RETURN"
|
||||
MultiABI=n
|
||||
AppVersionCode=1
|
||||
AppVersionName="1"
|
||||
|
||||
@@ -1423,7 +1423,11 @@ void *SDL_GL_GetProcAddress(const char* proc)
|
||||
|
||||
func = NULL;
|
||||
if ( video->GL_GetProcAddress ) {
|
||||
#ifdef ANDROID
|
||||
if ( 1 ) {
|
||||
#else
|
||||
if ( video->gl_config.driver_loaded ) {
|
||||
#endif
|
||||
func = video->GL_GetProcAddress(this, proc);
|
||||
} else {
|
||||
SDL_SetError("No GL driver has been loaded");
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
#include <stdint.h>
|
||||
#include <math.h>
|
||||
#include <string.h> // for memset()
|
||||
#include <dlfcn.h>
|
||||
|
||||
#define _THIS SDL_VideoDevice *this
|
||||
|
||||
@@ -67,6 +68,7 @@ static int ANDROID_CheckHWBlit(_THIS, SDL_Surface *src, SDL_Surface *dst);
|
||||
static int ANDROID_FillHWRect(_THIS, SDL_Surface *dst, SDL_Rect *rect, Uint32 color);
|
||||
static int ANDROID_SetHWColorKey(_THIS, SDL_Surface *surface, Uint32 key);
|
||||
static int ANDROID_SetHWAlpha(_THIS, SDL_Surface *surface, Uint8 value);
|
||||
static void* ANDROID_GL_GetProcAddress(_THIS, const char *proc);
|
||||
|
||||
// Stubs to get rid of crashing in OpenGL mode
|
||||
// The implementation dependent data for the window manager cursor
|
||||
@@ -111,11 +113,12 @@ typedef struct SDL_Texture private_hwdata;
|
||||
// Pointer to in-memory video surface
|
||||
int SDL_ANDROID_sFakeWindowWidth = 640;
|
||||
int SDL_ANDROID_sFakeWindowHeight = 480;
|
||||
static int sdl_opengl = 0;
|
||||
int sdl_opengl = 0;
|
||||
static SDL_Window *SDL_VideoWindow = NULL;
|
||||
SDL_Surface *SDL_CurrentVideoSurface = NULL;
|
||||
static int HwSurfaceCount = 0;
|
||||
static SDL_Surface ** HwSurfaceList = NULL;
|
||||
void * glLibraryHandle = NULL;
|
||||
|
||||
static Uint32 SDL_VideoThreadID = 0;
|
||||
int SDL_ANDROID_InsideVideoThread()
|
||||
@@ -175,6 +178,7 @@ static SDL_VideoDevice *ANDROID_CreateDevice(int devindex)
|
||||
device->InitOSKeymap = ANDROID_InitOSKeymap;
|
||||
device->PumpEvents = ANDROID_PumpEvents;
|
||||
device->GL_SwapBuffers = ANDROID_GL_SwapBuffers;
|
||||
device->GL_GetProcAddress = ANDROID_GL_GetProcAddress;
|
||||
device->free = ANDROID_DeleteDevice;
|
||||
|
||||
// Stubs
|
||||
@@ -183,6 +187,9 @@ static SDL_VideoDevice *ANDROID_CreateDevice(int devindex)
|
||||
device->ShowWMCursor = ANDROID_ShowWMCursor;
|
||||
//device->WarpWMCursor = ANDROID_WarpWMCursor;
|
||||
//device->MoveWMCursor = ANDROID_MoveWMCursor;
|
||||
|
||||
glLibraryHandle = dlopen("libGLESv1_CM.so", RTLD_NOW);
|
||||
__android_log_print(ANDROID_LOG_INFO, "libSDL", "dlopen(\"libGLESv1_CM.so\"): %p", glLibraryHandle);
|
||||
|
||||
return device;
|
||||
}
|
||||
@@ -245,7 +252,7 @@ int ANDROID_VideoInit(_THIS, SDL_PixelFormat *vformat)
|
||||
SDL_modelist[11] = NULL;
|
||||
|
||||
SDL_VideoInit_1_3(NULL, 0);
|
||||
|
||||
|
||||
/* We're done! */
|
||||
return(0);
|
||||
}
|
||||
@@ -263,7 +270,7 @@ SDL_Surface *ANDROID_SetVideoMode(_THIS, SDL_Surface *current,
|
||||
SDL_PixelFormat format;
|
||||
int bpp1;
|
||||
|
||||
__android_log_print(ANDROID_LOG_INFO, "libSDL", "SDL_SetVideoMode(): application requested mode %dx%d", width, height);
|
||||
__android_log_print(ANDROID_LOG_INFO, "libSDL", "SDL_SetVideoMode(): application requested mode %dx%d OpenGL %d HW %d", width, height, flags & SDL_OPENGL, flags & SDL_HWSURFACE);
|
||||
if( ! SDL_ANDROID_InsideVideoThread() )
|
||||
{
|
||||
__android_log_print(ANDROID_LOG_INFO, "libSDL", "Error: calling %s not from the main thread!", __PRETTY_FUNCTION__);
|
||||
@@ -351,7 +358,6 @@ SDL_Surface *ANDROID_SetVideoMode(_THIS, SDL_Surface *current,
|
||||
|
||||
/* Set up the new mode framebuffer */
|
||||
SDL_CurrentVideoSurface = current;
|
||||
|
||||
|
||||
/* We're done */
|
||||
return(current);
|
||||
@@ -954,3 +960,9 @@ void SDL_ANDROID_VideoContextRecreated()
|
||||
}
|
||||
};
|
||||
|
||||
static void* ANDROID_GL_GetProcAddress(_THIS, const char *proc)
|
||||
{
|
||||
void * func = dlsym(glLibraryHandle, proc);
|
||||
__android_log_print(ANDROID_LOG_INFO, "libSDL", "ANDROID_GL_GetProcAddress(\"%s\"): %p", proc, func);
|
||||
return func;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user