Mercurial > sdl-ios-xcode
comparison src/video/android/SDL_androidvideo.c @ 5001:77df56570442
Added "mouse" support for the Android touch screen
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Thu, 13 Jan 2011 18:31:15 -0800 |
parents | a514bfe6952a |
children | b530ef003506 |
comparison
equal
deleted
inserted
replaced
5000:6a10693e66c3 | 5001:77df56570442 |
---|---|
27 #include "SDL_video.h" | 27 #include "SDL_video.h" |
28 #include "SDL_mouse.h" | 28 #include "SDL_mouse.h" |
29 #include "../SDL_sysvideo.h" | 29 #include "../SDL_sysvideo.h" |
30 #include "../SDL_pixels_c.h" | 30 #include "../SDL_pixels_c.h" |
31 #include "../../events/SDL_events_c.h" | 31 #include "../../events/SDL_events_c.h" |
32 #include "../../events/SDL_windowevents_c.h" | |
32 | 33 |
33 #include "SDL_androidvideo.h" | 34 #include "SDL_androidvideo.h" |
34 #include "SDL_androidevents.h" | 35 #include "SDL_androidevents.h" |
35 #include "SDL_androidkeyboard.h" | 36 #include "SDL_androidkeyboard.h" |
36 #include "SDL_androidwindow.h" | 37 #include "SDL_androidwindow.h" |
61 // init (before SDL_main()) | 62 // init (before SDL_main()) |
62 int Android_ScreenWidth = 0; | 63 int Android_ScreenWidth = 0; |
63 int Android_ScreenHeight = 0; | 64 int Android_ScreenHeight = 0; |
64 Uint32 Android_ScreenFormat = SDL_PIXELFORMAT_UNKNOWN; | 65 Uint32 Android_ScreenFormat = SDL_PIXELFORMAT_UNKNOWN; |
65 | 66 |
67 /* Currently only one window */ | |
68 SDL_Window *Android_Window = NULL; | |
66 | 69 |
67 static int | 70 static int |
68 Android_Available(void) | 71 Android_Available(void) |
69 { | 72 { |
70 return 1; | 73 return 1; |
156 Android_SetScreenResolution(int width, int height, Uint32 format) | 159 Android_SetScreenResolution(int width, int height, Uint32 format) |
157 { | 160 { |
158 Android_ScreenWidth = width; | 161 Android_ScreenWidth = width; |
159 Android_ScreenHeight = height; | 162 Android_ScreenHeight = height; |
160 Android_ScreenFormat = format; | 163 Android_ScreenFormat = format; |
164 | |
165 if (Android_Window) { | |
166 SDL_SendWindowEvent(Android_Window, SDL_WINDOWEVENT_RESIZED, width, height); | |
167 } | |
161 } | 168 } |
162 | 169 |
163 /* vi: set ts=4 sw=4 expandtab: */ | 170 /* vi: set ts=4 sw=4 expandtab: */ |