Mercurial > sdl-ios-xcode
annotate src/video/maccommon/SDL_lowvideo.h @ 664:abfdc08eb289
Date: Sun, 3 Aug 2003 22:07:57 +0200
From: Max Horn
Subject: SDL OSX fullscreen FIX
the attached patch fixes the fullscreen problems on SDL/OSX. The cause
was that click events are bounded by winRect. Now, winRect is set to
the size of the video surface. But if you e.g. request a 640x420
surface, you might get a 640x480 "real" surface. Still,
SDL_VideoSurface->h will be set to 420! Thus, the upper 60 pixels in my
example received no mouse down events.
My fix simply disables this clipping when in full screen mode - after
all, all clicks then should be inside the screen surface. Higher SDL
functions ensure that the coordinates then are clipped to 640x420. It
works fine in all my tests here. I don't know if it's the right thing
to do in multi screen scenarios, though.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Mon, 04 Aug 2003 01:00:30 +0000 |
parents | f6ffac90895c |
children | b8d311d90021 |
rev | line source |
---|---|
0 | 1 /* |
2 SDL - Simple DirectMedia Layer | |
297
f6ffac90895c
Updated copyright information for 2002
Sam Lantinga <slouken@libsdl.org>
parents:
252
diff
changeset
|
3 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Sam Lantinga |
0 | 4 |
5 This library is free software; you can redistribute it and/or | |
6 modify it under the terms of the GNU Library General Public | |
7 License as published by the Free Software Foundation; either | |
8 version 2 of the License, or (at your option) any later version. | |
9 | |
10 This library is distributed in the hope that it will be useful, | |
11 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 Library General Public License for more details. | |
14 | |
15 You should have received a copy of the GNU Library General Public | |
16 License along with this library; if not, write to the Free | |
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
18 | |
19 Sam Lantinga | |
252
e8157fcb3114
Updated the source with the correct e-mail address
Sam Lantinga <slouken@libsdl.org>
parents:
0
diff
changeset
|
20 slouken@libsdl.org |
0 | 21 */ |
22 | |
23 #ifdef SAVE_RCSID | |
24 static char rcsid = | |
25 "@(#) $Id$"; | |
26 #endif | |
27 | |
28 #ifndef _SDL_lowvideo_h | |
29 #define _SDL_lowvideo_h | |
30 | |
31 #if TARGET_API_MAC_CARBON | |
32 #include <Carbon.h> | |
33 #else | |
34 #include <Quickdraw.h> | |
35 #include <Palettes.h> | |
36 #include <Menus.h> | |
37 #include <DrawSprocket.h> | |
38 #endif | |
39 | |
40 #ifdef HAVE_OPENGL | |
41 #ifdef MACOSX | |
42 #include <OpenGL/gl.h> /* OpenGL.framework */ | |
43 #include <AGL/agl.h> /* AGL.framework */ | |
44 #else | |
45 #include <GL/gl.h> | |
46 #include <agl.h> | |
47 #endif /* MACOSX */ | |
48 #endif /* HAVE_OPENGL */ | |
49 | |
50 #include "SDL_video.h" | |
51 #include "SDL_sysvideo.h" | |
52 | |
53 /* Hidden "this" pointer for the video functions */ | |
54 #define _THIS SDL_VideoDevice *this | |
55 | |
56 #if !TARGET_API_MAC_CARBON /* not available in OS X (or more accurately, Carbon) */ | |
57 /* Global QuickDraw data */ | |
58 extern QDGlobals *theQD; | |
59 #endif | |
60 | |
61 /* Private display data */ | |
62 struct SDL_PrivateVideoData { | |
63 GDevice **SDL_Display; | |
64 WindowRef SDL_Window; | |
65 SDL_Rect **SDL_modelist; | |
66 CTabHandle SDL_CTab; | |
67 PaletteHandle SDL_CPal; | |
68 | |
69 #if TARGET_API_MAC_CARBON | |
70 /* For entering and leaving fullscreen mode */ | |
71 Ptr fullscreen_ctx; | |
72 #endif | |
73 | |
74 /* The current window document style */ | |
75 int current_style; | |
76 | |
77 /* Information about the last cursor position */ | |
78 Point last_where; | |
79 | |
80 /* Information about the last keys down */ | |
81 EventModifiers last_mods; | |
82 KeyMap last_keys; | |
83 | |
84 /* A handle to the Apple Menu */ | |
85 MenuRef apple_menu; | |
86 | |
87 /* Information used by DrawSprocket driver */ | |
88 struct DSpInfo *dspinfo; | |
89 | |
90 #ifdef HAVE_OPENGL | |
91 AGLContext appleGLContext; | |
92 #endif | |
93 }; | |
94 /* Old variable names */ | |
95 #define SDL_Display (this->hidden->SDL_Display) | |
96 #define SDL_Window (this->hidden->SDL_Window) | |
97 #define SDL_modelist (this->hidden->SDL_modelist) | |
98 #define SDL_CTab (this->hidden->SDL_CTab) | |
99 #define SDL_CPal (this->hidden->SDL_CPal) | |
100 #define fullscreen_ctx (this->hidden->fullscreen_ctx) | |
101 #define current_style (this->hidden->current_style) | |
102 #define last_where (this->hidden->last_where) | |
103 #define last_mods (this->hidden->last_mods) | |
104 #define last_keys (this->hidden->last_keys) | |
105 #define apple_menu (this->hidden->apple_menu) | |
106 #define glContext (this->hidden->appleGLContext) | |
107 | |
108 #endif /* _SDL_lowvideo_h */ |