Fixed SDL 1.3 compilation

This commit is contained in:
pelya
2010-07-29 17:04:56 +03:00
parent 2e4e52a193
commit fb5561ff45
2 changed files with 12 additions and 5 deletions

View File

@@ -76,6 +76,8 @@ static SDL_scancode TranslateKey(int scancode, SDL_keysym *keysym)
return keymap[scancode];
}
#define SDL_SendKeyboardKey(X, Y) SDL_SendKeyboardKey(X, Y, SDL_FALSE)
#else
#define SDL_KEY2(X) SDLK_ ## X
@@ -170,11 +172,10 @@ JAVA_EXPORT_NAME(DemoGLSurfaceView_nativeMouse) ( JNIEnv* env, jobject thiz, j
// Translate mouse coordinates
#if SDL_VERSION_ATLEAST(1,3,0)
SDL_Renderer *renderer;
renderer = SDL_GetCurrentRenderer(SDL_TRUE);
if( renderer && renderer->window ) {
x = x * renderer->window->w / renderer->window->display->desktop_mode.w;
y = y * renderer->window->h / renderer->window->display->desktop_mode.h;
SDL_Window * window = SDL_GetFocusWindow();
if( window && window->renderer->window ) {
x = x * window->w / window->display->desktop_mode.w;
y = y * window->h / window->display->desktop_mode.h;
}
#else
x = x * SDL_ANDROID_sFakeWindowWidth / SDL_ANDROID_sWindowWidth;

View File

@@ -98,6 +98,12 @@ static SDL_VideoDevice *ANDROID_CreateDevice(int devindex)
return device;
}
static int
ANDROID_Available(void)
{
return 1;
}
VideoBootStrap ANDROID_bootstrap = {
"android", "SDL Android video driver",
ANDROID_Available, ANDROID_CreateDevice