Mercurial > sdl-ios-xcode
annotate src/video/SDL_sysvideo.h @ 5159:307ccc9c135e
Made it possible to create a texture of any format, even if not supported by the renderer.
This allows me to reduce the set of formats supported by the renderers to the most optimal set, for a nice speed boost.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Thu, 03 Feb 2011 00:19:40 -0800 |
parents | fb424691cfc7 |
children | 2b1989f59674 |
rev | line source |
---|---|
0 | 1 /* |
2 SDL - Simple DirectMedia Layer | |
3697 | 3 Copyright (C) 1997-2010 Sam Lantinga |
0 | 4 |
5 This library is free software; you can redistribute it and/or | |
1312
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
1251
diff
changeset
|
6 modify it under the terms of the GNU Lesser General Public |
0 | 7 License as published by the Free Software Foundation; either |
1312
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
1251
diff
changeset
|
8 version 2.1 of the License, or (at your option) any later version. |
0 | 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 | |
1312
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
1251
diff
changeset
|
13 Lesser General Public License for more details. |
0 | 14 |
1312
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
1251
diff
changeset
|
15 You should have received a copy of the GNU Lesser General Public |
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
1251
diff
changeset
|
16 License along with this library; if not, write to the Free Software |
c9b51268668f
Updated copyright information and removed rcs id lines (problematic in branch merges)
Sam Lantinga <slouken@libsdl.org>
parents:
1251
diff
changeset
|
17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
0 | 18 |
19 Sam Lantinga | |
252
e8157fcb3114
Updated the source with the correct e-mail address
Sam Lantinga <slouken@libsdl.org>
parents:
173
diff
changeset
|
20 slouken@libsdl.org |
0 | 21 */ |
1402
d910939febfa
Use consistent identifiers for the various platforms we support.
Sam Lantinga <slouken@libsdl.org>
parents:
1361
diff
changeset
|
22 #include "SDL_config.h" |
0 | 23 |
24 #ifndef _SDL_sysvideo_h | |
25 #define _SDL_sysvideo_h | |
26 | |
4782
b6930aefd008
Finished X11 shaped-window functionality and removed ellipse+polygon rendering.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
3701
diff
changeset
|
27 #include "SDL_shape.h" |
0 | 28 |
29 /* The SDL video driver */ | |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1737
diff
changeset
|
30 |
4782
b6930aefd008
Finished X11 shaped-window functionality and removed ellipse+polygon rendering.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
3701
diff
changeset
|
31 typedef struct SDL_WindowShaper SDL_WindowShaper; |
b6930aefd008
Finished X11 shaped-window functionality and removed ellipse+polygon rendering.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
3701
diff
changeset
|
32 typedef struct SDL_ShapeDriver SDL_ShapeDriver; |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1737
diff
changeset
|
33 typedef struct SDL_VideoDisplay SDL_VideoDisplay; |
0 | 34 typedef struct SDL_VideoDevice SDL_VideoDevice; |
35 | |
4782
b6930aefd008
Finished X11 shaped-window functionality and removed ellipse+polygon rendering.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
3701
diff
changeset
|
36 /* Define the SDL window-shaper structure */ |
b6930aefd008
Finished X11 shaped-window functionality and removed ellipse+polygon rendering.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
3701
diff
changeset
|
37 struct SDL_WindowShaper |
b6930aefd008
Finished X11 shaped-window functionality and removed ellipse+polygon rendering.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
3701
diff
changeset
|
38 { |
b6930aefd008
Finished X11 shaped-window functionality and removed ellipse+polygon rendering.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
3701
diff
changeset
|
39 /* The window associated with the shaper */ |
b6930aefd008
Finished X11 shaped-window functionality and removed ellipse+polygon rendering.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
3701
diff
changeset
|
40 SDL_Window *window; |
b6930aefd008
Finished X11 shaped-window functionality and removed ellipse+polygon rendering.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
3701
diff
changeset
|
41 |
4851
5624fb0190b5
Changed flags and positioning (for the fake-hiding) as Andreas recommended.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4849
diff
changeset
|
42 /* The user's specified coordinates for the window, for once we give it a shape. */ |
5624fb0190b5
Changed flags and positioning (for the fake-hiding) as Andreas recommended.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4849
diff
changeset
|
43 Uint32 userx,usery; |
4782
b6930aefd008
Finished X11 shaped-window functionality and removed ellipse+polygon rendering.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
3701
diff
changeset
|
44 |
4807
c9eb95f29770
Added color-key mode and redid the code to work with it.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4782
diff
changeset
|
45 /* The parameters for shape calculation. */ |
c9eb95f29770
Added color-key mode and redid the code to work with it.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
4782
diff
changeset
|
46 SDL_WindowShapeMode mode; |
4782
b6930aefd008
Finished X11 shaped-window functionality and removed ellipse+polygon rendering.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
3701
diff
changeset
|
47 |
b6930aefd008
Finished X11 shaped-window functionality and removed ellipse+polygon rendering.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
3701
diff
changeset
|
48 /* Has this window been assigned a shape? */ |
b6930aefd008
Finished X11 shaped-window functionality and removed ellipse+polygon rendering.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
3701
diff
changeset
|
49 SDL_bool hasshape; |
b6930aefd008
Finished X11 shaped-window functionality and removed ellipse+polygon rendering.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
3701
diff
changeset
|
50 |
b6930aefd008
Finished X11 shaped-window functionality and removed ellipse+polygon rendering.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
3701
diff
changeset
|
51 void *driverdata; |
b6930aefd008
Finished X11 shaped-window functionality and removed ellipse+polygon rendering.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
3701
diff
changeset
|
52 }; |
b6930aefd008
Finished X11 shaped-window functionality and removed ellipse+polygon rendering.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
3701
diff
changeset
|
53 |
b6930aefd008
Finished X11 shaped-window functionality and removed ellipse+polygon rendering.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
3701
diff
changeset
|
54 /* Define the SDL shape driver structure */ |
b6930aefd008
Finished X11 shaped-window functionality and removed ellipse+polygon rendering.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
3701
diff
changeset
|
55 struct SDL_ShapeDriver |
b6930aefd008
Finished X11 shaped-window functionality and removed ellipse+polygon rendering.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
3701
diff
changeset
|
56 { |
b6930aefd008
Finished X11 shaped-window functionality and removed ellipse+polygon rendering.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
3701
diff
changeset
|
57 SDL_WindowShaper *(*CreateShaper)(SDL_Window * window); |
4849
0b918c186938
Finally got the Win32 API code for shaping to work! Just need to fix SDL_CalculateShapeTree() now!
egottlieb
parents:
4810
diff
changeset
|
58 int (*SetWindowShape)(SDL_WindowShaper *shaper,SDL_Surface *shape,SDL_WindowShapeMode *shape_mode); |
4782
b6930aefd008
Finished X11 shaped-window functionality and removed ellipse+polygon rendering.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
3701
diff
changeset
|
59 int (*ResizeWindowShape)(SDL_Window *window); |
b6930aefd008
Finished X11 shaped-window functionality and removed ellipse+polygon rendering.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
3701
diff
changeset
|
60 }; |
b6930aefd008
Finished X11 shaped-window functionality and removed ellipse+polygon rendering.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
3701
diff
changeset
|
61 |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1737
diff
changeset
|
62 /* Define the SDL window structure, corresponding to toplevel windows */ |
2753 | 63 struct SDL_Window |
64 { | |
3695
f6a8be3fefa0
Added magic to detect already freed or otherwise invalid windows and textures.
Sam Lantinga <slouken@libsdl.org>
parents:
3685
diff
changeset
|
65 const void *magic; |
2753 | 66 Uint32 id; |
67 char *title; | |
68 int x, y; | |
69 int w, h; | |
70 Uint32 flags; | |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1737
diff
changeset
|
71 |
3685
64ce267332c6
Switched from SDL_WindowID and SDL_TextureID to SDL_Window* and SDL_Texture* for code simplicity and improved performance.
Sam Lantinga <slouken@libsdl.org>
parents:
3678
diff
changeset
|
72 SDL_VideoDisplay *display; |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1737
diff
changeset
|
73 |
3500
4b594623401b
Work in progress on multi-display support:
Sam Lantinga <slouken@libsdl.org>
parents:
3435
diff
changeset
|
74 SDL_DisplayMode fullscreen_mode; |
4782
b6930aefd008
Finished X11 shaped-window functionality and removed ellipse+polygon rendering.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
3701
diff
changeset
|
75 |
b6930aefd008
Finished X11 shaped-window functionality and removed ellipse+polygon rendering.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
3701
diff
changeset
|
76 SDL_WindowShaper *shaper; |
3500
4b594623401b
Work in progress on multi-display support:
Sam Lantinga <slouken@libsdl.org>
parents:
3435
diff
changeset
|
77 |
2753 | 78 void *userdata; |
79 void *driverdata; | |
3685
64ce267332c6
Switched from SDL_WindowID and SDL_TextureID to SDL_Window* and SDL_Texture* for code simplicity and improved performance.
Sam Lantinga <slouken@libsdl.org>
parents:
3678
diff
changeset
|
80 |
64ce267332c6
Switched from SDL_WindowID and SDL_TextureID to SDL_Window* and SDL_Texture* for code simplicity and improved performance.
Sam Lantinga <slouken@libsdl.org>
parents:
3678
diff
changeset
|
81 SDL_Window *prev; |
64ce267332c6
Switched from SDL_WindowID and SDL_TextureID to SDL_Window* and SDL_Texture* for code simplicity and improved performance.
Sam Lantinga <slouken@libsdl.org>
parents:
3678
diff
changeset
|
82 SDL_Window *next; |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1737
diff
changeset
|
83 }; |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1737
diff
changeset
|
84 #define FULLSCREEN_VISIBLE(W) \ |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1737
diff
changeset
|
85 (((W)->flags & SDL_WINDOW_FULLSCREEN) && \ |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1737
diff
changeset
|
86 ((W)->flags & SDL_WINDOW_SHOWN) && \ |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1737
diff
changeset
|
87 !((W)->flags & SDL_WINDOW_MINIMIZED)) |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1737
diff
changeset
|
88 |
2742
b86247d21929
Added retained backing attribute, reference to UIKit renderer
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2735
diff
changeset
|
89 /* |
b86247d21929
Added retained backing attribute, reference to UIKit renderer
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2735
diff
changeset
|
90 * Define the SDL display structure This corresponds to physical monitors |
b86247d21929
Added retained backing attribute, reference to UIKit renderer
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2735
diff
changeset
|
91 * attached to the system. |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1737
diff
changeset
|
92 */ |
2753 | 93 struct SDL_VideoDisplay |
94 { | |
95 int max_display_modes; | |
96 int num_display_modes; | |
97 SDL_DisplayMode *display_modes; | |
98 SDL_DisplayMode desktop_mode; | |
99 SDL_DisplayMode current_mode; | |
3502
98a819296cdc
Whenever a window becomes fullscreen, shown, unminimized, and has input focus it will change the display to the corresponding fullscreen video mode.
Sam Lantinga <slouken@libsdl.org>
parents:
3501
diff
changeset
|
100 SDL_bool updating_fullscreen; |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1737
diff
changeset
|
101 |
2753 | 102 Uint16 *gamma; |
103 Uint16 *saved_gamma; /* (just offset into gamma) */ | |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1737
diff
changeset
|
104 |
2753 | 105 SDL_Window *windows; |
3517
e7eec78e4b92
Fixed mouse events for fullscreen windows on Mac OS X
Sam Lantinga <slouken@libsdl.org>
parents:
3511
diff
changeset
|
106 SDL_Window *fullscreen_window; |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1737
diff
changeset
|
107 |
2753 | 108 SDL_VideoDevice *device; |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1737
diff
changeset
|
109 |
2753 | 110 void *driverdata; |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1737
diff
changeset
|
111 }; |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1737
diff
changeset
|
112 |
0 | 113 /* Define the SDL video driver structure */ |
114 #define _THIS SDL_VideoDevice *_this | |
115 | |
2753 | 116 struct SDL_VideoDevice |
117 { | |
118 /* * * */ | |
119 /* The name of this video driver */ | |
120 const char *name; | |
0 | 121 |
2753 | 122 /* * * */ |
123 /* Initialization/Query functions */ | |
0 | 124 |
2753 | 125 /* |
126 * Initialize the native video subsystem, filling in the list of | |
127 * displays for this driver, returning 0 or -1 if there's an error. | |
128 */ | |
129 int (*VideoInit) (_THIS); | |
0 | 130 |
2753 | 131 /* |
132 * Reverse the effects VideoInit() -- called if VideoInit() fails or | |
133 * if the application is shutting down the video subsystem. | |
134 */ | |
135 void (*VideoQuit) (_THIS); | |
1913
83420da906a5
Implemented Windows OpenGL support
Sam Lantinga <slouken@libsdl.org>
parents:
1912
diff
changeset
|
136 |
2753 | 137 /* * * */ |
138 /* | |
139 * Display functions | |
140 */ | |
0 | 141 |
2753 | 142 /* |
3528
59ff7a2beb57
Added an API function to query geometry of multiple monitors:
Sam Lantinga <slouken@libsdl.org>
parents:
3517
diff
changeset
|
143 * Get the bounds of a display |
59ff7a2beb57
Added an API function to query geometry of multiple monitors:
Sam Lantinga <slouken@libsdl.org>
parents:
3517
diff
changeset
|
144 */ |
59ff7a2beb57
Added an API function to query geometry of multiple monitors:
Sam Lantinga <slouken@libsdl.org>
parents:
3517
diff
changeset
|
145 int (*GetDisplayBounds) (_THIS, SDL_VideoDisplay * display, SDL_Rect * rect); |
59ff7a2beb57
Added an API function to query geometry of multiple monitors:
Sam Lantinga <slouken@libsdl.org>
parents:
3517
diff
changeset
|
146 |
59ff7a2beb57
Added an API function to query geometry of multiple monitors:
Sam Lantinga <slouken@libsdl.org>
parents:
3517
diff
changeset
|
147 /* |
2753 | 148 * Get a list of the available display modes. e.g. |
149 * SDL_AddDisplayMode(_this->current_display, mode) | |
150 */ | |
3500
4b594623401b
Work in progress on multi-display support:
Sam Lantinga <slouken@libsdl.org>
parents:
3435
diff
changeset
|
151 void (*GetDisplayModes) (_THIS, SDL_VideoDisplay * display); |
0 | 152 |
2753 | 153 /* |
154 * Setting the display mode is independent of creating windows, so | |
155 * when the display mode is changed, all existing windows should have | |
156 * their data updated accordingly, including the display surfaces | |
157 * associated with them. | |
158 */ | |
3500
4b594623401b
Work in progress on multi-display support:
Sam Lantinga <slouken@libsdl.org>
parents:
3435
diff
changeset
|
159 int (*SetDisplayMode) (_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode); |
0 | 160 |
2753 | 161 /* Set the gamma ramp */ |
3500
4b594623401b
Work in progress on multi-display support:
Sam Lantinga <slouken@libsdl.org>
parents:
3435
diff
changeset
|
162 int (*SetDisplayGammaRamp) (_THIS, SDL_VideoDisplay * display, Uint16 * ramp); |
2742
b86247d21929
Added retained backing attribute, reference to UIKit renderer
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2735
diff
changeset
|
163 |
2753 | 164 /* Get the gamma ramp */ |
3500
4b594623401b
Work in progress on multi-display support:
Sam Lantinga <slouken@libsdl.org>
parents:
3435
diff
changeset
|
165 int (*GetDisplayGammaRamp) (_THIS, SDL_VideoDisplay * display, Uint16 * ramp); |
0 | 166 |
2753 | 167 /* * * */ |
168 /* | |
169 * Window functions | |
170 */ | |
171 int (*CreateWindow) (_THIS, SDL_Window * window); | |
172 int (*CreateWindowFrom) (_THIS, SDL_Window * window, const void *data); | |
173 void (*SetWindowTitle) (_THIS, SDL_Window * window); | |
2967
e4a469d6ddab
Implemented SDL_SetWindowIcon(), with translucent icon support under X11.
Sam Lantinga <slouken@libsdl.org>
parents:
2901
diff
changeset
|
174 void (*SetWindowIcon) (_THIS, SDL_Window * window, SDL_Surface * icon); |
2753 | 175 void (*SetWindowPosition) (_THIS, SDL_Window * window); |
176 void (*SetWindowSize) (_THIS, SDL_Window * window); | |
177 void (*ShowWindow) (_THIS, SDL_Window * window); | |
178 void (*HideWindow) (_THIS, SDL_Window * window); | |
179 void (*RaiseWindow) (_THIS, SDL_Window * window); | |
180 void (*MaximizeWindow) (_THIS, SDL_Window * window); | |
181 void (*MinimizeWindow) (_THIS, SDL_Window * window); | |
182 void (*RestoreWindow) (_THIS, SDL_Window * window); | |
183 void (*SetWindowGrab) (_THIS, SDL_Window * window); | |
184 void (*DestroyWindow) (_THIS, SDL_Window * window); | |
4782
b6930aefd008
Finished X11 shaped-window functionality and removed ellipse+polygon rendering.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
3701
diff
changeset
|
185 |
b6930aefd008
Finished X11 shaped-window functionality and removed ellipse+polygon rendering.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
3701
diff
changeset
|
186 /* * * */ |
b6930aefd008
Finished X11 shaped-window functionality and removed ellipse+polygon rendering.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
3701
diff
changeset
|
187 /* |
b6930aefd008
Finished X11 shaped-window functionality and removed ellipse+polygon rendering.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
3701
diff
changeset
|
188 * Shaped-window functions |
b6930aefd008
Finished X11 shaped-window functionality and removed ellipse+polygon rendering.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
3701
diff
changeset
|
189 */ |
b6930aefd008
Finished X11 shaped-window functionality and removed ellipse+polygon rendering.
Eli Gottlieb <eligottlieb@gmail.com>
parents:
3701
diff
changeset
|
190 SDL_ShapeDriver shape_driver; |
0 | 191 |
2753 | 192 /* Get some platform dependent window information */ |
193 SDL_bool(*GetWindowWMInfo) (_THIS, SDL_Window * window, | |
194 struct SDL_SysWMinfo * info); | |
0 | 195 |
2753 | 196 /* * * */ |
197 /* | |
198 * OpenGL support | |
199 */ | |
200 int (*GL_LoadLibrary) (_THIS, const char *path); | |
201 void *(*GL_GetProcAddress) (_THIS, const char *proc); | |
3057
089a77aebb7d
Added test program for SDL_CreateWindowFrom()
Sam Lantinga <slouken@libsdl.org>
parents:
3025
diff
changeset
|
202 void (*GL_UnloadLibrary) (_THIS); |
2753 | 203 SDL_GLContext(*GL_CreateContext) (_THIS, SDL_Window * window); |
204 int (*GL_MakeCurrent) (_THIS, SDL_Window * window, SDL_GLContext context); | |
205 int (*GL_SetSwapInterval) (_THIS, int interval); | |
206 int (*GL_GetSwapInterval) (_THIS); | |
207 void (*GL_SwapWindow) (_THIS, SDL_Window * window); | |
208 void (*GL_DeleteContext) (_THIS, SDL_GLContext context); | |
0 | 209 |
2753 | 210 /* * * */ |
211 /* | |
212 * Event manager functions | |
213 */ | |
214 void (*PumpEvents) (_THIS); | |
0 | 215 |
3025
54fac87e1f34
Added an API to enable/disable the screen saver.
Sam Lantinga <slouken@libsdl.org>
parents:
2967
diff
changeset
|
216 /* Suspend the screensaver */ |
54fac87e1f34
Added an API to enable/disable the screen saver.
Sam Lantinga <slouken@libsdl.org>
parents:
2967
diff
changeset
|
217 void (*SuspendScreenSaver) (_THIS); |
54fac87e1f34
Added an API to enable/disable the screen saver.
Sam Lantinga <slouken@libsdl.org>
parents:
2967
diff
changeset
|
218 |
3280
00cace2d9080
Merged a cleaned up version of Jiang's code changes from Google Summer of Code 2009
Sam Lantinga <slouken@libsdl.org>
parents:
3276
diff
changeset
|
219 /* Text input */ |
00cace2d9080
Merged a cleaned up version of Jiang's code changes from Google Summer of Code 2009
Sam Lantinga <slouken@libsdl.org>
parents:
3276
diff
changeset
|
220 void (*StartTextInput) (_THIS); |
00cace2d9080
Merged a cleaned up version of Jiang's code changes from Google Summer of Code 2009
Sam Lantinga <slouken@libsdl.org>
parents:
3276
diff
changeset
|
221 void (*StopTextInput) (_THIS); |
00cace2d9080
Merged a cleaned up version of Jiang's code changes from Google Summer of Code 2009
Sam Lantinga <slouken@libsdl.org>
parents:
3276
diff
changeset
|
222 void (*SetTextInputRect) (_THIS, SDL_Rect *rect); |
00cace2d9080
Merged a cleaned up version of Jiang's code changes from Google Summer of Code 2009
Sam Lantinga <slouken@libsdl.org>
parents:
3276
diff
changeset
|
223 |
4495
dbbfdb9ea716
Simplified clipboard API for sanity's sake.
Sam Lantinga <slouken@libsdl.org>
parents:
4472
diff
changeset
|
224 /* Clipboard */ |
dbbfdb9ea716
Simplified clipboard API for sanity's sake.
Sam Lantinga <slouken@libsdl.org>
parents:
4472
diff
changeset
|
225 int (*SetClipboardText) (_THIS, const char *text); |
dbbfdb9ea716
Simplified clipboard API for sanity's sake.
Sam Lantinga <slouken@libsdl.org>
parents:
4472
diff
changeset
|
226 char * (*GetClipboardText) (_THIS); |
dbbfdb9ea716
Simplified clipboard API for sanity's sake.
Sam Lantinga <slouken@libsdl.org>
parents:
4472
diff
changeset
|
227 SDL_bool (*HasClipboardText) (_THIS); |
dbbfdb9ea716
Simplified clipboard API for sanity's sake.
Sam Lantinga <slouken@libsdl.org>
parents:
4472
diff
changeset
|
228 |
2753 | 229 /* * * */ |
230 /* Data common to all drivers */ | |
3025
54fac87e1f34
Added an API to enable/disable the screen saver.
Sam Lantinga <slouken@libsdl.org>
parents:
2967
diff
changeset
|
231 SDL_bool suspend_screensaver; |
2753 | 232 int num_displays; |
233 SDL_VideoDisplay *displays; | |
234 int current_display; | |
3695
f6a8be3fefa0
Added magic to detect already freed or otherwise invalid windows and textures.
Sam Lantinga <slouken@libsdl.org>
parents:
3685
diff
changeset
|
235 Uint8 window_magic; |
2753 | 236 Uint32 next_object_id; |
4495
dbbfdb9ea716
Simplified clipboard API for sanity's sake.
Sam Lantinga <slouken@libsdl.org>
parents:
4472
diff
changeset
|
237 char * clipboard_text; |
0 | 238 |
2753 | 239 /* * * */ |
240 /* Data used by the GL drivers */ | |
241 struct | |
242 { | |
243 int red_size; | |
244 int green_size; | |
245 int blue_size; | |
246 int alpha_size; | |
247 int depth_size; | |
248 int buffer_size; | |
249 int stencil_size; | |
250 int double_buffer; | |
251 int accum_red_size; | |
252 int accum_green_size; | |
253 int accum_blue_size; | |
254 int accum_alpha_size; | |
255 int stereo; | |
256 int multisamplebuffers; | |
257 int multisamplesamples; | |
258 int accelerated; | |
3100
7dc982143c06
Date: Sun, 22 Mar 2009 12:52:29 +0000
Sam Lantinga <slouken@libsdl.org>
parents:
3083
diff
changeset
|
259 int major_version; |
7dc982143c06
Date: Sun, 22 Mar 2009 12:52:29 +0000
Sam Lantinga <slouken@libsdl.org>
parents:
3083
diff
changeset
|
260 int minor_version; |
2753 | 261 int retained_backing; |
262 int driver_loaded; | |
263 char driver_path[256]; | |
264 void *dll_handle; | |
265 } gl_config; | |
0 | 266 |
2753 | 267 /* * * */ |
268 /* Data private to this driver */ | |
269 void *driverdata; | |
270 struct SDL_GLDriverData *gl_data; | |
0 | 271 |
3161
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
3100
diff
changeset
|
272 #if SDL_VIDEO_DRIVER_PANDORA |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
3100
diff
changeset
|
273 struct SDL_PrivateGLESData *gles_data; |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
3100
diff
changeset
|
274 #endif |
494559cc723b
OpenPandora support added by David Carré
Sam Lantinga <slouken@libsdl.org>
parents:
3100
diff
changeset
|
275 |
2753 | 276 /* * * */ |
277 /* The function used to dispose of this structure */ | |
278 void (*free) (_THIS); | |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1737
diff
changeset
|
279 }; |
0 | 280 |
2753 | 281 typedef struct VideoBootStrap |
282 { | |
283 const char *name; | |
284 const char *desc; | |
285 int (*available) (void); | |
286 SDL_VideoDevice *(*create) (int devindex); | |
287 } VideoBootStrap; | |
0 | 288 |
1931
103c6fec2a60
The Mac OS X Cocoa video driver is under construction...
Sam Lantinga <slouken@libsdl.org>
parents:
1928
diff
changeset
|
289 #if SDL_VIDEO_DRIVER_COCOA |
103c6fec2a60
The Mac OS X Cocoa video driver is under construction...
Sam Lantinga <slouken@libsdl.org>
parents:
1928
diff
changeset
|
290 extern VideoBootStrap COCOA_bootstrap; |
1361
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1330
diff
changeset
|
291 #endif |
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1330
diff
changeset
|
292 #if SDL_VIDEO_DRIVER_X11 |
0 | 293 extern VideoBootStrap X11_bootstrap; |
294 #endif | |
1361
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1330
diff
changeset
|
295 #if SDL_VIDEO_DRIVER_DIRECTFB |
167
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
75
diff
changeset
|
296 extern VideoBootStrap DirectFB_bootstrap; |
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
75
diff
changeset
|
297 #endif |
5062 | 298 #if SDL_VIDEO_DRIVER_WINDOWS |
299 extern VideoBootStrap WINDOWS_bootstrap; | |
0 | 300 #endif |
1361
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1330
diff
changeset
|
301 #if SDL_VIDEO_DRIVER_BWINDOW |
0 | 302 extern VideoBootStrap BWINDOW_bootstrap; |
303 #endif | |
5153
1435f8a6425c
Nobody is currently maintaining the QNX code, so removing it for now.
Sam Lantinga <slouken@libsdl.org>
parents:
5152
diff
changeset
|
304 #if SDL_VIDEO_DRIVER_PANDORA |
1435f8a6425c
Nobody is currently maintaining the QNX code, so removing it for now.
Sam Lantinga <slouken@libsdl.org>
parents:
5152
diff
changeset
|
305 extern VideoBootStrap PND_bootstrap; |
3083
0bc41e0361d3
Date: Mon, 2 Mar 2009 16:27:42 +0200
Sam Lantinga <slouken@libsdl.org>
parents:
3057
diff
changeset
|
306 #endif |
5153
1435f8a6425c
Nobody is currently maintaining the QNX code, so removing it for now.
Sam Lantinga <slouken@libsdl.org>
parents:
5152
diff
changeset
|
307 #if SDL_VIDEO_DRIVER_NDS |
1435f8a6425c
Nobody is currently maintaining the QNX code, so removing it for now.
Sam Lantinga <slouken@libsdl.org>
parents:
5152
diff
changeset
|
308 extern VideoBootStrap NDS_bootstrap; |
173
83018110dce8
Added initial support for EPOC/Symbian OS (thanks Hannu!)
Sam Lantinga <slouken@libsdl.org>
parents:
167
diff
changeset
|
309 #endif |
2742
b86247d21929
Added retained backing attribute, reference to UIKit renderer
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2735
diff
changeset
|
310 #if SDL_VIDEO_DRIVER_UIKIT |
b86247d21929
Added retained backing attribute, reference to UIKit renderer
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2735
diff
changeset
|
311 extern VideoBootStrap UIKIT_bootstrap; |
b86247d21929
Added retained backing attribute, reference to UIKit renderer
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2735
diff
changeset
|
312 #endif |
5153
1435f8a6425c
Nobody is currently maintaining the QNX code, so removing it for now.
Sam Lantinga <slouken@libsdl.org>
parents:
5152
diff
changeset
|
313 #if SDL_VIDEO_DRIVER_ANDROID |
1435f8a6425c
Nobody is currently maintaining the QNX code, so removing it for now.
Sam Lantinga <slouken@libsdl.org>
parents:
5152
diff
changeset
|
314 extern VideoBootStrap Android_bootstrap; |
1435f8a6425c
Nobody is currently maintaining the QNX code, so removing it for now.
Sam Lantinga <slouken@libsdl.org>
parents:
5152
diff
changeset
|
315 #endif |
1361
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1330
diff
changeset
|
316 #if SDL_VIDEO_DRIVER_DUMMY |
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1330
diff
changeset
|
317 extern VideoBootStrap DUMMY_bootstrap; |
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1330
diff
changeset
|
318 #endif |
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1330
diff
changeset
|
319 |
3685
64ce267332c6
Switched from SDL_WindowID and SDL_TextureID to SDL_Window* and SDL_Texture* for code simplicity and improved performance.
Sam Lantinga <slouken@libsdl.org>
parents:
3678
diff
changeset
|
320 #define SDL_CurrentDisplay (&_this->displays[_this->current_display]) |
0 | 321 |
4472
791b3256fb22
Mostly cleaned up warnings with -Wmissing-prototypes
Sam Lantinga <slouken@libsdl.org>
parents:
3701
diff
changeset
|
322 extern SDL_VideoDevice *SDL_GetVideoDevice(void); |
2753 | 323 extern int SDL_AddBasicVideoDisplay(const SDL_DisplayMode * desktop_mode); |
324 extern int SDL_AddVideoDisplay(const SDL_VideoDisplay * display); | |
3500
4b594623401b
Work in progress on multi-display support:
Sam Lantinga <slouken@libsdl.org>
parents:
3435
diff
changeset
|
325 extern SDL_bool SDL_AddDisplayMode(SDL_VideoDisplay *display, const SDL_DisplayMode * mode); |
4b594623401b
Work in progress on multi-display support:
Sam Lantinga <slouken@libsdl.org>
parents:
3435
diff
changeset
|
326 extern int SDL_GetNumDisplayModesForDisplay(SDL_VideoDisplay * display); |
4b594623401b
Work in progress on multi-display support:
Sam Lantinga <slouken@libsdl.org>
parents:
3435
diff
changeset
|
327 extern int SDL_GetDisplayModeForDisplay(SDL_VideoDisplay * display, int index, SDL_DisplayMode * mode); |
4b594623401b
Work in progress on multi-display support:
Sam Lantinga <slouken@libsdl.org>
parents:
3435
diff
changeset
|
328 extern int SDL_GetDesktopDisplayModeForDisplay(SDL_VideoDisplay * display, SDL_DisplayMode * mode); |
4b594623401b
Work in progress on multi-display support:
Sam Lantinga <slouken@libsdl.org>
parents:
3435
diff
changeset
|
329 extern int SDL_GetCurrentDisplayModeForDisplay(SDL_VideoDisplay * display, SDL_DisplayMode * mode); |
4b594623401b
Work in progress on multi-display support:
Sam Lantinga <slouken@libsdl.org>
parents:
3435
diff
changeset
|
330 extern SDL_DisplayMode * SDL_GetClosestDisplayModeForDisplay(SDL_VideoDisplay * display, const SDL_DisplayMode * mode, SDL_DisplayMode * closest); |
4b594623401b
Work in progress on multi-display support:
Sam Lantinga <slouken@libsdl.org>
parents:
3435
diff
changeset
|
331 extern int SDL_SetDisplayModeForDisplay(SDL_VideoDisplay * display, const SDL_DisplayMode * mode); |
4b594623401b
Work in progress on multi-display support:
Sam Lantinga <slouken@libsdl.org>
parents:
3435
diff
changeset
|
332 extern int SDL_SetGammaRampForDisplay(SDL_VideoDisplay * display, const Uint16 * red, const Uint16 * green, const Uint16 * blue); |
4b594623401b
Work in progress on multi-display support:
Sam Lantinga <slouken@libsdl.org>
parents:
3435
diff
changeset
|
333 extern int SDL_GetGammaRampForDisplay(SDL_VideoDisplay * display, Uint16 * red, Uint16 * green, Uint16 * blue); |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1737
diff
changeset
|
334 |
2753 | 335 extern int SDL_RecreateWindow(SDL_Window * window, Uint32 flags); |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1737
diff
changeset
|
336 |
2753 | 337 extern void SDL_OnWindowShown(SDL_Window * window); |
338 extern void SDL_OnWindowHidden(SDL_Window * window); | |
3502
98a819296cdc
Whenever a window becomes fullscreen, shown, unminimized, and has input focus it will change the display to the corresponding fullscreen video mode.
Sam Lantinga <slouken@libsdl.org>
parents:
3501
diff
changeset
|
339 extern void SDL_OnWindowMinimized(SDL_Window * window); |
98a819296cdc
Whenever a window becomes fullscreen, shown, unminimized, and has input focus it will change the display to the corresponding fullscreen video mode.
Sam Lantinga <slouken@libsdl.org>
parents:
3501
diff
changeset
|
340 extern void SDL_OnWindowRestored(SDL_Window * window); |
2753 | 341 extern void SDL_OnWindowFocusGained(SDL_Window * window); |
342 extern void SDL_OnWindowFocusLost(SDL_Window * window); | |
3685
64ce267332c6
Switched from SDL_WindowID and SDL_TextureID to SDL_Window* and SDL_Texture* for code simplicity and improved performance.
Sam Lantinga <slouken@libsdl.org>
parents:
3678
diff
changeset
|
343 extern SDL_Window * SDL_GetFocusWindow(void); |
0 | 344 |
2753 | 345 #endif /* _SDL_sysvideo_h */ |
1895
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1737
diff
changeset
|
346 |
c121d94672cb
SDL 1.2 is moving to a branch, and SDL 1.3 is becoming the head.
Sam Lantinga <slouken@libsdl.org>
parents:
1737
diff
changeset
|
347 /* vi: set ts=4 sw=4 expandtab: */ |