comparison src/video/qtopia/SDL_sysvideo.cc @ 481:c96e2137f9eb

Date: Sat, 31 Aug 2002 15:42:45 +0200 From: Alexandre Courbot Subject: [SDL] Qtopia port fixes/improvments -Whenever the screen is rotated, the pad is rotated as well, -Fixed a mouse bug: when tapping on the screen, the click event was often sent at the previous position of the stylus (resulting in strange behavior in Scummvm for instance) -Added the SDL_QT_INVERT_ROTATION environment variable which, when set, rotates the screen (and the mouse, and the pad) the other way. This can be useful for left-handed people.
author Sam Lantinga <slouken@libsdl.org>
date Sun, 01 Sep 2002 00:37:24 +0000
parents 11c8a7684f74
children 969fbd4dcd4e
comparison
equal deleted inserted replaced
480:92596bfe8446 481:c96e2137f9eb
50 #include "SDL_syswm_c.h" 50 #include "SDL_syswm_c.h"
51 #include "SDL_lowvideo.h" 51 #include "SDL_lowvideo.h"
52 52
53 //#define QTOPIA_DEBUG 53 //#define QTOPIA_DEBUG
54 #define QT_HIDDEN_SIZE 32 /* starting hidden window size */ 54 #define QT_HIDDEN_SIZE 32 /* starting hidden window size */
55
56 /* Name of the environment variable used to invert the screen rotation or not:
57 Possible values:
58 !=0 : Screen is 270° rotated
59 0: Screen is 90° rotated*/
60 #define SDL_QT_ROTATION_ENV_NAME "SDL_QT_INVERT_ROTATION"
55 61
56 /* Initialization/Query functions */ 62 /* Initialization/Query functions */
57 static int QT_VideoInit(_THIS, SDL_PixelFormat *vformat); 63 static int QT_VideoInit(_THIS, SDL_PixelFormat *vformat);
58 static SDL_Rect **QT_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags); 64 static SDL_Rect **QT_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
59 static SDL_Surface *QT_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags); 65 static SDL_Surface *QT_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags);
275 QSize desktop_size = qApp->desktop()->size(); 281 QSize desktop_size = qApp->desktop()->size();
276 282
277 283
278 current->flags = SDL_FULLSCREEN; // We always run fullscreen. 284 current->flags = SDL_FULLSCREEN; // We always run fullscreen.
279 285
280 if(width <= desktop_size.width() && height <= desktop_size.height()) { 286 if(width <= desktop_size.width()
287 && height <= desktop_size.height()) {
281 current->w = desktop_size.width(); 288 current->w = desktop_size.width();
282 current->h = desktop_size.height(); 289 current->h = desktop_size.height();
283 } else if(width <= desktop_size.height() 290 } else if(width <= desktop_size.height() && height <= desktop_size.width()) {
284 && height <= desktop_size.width()) {
285 // Landscape mode 291 // Landscape mode
292 char * envString = getenv(SDL_QT_ROTATION_ENV_NAME);
293 int envValue = envString ? atoi(envString) : 0;
294 screenRotation = envValue ? SDL_QT_ROTATION_270 : SDL_QT_ROTATION_90;
286 current->h = desktop_size.width(); 295 current->h = desktop_size.width();
287 current->w = desktop_size.height(); 296 current->w = desktop_size.height();
288 } else { 297 } else {
289 SDL_SetError("Unsupported resolution, %dx%d\n", width, height); 298 SDL_SetError("Unsupported resolution, %dx%d\n", width, height);
290 } 299 }