Mercurial > sdl-ios-xcode
diff src/video/android/SDL_androidvideo.c @ 4998:a514bfe6952a
The window is changed to reflect the actual screen dimensions, for now.
Implemented SDL_SetWindowTitle(), which turned out to be fairly complex
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Thu, 13 Jan 2011 15:10:17 -0800 |
parents | 55b82067815b |
children | 77df56570442 |
line wrap: on
line diff
--- a/src/video/android/SDL_androidvideo.c Thu Jan 13 12:36:59 2011 -0800 +++ b/src/video/android/SDL_androidvideo.c Thu Jan 13 15:10:17 2011 -0800 @@ -33,6 +33,7 @@ #include "SDL_androidvideo.h" #include "SDL_androidevents.h" #include "SDL_androidkeyboard.h" +#include "SDL_androidwindow.h" #define ANDROID_VID_DRIVER_NAME "Android" @@ -58,9 +59,9 @@ // These are filled in with real values in Android_SetScreenResolution on // init (before SDL_main()) -static Uint32 iScreenFormat = SDL_PIXELFORMAT_UNKNOWN; -static int iScreenWidth = 0; -static int iScreenHeight = 0; +int Android_ScreenWidth = 0; +int Android_ScreenHeight = 0; +Uint32 Android_ScreenFormat = SDL_PIXELFORMAT_UNKNOWN; static int @@ -96,6 +97,10 @@ device->VideoQuit = Android_VideoQuit; device->PumpEvents = Android_PumpEvents; + device->CreateWindow = Android_CreateWindow; + device->SetWindowTitle = Android_SetWindowTitle; + device->DestroyWindow = Android_DestroyWindow; + device->free = Android_DeleteDevice; /* GL pointers */ @@ -123,9 +128,9 @@ { SDL_DisplayMode mode; - mode.format = iScreenFormat; - mode.w = iScreenWidth; - mode.h = iScreenHeight; + mode.format = Android_ScreenFormat; + mode.w = Android_ScreenWidth; + mode.h = Android_ScreenHeight; mode.refresh_rate = 0; mode.driverdata = NULL; if (SDL_AddBasicVideoDisplay(&mode) < 0) { @@ -146,12 +151,13 @@ { } +/* This function gets called before VideoInit() */ void Android_SetScreenResolution(int width, int height, Uint32 format) { - iScreenWidth = width; - iScreenHeight = height; - iScreenFormat = format; + Android_ScreenWidth = width; + Android_ScreenHeight = height; + Android_ScreenFormat = format; } /* vi: set ts=4 sw=4 expandtab: */