| | |
| | | |
| | | |
| | | /* These are filled in with real values in Android_SetScreenResolution on init (before SDL_main()) */ |
| | | int Android_ScreenWidth = 0; |
| | | int Android_ScreenHeight = 0; |
| | | int Android_SurfaceWidth = 0; |
| | | int Android_SurfaceHeight = 0; |
| | | int Android_DeviceWidth = 0; |
| | | int Android_DeviceHeight = 0; |
| | | Uint32 Android_ScreenFormat = SDL_PIXELFORMAT_UNKNOWN; |
| | | static int Android_ScreenRate = 0; |
| | | |
| | |
| | | SDL_DisplayMode mode; |
| | | |
| | | mode.format = Android_ScreenFormat; |
| | | mode.w = Android_ScreenWidth; |
| | | mode.h = Android_ScreenHeight; |
| | | mode.w = Android_DeviceWidth; |
| | | mode.h = Android_DeviceHeight; |
| | | mode.refresh_rate = Android_ScreenRate; |
| | | mode.driverdata = NULL; |
| | | if (SDL_AddBasicVideoDisplay(&mode) < 0) { |
| | |
| | | void |
| | | Android_VideoQuit(_THIS) |
| | | { |
| | | Android_QuitMouse(); |
| | | Android_QuitTouch(); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | void |
| | | Android_SetScreenResolution(int width, int height, Uint32 format, float rate) |
| | | Android_SetScreenResolution(int surfaceWidth, int surfaceHeight, int deviceWidth, int deviceHeight, Uint32 format, float rate) |
| | | { |
| | | SDL_VideoDevice* device; |
| | | SDL_VideoDisplay *display; |
| | | Android_ScreenWidth = width; |
| | | Android_ScreenHeight = height; |
| | | SDL_VideoDevice* device; |
| | | SDL_VideoDisplay *display; |
| | | Android_SurfaceWidth = surfaceWidth; |
| | | Android_SurfaceHeight = surfaceHeight; |
| | | Android_DeviceWidth = deviceWidth; |
| | | Android_DeviceHeight = deviceHeight; |
| | | Android_ScreenFormat = format; |
| | | Android_ScreenRate = rate; |
| | | |
| | |
| | | { |
| | | display = &device->displays[0]; |
| | | display->desktop_mode.format = Android_ScreenFormat; |
| | | display->desktop_mode.w = Android_ScreenWidth; |
| | | display->desktop_mode.h = Android_ScreenHeight; |
| | | display->desktop_mode.w = Android_DeviceWidth; |
| | | display->desktop_mode.h = Android_DeviceHeight; |
| | | display->desktop_mode.refresh_rate = Android_ScreenRate; |
| | | } |
| | | |
| | |
| | | display = SDL_GetDisplayForWindow(Android_Window); |
| | | |
| | | display->display_modes[0].format = format; |
| | | display->display_modes[0].w = width; |
| | | display->display_modes[0].h = height; |
| | | display->display_modes[0].w = Android_DeviceWidth; |
| | | display->display_modes[0].h = Android_DeviceHeight; |
| | | display->display_modes[0].refresh_rate = rate; |
| | | display->current_mode = display->display_modes[0]; |
| | | |
| | | SDL_SendWindowEvent(Android_Window, SDL_WINDOWEVENT_RESIZED, width, height); |
| | | SDL_SendWindowEvent(Android_Window, SDL_WINDOWEVENT_RESIZED, surfaceWidth, surfaceHeight); |
| | | } |
| | | } |
| | | |