Mercurial > sdl-ios-xcode
annotate src/video/SDL_sysvideo.h @ 3025:54fac87e1f34
Added an API to enable/disable the screen saver.
The screensaver is disabled by default when using SDL 1.2 compatibility.
Use the new XScreenSaver extension, removed unused DPMS extension.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Mon, 12 Jan 2009 06:19:05 +0000 |
parents | e4a469d6ddab |
children | 089a77aebb7d |
rev | line source |
---|---|
0 | 1 /* |
2 SDL - Simple DirectMedia Layer | |
2859 | 3 Copyright (C) 1997-2009 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 | |
27 #include "SDL_mouse.h" | |
2268
4baee598306d
Date: Thu, 05 Jul 2007 14:02:33 -0700
Sam Lantinga <slouken@libsdl.org>
parents:
2245
diff
changeset
|
28 #include "SDL_keysym.h" |
0 | 29 |
30 /* 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
|
31 |
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
|
32 typedef struct SDL_Window SDL_Window; |
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_Texture SDL_Texture; |
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
|
34 typedef struct SDL_Renderer SDL_Renderer; |
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
|
35 typedef struct SDL_RenderDriver SDL_RenderDriver; |
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
|
36 typedef struct SDL_VideoDisplay SDL_VideoDisplay; |
0 | 37 typedef struct SDL_VideoDevice SDL_VideoDevice; |
38 | |
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
|
39 /* Define the SDL texture structure */ |
2753 | 40 struct SDL_Texture |
41 { | |
42 Uint32 id; | |
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
|
43 |
2753 | 44 Uint32 format; /**< The pixel format of the texture */ |
45 int access; /**< SDL_TextureAccess */ | |
46 int w; /**< The width of the texture */ | |
47 int h; /**< The height of the texture */ | |
48 int modMode; /**< The texture modulation mode */ | |
49 int blendMode; /**< The texture blend mode */ | |
50 int scaleMode; /**< The texture scale mode */ | |
51 Uint8 r, g, b, a; /**< Texture modulation values */ | |
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
|
52 |
2753 | 53 SDL_Renderer *renderer; |
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
|
54 |
2753 | 55 void *driverdata; /**< Driver specific texture representation */ |
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
|
56 |
2753 | 57 SDL_Texture *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
|
58 }; |
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
|
59 |
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
|
60 /* Define the SDL renderer structure */ |
2753 | 61 struct SDL_Renderer |
62 { | |
63 int (*ActivateRenderer) (SDL_Renderer * renderer); | |
64 int (*DisplayModeChanged) (SDL_Renderer * renderer); | |
65 int (*CreateTexture) (SDL_Renderer * renderer, SDL_Texture * texture); | |
66 int (*QueryTexturePixels) (SDL_Renderer * renderer, SDL_Texture * texture, | |
67 void **pixels, int *pitch); | |
68 int (*SetTexturePalette) (SDL_Renderer * renderer, SDL_Texture * texture, | |
69 const SDL_Color * colors, int firstcolor, | |
70 int ncolors); | |
71 int (*GetTexturePalette) (SDL_Renderer * renderer, SDL_Texture * texture, | |
72 SDL_Color * colors, int firstcolor, | |
73 int ncolors); | |
74 int (*SetTextureColorMod) (SDL_Renderer * renderer, | |
75 SDL_Texture * texture); | |
76 int (*SetTextureAlphaMod) (SDL_Renderer * renderer, | |
77 SDL_Texture * texture); | |
78 int (*SetTextureBlendMode) (SDL_Renderer * renderer, | |
79 SDL_Texture * texture); | |
80 int (*SetTextureScaleMode) (SDL_Renderer * renderer, | |
81 SDL_Texture * texture); | |
82 int (*UpdateTexture) (SDL_Renderer * renderer, SDL_Texture * texture, | |
83 const SDL_Rect * rect, const void *pixels, | |
84 int pitch); | |
85 int (*LockTexture) (SDL_Renderer * renderer, SDL_Texture * texture, | |
86 const SDL_Rect * rect, int markDirty, void **pixels, | |
87 int *pitch); | |
88 void (*UnlockTexture) (SDL_Renderer * renderer, SDL_Texture * texture); | |
89 void (*DirtyTexture) (SDL_Renderer * renderer, SDL_Texture * texture, | |
90 int numrects, const SDL_Rect * rects); | |
2884
9dde605c7540
Date: Fri, 19 Dec 2008 20:17:35 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
91 int (*SetDrawColor) (SDL_Renderer * renderer); |
9dde605c7540
Date: Fri, 19 Dec 2008 20:17:35 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
92 int (*SetDrawBlendMode) (SDL_Renderer * renderer); |
2901 | 93 int (*RenderPoint) (SDL_Renderer * renderer, int x, int y); |
2884
9dde605c7540
Date: Fri, 19 Dec 2008 20:17:35 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
94 int (*RenderLine) (SDL_Renderer * renderer, int x1, int y1, int x2, |
9dde605c7540
Date: Fri, 19 Dec 2008 20:17:35 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
95 int y2); |
9dde605c7540
Date: Fri, 19 Dec 2008 20:17:35 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
96 int (*RenderFill) (SDL_Renderer * renderer, const SDL_Rect * rect); |
2753 | 97 int (*RenderCopy) (SDL_Renderer * renderer, SDL_Texture * texture, |
98 const SDL_Rect * srcrect, const SDL_Rect * dstrect); | |
99 void (*RenderPresent) (SDL_Renderer * renderer); | |
100 void (*DestroyTexture) (SDL_Renderer * renderer, SDL_Texture * texture); | |
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 void (*DestroyRenderer) (SDL_Renderer * renderer); |
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
|
103 |
2753 | 104 /* The current renderer info */ |
105 SDL_RendererInfo info; | |
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
|
106 |
2753 | 107 /* The window associated with the renderer */ |
108 SDL_WindowID 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
|
109 |
2884
9dde605c7540
Date: Fri, 19 Dec 2008 20:17:35 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
110 Uint8 r, g, b, a; /**< Color for drawing operations values */ |
9dde605c7540
Date: Fri, 19 Dec 2008 20:17:35 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
111 int blendMode; /**< The drawing blend mode */ |
9dde605c7540
Date: Fri, 19 Dec 2008 20:17:35 +0100
Sam Lantinga <slouken@libsdl.org>
parents:
2859
diff
changeset
|
112 |
2753 | 113 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
|
114 }; |
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
|
115 |
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
|
116 /* Define the SDL render driver structure */ |
2753 | 117 struct SDL_RenderDriver |
118 { | |
119 SDL_Renderer *(*CreateRenderer) (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
|
120 |
2753 | 121 /* Info about the renderer capabilities */ |
122 SDL_RendererInfo info; | |
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
|
123 }; |
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
|
124 |
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
|
125 /* Define the SDL window structure, corresponding to toplevel windows */ |
2753 | 126 struct SDL_Window |
127 { | |
128 Uint32 id; | |
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
|
129 |
2753 | 130 char *title; |
131 int x, y; | |
132 int w, h; | |
133 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
|
134 |
2753 | 135 int display; |
136 SDL_Renderer *renderer; | |
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
|
137 |
2753 | 138 void *userdata; |
139 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
|
140 }; |
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
|
141 #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
|
142 (((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
|
143 ((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
|
144 !((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
|
145 |
2742
b86247d21929
Added retained backing attribute, reference to UIKit renderer
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2735
diff
changeset
|
146 /* |
b86247d21929
Added retained backing attribute, reference to UIKit renderer
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2735
diff
changeset
|
147 * 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
|
148 * 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
|
149 */ |
2753 | 150 struct SDL_VideoDisplay |
151 { | |
152 int max_display_modes; | |
153 int num_display_modes; | |
154 SDL_DisplayMode *display_modes; | |
155 SDL_DisplayMode desktop_mode; | |
156 SDL_DisplayMode current_mode; | |
157 SDL_DisplayMode fullscreen_mode; | |
158 SDL_Palette *palette; | |
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
|
159 |
2753 | 160 Uint16 *gamma; |
161 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
|
162 |
2753 | 163 int num_render_drivers; |
164 SDL_RenderDriver *render_drivers; | |
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
|
165 |
2753 | 166 int num_windows; |
167 SDL_Window *windows; | |
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
|
168 |
2753 | 169 SDL_Renderer *current_renderer; |
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
|
170 |
2753 | 171 /* The hash list of textures */ |
172 SDL_Texture *textures[64]; | |
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
|
173 |
2753 | 174 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
|
175 |
2753 | 176 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
|
177 }; |
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
|
178 |
0 | 179 /* Define the SDL video driver structure */ |
180 #define _THIS SDL_VideoDevice *_this | |
181 | |
2753 | 182 struct SDL_VideoDevice |
183 { | |
184 /* * * */ | |
185 /* The name of this video driver */ | |
186 const char *name; | |
0 | 187 |
2753 | 188 /* * * */ |
189 /* Initialization/Query functions */ | |
0 | 190 |
2753 | 191 /* |
192 * Initialize the native video subsystem, filling in the list of | |
193 * displays for this driver, returning 0 or -1 if there's an error. | |
194 */ | |
195 int (*VideoInit) (_THIS); | |
0 | 196 |
2753 | 197 /* |
198 * Reverse the effects VideoInit() -- called if VideoInit() fails or | |
199 * if the application is shutting down the video subsystem. | |
200 */ | |
201 void (*VideoQuit) (_THIS); | |
1913
83420da906a5
Implemented Windows OpenGL support
Sam Lantinga <slouken@libsdl.org>
parents:
1912
diff
changeset
|
202 |
2753 | 203 /* * * */ |
204 /* | |
205 * Display functions | |
206 */ | |
0 | 207 |
2753 | 208 /* |
209 * Get a list of the available display modes. e.g. | |
210 * SDL_AddDisplayMode(_this->current_display, mode) | |
211 */ | |
212 void (*GetDisplayModes) (_THIS); | |
0 | 213 |
2753 | 214 /* |
215 * Setting the display mode is independent of creating windows, so | |
216 * when the display mode is changed, all existing windows should have | |
217 * their data updated accordingly, including the display surfaces | |
218 * associated with them. | |
219 */ | |
220 int (*SetDisplayMode) (_THIS, SDL_DisplayMode * mode); | |
0 | 221 |
2753 | 222 /* Set the color entries of the display palette */ |
223 int (*SetDisplayPalette) (_THIS, SDL_Palette * palette); | |
2742
b86247d21929
Added retained backing attribute, reference to UIKit renderer
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2735
diff
changeset
|
224 |
2753 | 225 /* Get the color entries of the display palette */ |
226 int (*GetDisplayPalette) (_THIS, SDL_Palette * palette); | |
0 | 227 |
2753 | 228 /* Set the gamma ramp */ |
229 int (*SetDisplayGammaRamp) (_THIS, Uint16 * ramp); | |
2742
b86247d21929
Added retained backing attribute, reference to UIKit renderer
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2735
diff
changeset
|
230 |
2753 | 231 /* Get the gamma ramp */ |
232 int (*GetDisplayGammaRamp) (_THIS, Uint16 * ramp); | |
0 | 233 |
2753 | 234 /* * * */ |
235 /* | |
236 * Window functions | |
237 */ | |
238 int (*CreateWindow) (_THIS, SDL_Window * window); | |
239 int (*CreateWindowFrom) (_THIS, SDL_Window * window, const void *data); | |
240 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
|
241 void (*SetWindowIcon) (_THIS, SDL_Window * window, SDL_Surface * icon); |
2753 | 242 void (*SetWindowPosition) (_THIS, SDL_Window * window); |
243 void (*SetWindowSize) (_THIS, SDL_Window * window); | |
244 void (*ShowWindow) (_THIS, SDL_Window * window); | |
245 void (*HideWindow) (_THIS, SDL_Window * window); | |
246 void (*RaiseWindow) (_THIS, SDL_Window * window); | |
247 void (*MaximizeWindow) (_THIS, SDL_Window * window); | |
248 void (*MinimizeWindow) (_THIS, SDL_Window * window); | |
249 void (*RestoreWindow) (_THIS, SDL_Window * window); | |
250 void (*SetWindowGrab) (_THIS, SDL_Window * window); | |
251 void (*DestroyWindow) (_THIS, SDL_Window * window); | |
0 | 252 |
2753 | 253 /* Get some platform dependent window information */ |
254 SDL_bool(*GetWindowWMInfo) (_THIS, SDL_Window * window, | |
255 struct SDL_SysWMinfo * info); | |
0 | 256 |
2753 | 257 /* * * */ |
258 /* | |
259 * OpenGL support | |
260 */ | |
261 int (*GL_LoadLibrary) (_THIS, const char *path); | |
262 void *(*GL_GetProcAddress) (_THIS, const char *proc); | |
263 SDL_GLContext(*GL_CreateContext) (_THIS, SDL_Window * window); | |
264 int (*GL_MakeCurrent) (_THIS, SDL_Window * window, SDL_GLContext context); | |
265 int (*GL_SetSwapInterval) (_THIS, int interval); | |
266 int (*GL_GetSwapInterval) (_THIS); | |
267 void (*GL_SwapWindow) (_THIS, SDL_Window * window); | |
268 void (*GL_DeleteContext) (_THIS, SDL_GLContext context); | |
0 | 269 |
2753 | 270 /* * * */ |
271 /* | |
272 * Event manager functions | |
273 */ | |
274 void (*PumpEvents) (_THIS); | |
0 | 275 |
3025
54fac87e1f34
Added an API to enable/disable the screen saver.
Sam Lantinga <slouken@libsdl.org>
parents:
2967
diff
changeset
|
276 /* Suspend the screensaver */ |
54fac87e1f34
Added an API to enable/disable the screen saver.
Sam Lantinga <slouken@libsdl.org>
parents:
2967
diff
changeset
|
277 void (*SuspendScreenSaver) (_THIS); |
54fac87e1f34
Added an API to enable/disable the screen saver.
Sam Lantinga <slouken@libsdl.org>
parents:
2967
diff
changeset
|
278 |
2753 | 279 /* * * */ |
280 /* 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
|
281 SDL_bool suspend_screensaver; |
2753 | 282 int num_displays; |
283 SDL_VideoDisplay *displays; | |
284 int current_display; | |
285 Uint32 next_object_id; | |
0 | 286 |
2753 | 287 /* * * */ |
288 /* Data used by the GL drivers */ | |
289 struct | |
290 { | |
291 int red_size; | |
292 int green_size; | |
293 int blue_size; | |
294 int alpha_size; | |
295 int depth_size; | |
296 int buffer_size; | |
297 int stencil_size; | |
298 int double_buffer; | |
299 int accum_red_size; | |
300 int accum_green_size; | |
301 int accum_blue_size; | |
302 int accum_alpha_size; | |
303 int stereo; | |
304 int multisamplebuffers; | |
305 int multisamplesamples; | |
306 int accelerated; | |
307 int retained_backing; | |
308 int driver_loaded; | |
309 char driver_path[256]; | |
310 void *dll_handle; | |
311 } gl_config; | |
0 | 312 |
2753 | 313 /* * * */ |
314 /* Data private to this driver */ | |
315 void *driverdata; | |
316 struct SDL_GLDriverData *gl_data; | |
0 | 317 |
2753 | 318 /* * * */ |
319 /* The function used to dispose of this structure */ | |
320 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
|
321 }; |
0 | 322 |
2753 | 323 typedef struct VideoBootStrap |
324 { | |
325 const char *name; | |
326 const char *desc; | |
327 int (*available) (void); | |
328 SDL_VideoDevice *(*create) (int devindex); | |
329 } VideoBootStrap; | |
0 | 330 |
1931
103c6fec2a60
The Mac OS X Cocoa video driver is under construction...
Sam Lantinga <slouken@libsdl.org>
parents:
1928
diff
changeset
|
331 #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
|
332 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
|
333 #endif |
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1330
diff
changeset
|
334 #if SDL_VIDEO_DRIVER_X11 |
0 | 335 extern VideoBootStrap X11_bootstrap; |
336 #endif | |
1361
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1330
diff
changeset
|
337 #if SDL_VIDEO_DRIVER_NANOX |
30
57bf11a5efd7
Added initial support for Nano-X (thanks Hsieh-Fu!)
Sam Lantinga <slouken@lokigames.com>
parents:
19
diff
changeset
|
338 extern VideoBootStrap NX_bootstrap; |
57bf11a5efd7
Added initial support for Nano-X (thanks Hsieh-Fu!)
Sam Lantinga <slouken@lokigames.com>
parents:
19
diff
changeset
|
339 #endif |
1361
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1330
diff
changeset
|
340 #if SDL_VIDEO_DRIVER_IPOD |
1140
af8b0f9ac2f4
iPod Linux framebuffer support.
Ryan C. Gordon <icculus@icculus.org>
parents:
1052
diff
changeset
|
341 extern VideoBootStrap iPod_bootstrap; |
af8b0f9ac2f4
iPod Linux framebuffer support.
Ryan C. Gordon <icculus@icculus.org>
parents:
1052
diff
changeset
|
342 #endif |
1361
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1330
diff
changeset
|
343 #if SDL_VIDEO_DRIVER_WSCONS |
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1330
diff
changeset
|
344 extern VideoBootStrap WSCONS_bootstrap; |
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1330
diff
changeset
|
345 #endif |
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1330
diff
changeset
|
346 #if SDL_VIDEO_DRIVER_FBCON |
0 | 347 extern VideoBootStrap FBCON_bootstrap; |
348 #endif | |
1361
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1330
diff
changeset
|
349 #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
|
350 extern VideoBootStrap DirectFB_bootstrap; |
cb384ef627f6
Added support for DirectFB video on Linux (thanks Denis!)
Sam Lantinga <slouken@libsdl.org>
parents:
75
diff
changeset
|
351 #endif |
1361
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1330
diff
changeset
|
352 #if SDL_VIDEO_DRIVER_PS2GS |
0 | 353 extern VideoBootStrap PS2GS_bootstrap; |
354 #endif | |
1361
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1330
diff
changeset
|
355 #if SDL_VIDEO_DRIVER_VGL |
75
b0ae59d0f3ee
Added patches from FreeBSD ports
Sam Lantinga <slouken@lokigames.com>
parents:
47
diff
changeset
|
356 extern VideoBootStrap VGL_bootstrap; |
b0ae59d0f3ee
Added patches from FreeBSD ports
Sam Lantinga <slouken@lokigames.com>
parents:
47
diff
changeset
|
357 #endif |
1361
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1330
diff
changeset
|
358 #if SDL_VIDEO_DRIVER_SVGALIB |
0 | 359 extern VideoBootStrap SVGALIB_bootstrap; |
360 #endif | |
1361
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1330
diff
changeset
|
361 #if SDL_VIDEO_DRIVER_GAPI |
1251
86d0d01290ea
Updated Windows CE/PocketPC support...adds GAPI driver, landscape mode,
Ryan C. Gordon <icculus@icculus.org>
parents:
1190
diff
changeset
|
362 extern VideoBootStrap GAPI_bootstrap; |
86d0d01290ea
Updated Windows CE/PocketPC support...adds GAPI driver, landscape mode,
Ryan C. Gordon <icculus@icculus.org>
parents:
1190
diff
changeset
|
363 #endif |
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
|
364 #if SDL_VIDEO_DRIVER_WIN32 |
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
|
365 extern VideoBootStrap WIN32_bootstrap; |
0 | 366 #endif |
1361
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1330
diff
changeset
|
367 #if SDL_VIDEO_DRIVER_BWINDOW |
0 | 368 extern VideoBootStrap BWINDOW_bootstrap; |
369 #endif | |
1361
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1330
diff
changeset
|
370 #if SDL_VIDEO_DRIVER_PHOTON |
173
83018110dce8
Added initial support for EPOC/Symbian OS (thanks Hannu!)
Sam Lantinga <slouken@libsdl.org>
parents:
167
diff
changeset
|
371 extern VideoBootStrap ph_bootstrap; |
83018110dce8
Added initial support for EPOC/Symbian OS (thanks Hannu!)
Sam Lantinga <slouken@libsdl.org>
parents:
167
diff
changeset
|
372 #endif |
1361
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1330
diff
changeset
|
373 #if SDL_VIDEO_DRIVER_EPOC |
173
83018110dce8
Added initial support for EPOC/Symbian OS (thanks Hannu!)
Sam Lantinga <slouken@libsdl.org>
parents:
167
diff
changeset
|
374 extern VideoBootStrap EPOC_bootstrap; |
83018110dce8
Added initial support for EPOC/Symbian OS (thanks Hannu!)
Sam Lantinga <slouken@libsdl.org>
parents:
167
diff
changeset
|
375 #endif |
1361
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1330
diff
changeset
|
376 #if SDL_VIDEO_DRIVER_XBIOS |
281
c5010ab8ba35
Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
252
diff
changeset
|
377 extern VideoBootStrap XBIOS_bootstrap; |
c5010ab8ba35
Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
252
diff
changeset
|
378 #endif |
1361
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1330
diff
changeset
|
379 #if SDL_VIDEO_DRIVER_GEM |
281
c5010ab8ba35
Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
252
diff
changeset
|
380 extern VideoBootStrap GEM_bootstrap; |
c5010ab8ba35
Added initial support for Atari (thanks Patrice!)
Sam Lantinga <slouken@libsdl.org>
parents:
252
diff
changeset
|
381 #endif |
1361
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1330
diff
changeset
|
382 #if SDL_VIDEO_DRIVER_DC |
509
dad72daf44b3
Added initial support for Dreamcast (thanks HERO!)
Sam Lantinga <slouken@libsdl.org>
parents:
453
diff
changeset
|
383 extern VideoBootStrap DC_bootstrap; |
dad72daf44b3
Added initial support for Dreamcast (thanks HERO!)
Sam Lantinga <slouken@libsdl.org>
parents:
453
diff
changeset
|
384 #endif |
1361
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1330
diff
changeset
|
385 #if SDL_VIDEO_DRIVER_RISCOS |
630
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
509
diff
changeset
|
386 extern VideoBootStrap RISCOS_bootstrap; |
550bccdf04bd
Added initial support for RISC OS (thanks Peter Naulls!)
Sam Lantinga <slouken@libsdl.org>
parents:
509
diff
changeset
|
387 #endif |
1361
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1330
diff
changeset
|
388 #if SDL_VIDEO_DRIVER_OS2FS |
1190 | 389 extern VideoBootStrap OS2FSLib_bootstrap; |
390 #endif | |
2742
b86247d21929
Added retained backing attribute, reference to UIKit renderer
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2735
diff
changeset
|
391 #if SDL_VIDEO_DRIVER_UIKIT |
b86247d21929
Added retained backing attribute, reference to UIKit renderer
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2735
diff
changeset
|
392 extern VideoBootStrap UIKIT_bootstrap; |
b86247d21929
Added retained backing attribute, reference to UIKit renderer
Holmes Futrell <hfutrell@umail.ucsb.edu>
parents:
2735
diff
changeset
|
393 #endif |
1361
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1330
diff
changeset
|
394 #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
|
395 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
|
396 #endif |
2735
204be4fc2726
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2702
diff
changeset
|
397 #if SDL_VIDEO_DRIVER_NDS |
204be4fc2726
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2702
diff
changeset
|
398 extern VideoBootStrap NDS_bootstrap; |
204be4fc2726
Final merge of Google Summer of Code 2008 work...
Sam Lantinga <slouken@libsdl.org>
parents:
2702
diff
changeset
|
399 #endif |
1361
19418e4422cb
New configure-based build system. Still work in progress, but much improved
Sam Lantinga <slouken@libsdl.org>
parents:
1330
diff
changeset
|
400 |
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
|
401 #define SDL_CurrentDisplay (_this->displays[_this->current_display]) |
0 | 402 |
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
|
403 extern SDL_VideoDevice *SDL_GetVideoDevice(); |
2753 | 404 extern int SDL_AddBasicVideoDisplay(const SDL_DisplayMode * desktop_mode); |
405 extern int SDL_AddVideoDisplay(const SDL_VideoDisplay * display); | |
406 extern SDL_bool | |
407 SDL_AddDisplayMode(int displayIndex, const SDL_DisplayMode * mode); | |
408 extern void | |
409 SDL_AddRenderDriver(int displayIndex, const SDL_RenderDriver * 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
|
410 |
2753 | 411 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
|
412 extern SDL_Window *SDL_GetWindowFromID(SDL_WindowID windowID); |
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
|
413 extern SDL_VideoDisplay *SDL_GetDisplayFromWindow(SDL_Window * window); |
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
|
414 |
2753 | 415 extern void SDL_OnWindowShown(SDL_Window * window); |
416 extern void SDL_OnWindowHidden(SDL_Window * window); | |
417 extern void SDL_OnWindowResized(SDL_Window * window); | |
418 extern void SDL_OnWindowFocusGained(SDL_Window * window); | |
419 extern void SDL_OnWindowFocusLost(SDL_Window * 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
|
420 extern SDL_WindowID SDL_GetFocusWindow(void); |
0 | 421 |
2753 | 422 #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
|
423 |
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
|
424 /* vi: set ts=4 sw=4 expandtab: */ |