src/video/SDL_sysvideo.h
branchSDL-1.3
changeset 1662 782fd950bd46
parent 1658 e49147870aac
child 1666 6e7ec5cb83c3
     1.1 --- a/src/video/SDL_sysvideo.h	Sun May 21 17:27:13 2006 +0000
     1.2 +++ b/src/video/SDL_sysvideo.h	Sun May 28 13:04:16 2006 +0000
     1.3 @@ -38,151 +38,190 @@
     1.4  #endif /* SDL_VIDEO_OPENGL */
     1.5  
     1.6  /* The SDL video driver */
     1.7 +
     1.8 +/* Define the SDL window structure, corresponding to toplevel windows */
     1.9 +typedef struct SDL_Window SDL_Window;
    1.10 +
    1.11 +struct SDL_Window
    1.12 +{
    1.13 +    Uint32 id;
    1.14 +
    1.15 +    char *title;
    1.16 +    int x, y;
    1.17 +    int w, h;
    1.18 +    Uint32 flags;
    1.19 +
    1.20 +    SDL_Surface *surface;
    1.21 +    SDL_Surface *shadow;
    1.22 +    Uint16 *gamma;
    1.23 +
    1.24 +    void *userdata;
    1.25 +    void *driverdata;
    1.26 +};
    1.27 +
    1.28 +/* Define the SDL display structure
    1.29 +   This corresponds to physical monitors attached to the system.
    1.30 + */
    1.31 +typedef struct SDL_VideoDisplay
    1.32 +{
    1.33 +    int num_display_modes;
    1.34 +    SDL_DisplayMode *display_modes;
    1.35 +    SDL_DisplayMode desktop_mode;
    1.36 +    SDL_DisplayMode current_mode;
    1.37 +
    1.38 +    int max_windows;
    1.39 +    int num_windows;
    1.40 +    SDL_Window *windows;
    1.41 +
    1.42 +    void *driverdata;
    1.43 +} SDL_VideoDisplay;
    1.44 +
    1.45  typedef struct SDL_VideoDevice SDL_VideoDevice;
    1.46  
    1.47  /* Define the SDL video driver structure */
    1.48  #define _THIS	SDL_VideoDevice *_this
    1.49 -#ifndef _STATUS
    1.50 -#define _STATUS	SDL_status *status
    1.51 -#endif
    1.52 -struct SDL_VideoDevice {
    1.53 -	/* * * */
    1.54 -	/* The name of this video driver */
    1.55 -	const char *name;
    1.56  
    1.57 -	/* * * */
    1.58 -	/* Initialization/Query functions */
    1.59 +struct SDL_VideoDevice
    1.60 +{
    1.61 +    /* * * */
    1.62 +    /* The name of this video driver */
    1.63 +    const char *name;
    1.64  
    1.65 -	/* Initialize the native video subsystem, filling 'vformat' with the 
    1.66 -	   "best" display pixel format, returning 0 or -1 if there's an error.
    1.67 -	 */
    1.68 -	int (*VideoInit)(_THIS, SDL_PixelFormat *vformat);
    1.69 +    /* * * */
    1.70 +    /* Initialization/Query functions */
    1.71  
    1.72 -	/* List the available video modes for the given pixel format, sorted
    1.73 -	   from largest to smallest.
    1.74 -	 */
    1.75 -	SDL_Rect **(*ListModes)(_THIS, SDL_PixelFormat *format, Uint32 flags);
    1.76 +    /* Initialize the native video subsystem, filling in the list
    1.77 +       of displays for this driver, returning 0 or -1 if there's an error.
    1.78 +     */
    1.79 +    int (*VideoInit) (_THIS);
    1.80  
    1.81 -	/* Set the requested video mode, returning a surface which will be
    1.82 -	   set to the SDL_VideoSurface.  The width and height will already
    1.83 -	   be verified by ListModes(), and the video subsystem is free to
    1.84 -	   set the mode to a supported bit depth different from the one
    1.85 -	   specified -- the desired bpp will be emulated with a shadow
    1.86 -	   surface if necessary.  If a new mode is returned, this function
    1.87 -	   should take care of cleaning up the current mode.
    1.88 -	 */
    1.89 -	SDL_Surface *(*SetVideoMode)(_THIS, SDL_Surface *current,
    1.90 -				int width, int height, int bpp, Uint32 flags);
    1.91 +    /* * * */
    1.92 +    /* Display functions
    1.93 +     */
    1.94 +    /* Setting the display mode is independent of creating windows,
    1.95 +     * so when the display mode is changed, all existing windows
    1.96 +     * should have their data updated accordingly, including the
    1.97 +     * display surfaces associated with them.
    1.98 +     */
    1.99 +    int (*SetDisplayMode) (_THIS, const SDL_DisplayMode * mode);
   1.100  
   1.101 -	/* Toggle the fullscreen mode */
   1.102 -	int (*ToggleFullScreen)(_THIS, int on);
   1.103 +    /* * * */
   1.104 +    /* Window functions
   1.105 +     */
   1.106 +    int (*CreateWindow) (_THIS, SDL_Window * window);
   1.107 +    int (*CreateWindowFrom) (_THIS, SDL_Window * window, void *data);
   1.108 +    void (*SetWindowTitle) (_THIS, SDL_Window * window);
   1.109 +    void (*SetWindowPosition) (_THIS, SDL_Window * window);
   1.110 +    void (*SetWindowSize) (_THIS, SDL_Window * window);
   1.111 +    void (*ShowWindow) (_THIS, SDL_Window * window);
   1.112 +    void (*HideWindow) (_THIS, SDL_Window * window);
   1.113 +    void (*RaiseWindow) (_THIS, SDL_Window * window);
   1.114 +    void (*MaximizeWindow) (_THIS, SDL_Window * window);
   1.115 +    void (*MinimizeWindow) (_THIS, SDL_Window * window);
   1.116 +    void (*RestoreWindow) (_THIS, SDL_Window * window);
   1.117 +    void (*SetWindowGrab) (_THIS, SDL_Window * window);
   1.118 +    void (*DestroyWindow) (_THIS, SDL_Window * window);
   1.119  
   1.120 -	/* This is called after the video mode has been set, to get the
   1.121 -	   initial mouse state.  It should queue events as necessary to
   1.122 -	   properly represent the current mouse focus and position.
   1.123 -	 */
   1.124 -	void (*UpdateMouse)(_THIS);
   1.125 +    SDL_Surface *(*CreateWindowSurface) (_THIS, SDL_Window * window);
   1.126 +    void (*UpdateWindowSurface) (_THIS, SDL_Window * window, int numrects,
   1.127 +                                 SDL_Rect * rects);
   1.128 +    void (*FlipWindowSurface) (_THIS, SDL_Window * window);
   1.129  
   1.130 -	/* Create a YUV video surface (possibly overlay) of the given
   1.131 -	   format.  The hardware should be able to perform at least 2x
   1.132 -	   scaling on display.
   1.133 -	 */
   1.134 -	SDL_Overlay *(*CreateYUVOverlay)(_THIS, int width, int height,
   1.135 -	                                 Uint32 format, SDL_Surface *display);
   1.136 +    /* Sets the color entries { firstcolor .. (firstcolor+ncolors-1) }
   1.137 +       of the physical palette to those in 'colors'. If the device is
   1.138 +       using a software palette (SDL_HWPALETTE not set), then the
   1.139 +       changes are reflected in the logical palette of the screen
   1.140 +       as well.
   1.141 +       The return value is 1 if all entries could be set properly
   1.142 +       or 0 otherwise.
   1.143 +     */
   1.144 +    int (*SetWindowColors) (_THIS, SDL_Window * window,
   1.145 +                            int firstcolor, int ncolors, SDL_Color * colors);
   1.146  
   1.147 -        /* Sets the color entries { firstcolor .. (firstcolor+ncolors-1) }
   1.148 -	   of the physical palette to those in 'colors'. If the device is
   1.149 -	   using a software palette (SDL_HWPALETTE not set), then the
   1.150 -	   changes are reflected in the logical palette of the screen
   1.151 -	   as well.
   1.152 -	   The return value is 1 if all entries could be set properly
   1.153 -	   or 0 otherwise.
   1.154 -	*/
   1.155 -	int (*SetColors)(_THIS, int firstcolor, int ncolors,
   1.156 -			 SDL_Color *colors);
   1.157 +    /* Get some platform dependent window information */
   1.158 +      SDL_bool (*GetWindowWMInfo) (_THIS, SDL_Window * window,
   1.159 +                                   SDL_SysWMinfo * info);
   1.160  
   1.161 -	/* This pointer should exist in the native video subsystem and should
   1.162 -	   point to an appropriate update function for the current video mode
   1.163 -	 */
   1.164 -	void (*UpdateRects)(_THIS, int numrects, SDL_Rect *rects);
   1.165 +    /* Create a YUV video surface (possibly overlay) of the given
   1.166 +       format.  The hardware should be able to perform at least 2x
   1.167 +       scaling on display.
   1.168 +     */
   1.169 +    SDL_Overlay *(*CreateYUVOverlay) (_THIS, int width, int height,
   1.170 +                                      Uint32 format, SDL_Surface * display);
   1.171  
   1.172 -	/* Reverse the effects VideoInit() -- called if VideoInit() fails
   1.173 -	   or if the application is shutting down the video subsystem.
   1.174 -	*/
   1.175 -	void (*VideoQuit)(_THIS);
   1.176 +    /* Reverse the effects VideoInit() -- called if VideoInit() fails
   1.177 +       or if the application is shutting down the video subsystem.
   1.178 +     */
   1.179 +    void (*VideoQuit) (_THIS);
   1.180  
   1.181 -	/* * * */
   1.182 -	/* Hardware acceleration functions */
   1.183 +    /* * * */
   1.184 +    /* Hardware acceleration functions */
   1.185  
   1.186 -	/* Information about the video hardware */
   1.187 -	SDL_VideoInfo info;
   1.188 +    /* Information about the video hardware */
   1.189 +    SDL_VideoInfo info;
   1.190  
   1.191 -	/* The pixel format used when SDL_CreateRGBSurface creates SDL_HWSURFACEs with alpha */
   1.192 -	SDL_PixelFormat* displayformatalphapixel;
   1.193 +    /* The pixel format used when SDL_CreateRGBSurface creates SDL_HWSURFACEs with alpha */
   1.194 +    SDL_PixelFormat *displayformatalphapixel;
   1.195  
   1.196 -	/* Allocates a surface in video memory */
   1.197 -	int (*AllocHWSurface)(_THIS, SDL_Surface *surface);
   1.198 +    /* Allocates a surface in video memory */
   1.199 +    int (*AllocHWSurface) (_THIS, SDL_Surface * surface);
   1.200  
   1.201 -	/* Sets the hardware accelerated blit function, if any, based
   1.202 -	   on the current flags of the surface (colorkey, alpha, etc.)
   1.203 -	 */
   1.204 -	int (*CheckHWBlit)(_THIS, SDL_Surface *src, SDL_Surface *dst);
   1.205 +    /* Sets the hardware accelerated blit function, if any, based
   1.206 +       on the current flags of the surface (colorkey, alpha, etc.)
   1.207 +     */
   1.208 +    int (*CheckHWBlit) (_THIS, SDL_Surface * src, SDL_Surface * dst);
   1.209  
   1.210 -	/* Fills a surface rectangle with the given color */
   1.211 -	int (*FillHWRect)(_THIS, SDL_Surface *dst, SDL_Rect *rect, Uint32 color);
   1.212 +    /* Fills a surface rectangle with the given color */
   1.213 +    int (*FillHWRect) (_THIS, SDL_Surface * dst, SDL_Rect * rect,
   1.214 +                       Uint32 color);
   1.215  
   1.216 -	/* Sets video mem colorkey and accelerated blit function */
   1.217 -	int (*SetHWColorKey)(_THIS, SDL_Surface *surface, Uint32 key);
   1.218 +    /* Sets video mem colorkey and accelerated blit function */
   1.219 +    int (*SetHWColorKey) (_THIS, SDL_Surface * surface, Uint32 key);
   1.220  
   1.221 -	/* Sets per surface hardware alpha value */
   1.222 -	int (*SetHWAlpha)(_THIS, SDL_Surface *surface, Uint8 value);
   1.223 +    /* Sets per surface hardware alpha value */
   1.224 +    int (*SetHWAlpha) (_THIS, SDL_Surface * surface, Uint8 value);
   1.225  
   1.226 -	/* Returns a readable/writable surface */
   1.227 -	int (*LockHWSurface)(_THIS, SDL_Surface *surface);
   1.228 -	void (*UnlockHWSurface)(_THIS, SDL_Surface *surface);
   1.229 +    /* Returns a readable/writable surface */
   1.230 +    int (*LockHWSurface) (_THIS, SDL_Surface * surface);
   1.231 +    void (*UnlockHWSurface) (_THIS, SDL_Surface * surface);
   1.232  
   1.233 -	/* Performs hardware flipping */
   1.234 -	int (*FlipHWSurface)(_THIS, SDL_Surface *surface);
   1.235 +    /* Frees a previously allocated video surface */
   1.236 +    void (*FreeHWSurface) (_THIS, SDL_Surface * surface);
   1.237  
   1.238 -	/* Frees a previously allocated video surface */
   1.239 -	void (*FreeHWSurface)(_THIS, SDL_Surface *surface);
   1.240 +    /* * * */
   1.241 +    /* Gamma support */
   1.242  
   1.243 -	/* * * */
   1.244 -	/* Gamma support */
   1.245 +    /* Set the gamma correction directly (emulated with gamma ramps) */
   1.246 +    int (*SetGamma) (_THIS, float red, float green, float blue);
   1.247  
   1.248 -	Uint16 *gamma;
   1.249 +    /* Get the gamma correction directly (emulated with gamma ramps) */
   1.250 +    int (*GetGamma) (_THIS, float *red, float *green, float *blue);
   1.251  
   1.252 -	/* Set the gamma correction directly (emulated with gamma ramps) */
   1.253 -	int (*SetGamma)(_THIS, float red, float green, float blue);
   1.254 +    /* Set the gamma ramp */
   1.255 +    int (*SetGammaRamp) (_THIS, Uint16 * ramp);
   1.256  
   1.257 -	/* Get the gamma correction directly (emulated with gamma ramps) */
   1.258 -	int (*GetGamma)(_THIS, float *red, float *green, float *blue);
   1.259 +    /* Get the gamma ramp */
   1.260 +    int (*GetGammaRamp) (_THIS, Uint16 * ramp);
   1.261  
   1.262 -	/* Set the gamma ramp */
   1.263 -	int (*SetGammaRamp)(_THIS, Uint16 *ramp);
   1.264 +    /* * * */
   1.265 +    /* OpenGL support */
   1.266  
   1.267 -	/* Get the gamma ramp */
   1.268 -	int (*GetGammaRamp)(_THIS, Uint16 *ramp);
   1.269 +    /* Sets the dll to use for OpenGL and loads it */
   1.270 +    int (*GL_LoadLibrary) (_THIS, const char *path);
   1.271  
   1.272 -	/* * * */
   1.273 -	/* OpenGL support */
   1.274 +    /* Retrieves the address of a function in the gl library */
   1.275 +    void *(*GL_GetProcAddress) (_THIS, const char *proc);
   1.276  
   1.277 -	/* Sets the dll to use for OpenGL and loads it */
   1.278 -	int (*GL_LoadLibrary)(_THIS, const char *path);
   1.279 +    /* Get attribute information from the windowing system. */
   1.280 +    int (*GL_GetAttribute) (_THIS, SDL_GLattr attrib, int *value);
   1.281  
   1.282 -	/* Retrieves the address of a function in the gl library */
   1.283 -	void* (*GL_GetProcAddress)(_THIS, const char *proc);
   1.284 +    /* Make the context associated with this driver current */
   1.285 +    int (*GL_MakeCurrent) (_THIS);
   1.286  
   1.287 -	/* Get attribute information from the windowing system. */
   1.288 -	int (*GL_GetAttribute)(_THIS, SDL_GLattr attrib, int* value);
   1.289 +    /* Swap the current buffers in double buffer mode. */
   1.290 +    void (*GL_SwapBuffers) (_THIS);
   1.291  
   1.292 -	/* Make the context associated with this driver current */
   1.293 -	int (*GL_MakeCurrent)(_THIS);
   1.294 -
   1.295 -	/* Swap the current buffers in double buffer mode. */
   1.296 -	void (*GL_SwapBuffers)(_THIS);
   1.297 -
   1.298 -  	/* OpenGL functions for SDL_OPENGLBLIT */
   1.299 +    /* OpenGL functions for glSDL */
   1.300  #if SDL_VIDEO_OPENGL
   1.301  #if !defined(__WIN32__)
   1.302  #define WINAPI
   1.303 @@ -191,130 +230,106 @@
   1.304  #include "SDL_glfuncs.h"
   1.305  #undef SDL_PROC
   1.306  
   1.307 -	/* Texture id */
   1.308 -	GLuint texture;
   1.309 +    /* Texture id */
   1.310 +    GLuint texture;
   1.311 +
   1.312 +    int is_32bit;
   1.313  #endif
   1.314 -	int is_32bit;
   1.315 - 
   1.316 -	/* * * */
   1.317 -	/* Window manager functions */
   1.318  
   1.319 -	/* Set the title and icon text */
   1.320 -	void (*SetCaption)(_THIS, const char *title, const char *icon);
   1.321 +    /* * * */
   1.322 +    /* Cursor manager functions */
   1.323  
   1.324 -	/* Set the window icon image */
   1.325 -	void (*SetIcon)(_THIS, SDL_Surface *icon, Uint8 *mask);
   1.326 +    /* Free a window manager cursor
   1.327 +       This function can be NULL if CreateWMCursor is also NULL.
   1.328 +     */
   1.329 +    void (*FreeWMCursor) (_THIS, WMcursor * cursor);
   1.330  
   1.331 -	/* Iconify the window.
   1.332 -	   This function returns 1 if there is a window manager and the
   1.333 -	   window was actually iconified, it returns 0 otherwise.
   1.334 -	*/
   1.335 -	int (*IconifyWindow)(_THIS);
   1.336 +    /* If not NULL, create a black/white window manager cursor */
   1.337 +    WMcursor *(*CreateWMCursor) (_THIS,
   1.338 +                                 Uint8 * data, Uint8 * mask, int w, int h,
   1.339 +                                 int hot_x, int hot_y);
   1.340  
   1.341 -	/* Grab or ungrab keyboard and mouse input */
   1.342 -	SDL_GrabMode (*GrabInput)(_THIS, SDL_GrabMode mode);
   1.343 +    /* Show the specified cursor, or hide if cursor is NULL */
   1.344 +    int (*ShowWMCursor) (_THIS, WMcursor * cursor);
   1.345  
   1.346 -	/* Get some platform dependent window information */
   1.347 -	int (*GetWMInfo)(_THIS, SDL_SysWMinfo *info);
   1.348 +    /* Warp the window manager cursor to (x,y)
   1.349 +       If NULL, a mouse motion event is posted internally.
   1.350 +     */
   1.351 +    void (*WarpWMCursor) (_THIS, Uint16 x, Uint16 y);
   1.352  
   1.353 -	/* * * */
   1.354 -	/* Cursor manager functions */
   1.355 +    /* If not NULL, this is called when a mouse motion event occurs */
   1.356 +    void (*MoveWMCursor) (_THIS, int x, int y);
   1.357  
   1.358 -	/* Free a window manager cursor
   1.359 -	   This function can be NULL if CreateWMCursor is also NULL.
   1.360 -	 */
   1.361 -	void (*FreeWMCursor)(_THIS, WMcursor *cursor);
   1.362 +    /* Determine whether the mouse should be in relative mode or not.
   1.363 +       This function is called when the input grab state or cursor
   1.364 +       visibility state changes.
   1.365 +       If the cursor is not visible, and the input is grabbed, the
   1.366 +       driver can place the mouse in relative mode, which may result
   1.367 +       in higher accuracy sampling of the pointer motion.
   1.368 +     */
   1.369 +    void (*CheckMouseMode) (_THIS);
   1.370  
   1.371 -	/* If not NULL, create a black/white window manager cursor */
   1.372 -	WMcursor *(*CreateWMCursor)(_THIS,
   1.373 -		Uint8 *data, Uint8 *mask, int w, int h, int hot_x, int hot_y);
   1.374 +    /* * * */
   1.375 +    /* Event manager functions */
   1.376  
   1.377 -	/* Show the specified cursor, or hide if cursor is NULL */
   1.378 -	int (*ShowWMCursor)(_THIS, WMcursor *cursor);
   1.379 +    /* Initialize keyboard mapping for this driver */
   1.380 +    void (*InitOSKeymap) (_THIS);
   1.381  
   1.382 -	/* Warp the window manager cursor to (x,y)
   1.383 -	   If NULL, a mouse motion event is posted internally.
   1.384 -	 */
   1.385 -	void (*WarpWMCursor)(_THIS, Uint16 x, Uint16 y);
   1.386 +    /* Handle any queued OS events */
   1.387 +    void (*PumpEvents) (_THIS);
   1.388  
   1.389 -	/* If not NULL, this is called when a mouse motion event occurs */
   1.390 -	void (*MoveWMCursor)(_THIS, int x, int y);
   1.391 +    /* * * */
   1.392 +    /* Data common to all drivers */
   1.393 +    int num_displays;
   1.394 +    SDL_VideoDisplay *displays;
   1.395 +    int current_display;
   1.396 +    Uint32 next_window_id;
   1.397  
   1.398 -	/* Determine whether the mouse should be in relative mode or not.
   1.399 -	   This function is called when the input grab state or cursor
   1.400 -	   visibility state changes.
   1.401 -	   If the cursor is not visible, and the input is grabbed, the
   1.402 -	   driver can place the mouse in relative mode, which may result
   1.403 -	   in higher accuracy sampling of the pointer motion.
   1.404 -	*/
   1.405 -	void (*CheckMouseMode)(_THIS);
   1.406 +    /* Driver information flags */
   1.407  
   1.408 -	/* * * */
   1.409 -	/* Event manager functions */
   1.410 +    /* * * */
   1.411 +    /* Data used by the GL drivers */
   1.412 +    struct
   1.413 +    {
   1.414 +        int red_size;
   1.415 +        int green_size;
   1.416 +        int blue_size;
   1.417 +        int alpha_size;
   1.418 +        int depth_size;
   1.419 +        int buffer_size;
   1.420 +        int stencil_size;
   1.421 +        int double_buffer;
   1.422 +        int accum_red_size;
   1.423 +        int accum_green_size;
   1.424 +        int accum_blue_size;
   1.425 +        int accum_alpha_size;
   1.426 +        int stereo;
   1.427 +        int multisamplebuffers;
   1.428 +        int multisamplesamples;
   1.429 +        int accelerated;
   1.430 +        int swap_control;
   1.431 +        int driver_loaded;
   1.432 +        char driver_path[256];
   1.433 +        void *dll_handle;
   1.434 +    } gl_config;
   1.435  
   1.436 -	/* Initialize keyboard mapping for this driver */
   1.437 -	void (*InitOSKeymap)(_THIS);
   1.438 +    /* * * */
   1.439 +    /* Data private to this driver */
   1.440 +    struct SDL_PrivateVideoData *hidden;
   1.441 +    struct SDL_PrivateGLData *gl_data;
   1.442  
   1.443 -	/* Handle any queued OS events */
   1.444 -	void (*PumpEvents)(_THIS);
   1.445 -
   1.446 -	/* * * */
   1.447 -	/* Data common to all drivers */
   1.448 -	SDL_Surface *screen;
   1.449 -	SDL_Surface *shadow;
   1.450 -	SDL_Surface *visible;
   1.451 -        SDL_Palette *physpal;	/* physical palette, if != logical palette */
   1.452 -        SDL_Color *gammacols;	/* gamma-corrected colours, or NULL */
   1.453 -	char *wm_title;
   1.454 -	char *wm_icon;
   1.455 -	int offset_x;
   1.456 -	int offset_y;
   1.457 -	SDL_GrabMode input_grab;
   1.458 -
   1.459 -	/* Driver information flags */
   1.460 -	int handles_any_size;	/* Driver handles any size video mode */
   1.461 -
   1.462 -	/* * * */
   1.463 -	/* Data used by the GL drivers */
   1.464 -	struct {
   1.465 -		int red_size;
   1.466 -		int green_size;
   1.467 -		int blue_size;
   1.468 -		int alpha_size;
   1.469 -		int depth_size;
   1.470 -		int buffer_size;
   1.471 -		int stencil_size;
   1.472 -		int double_buffer;
   1.473 -		int accum_red_size;
   1.474 -		int accum_green_size;
   1.475 -		int accum_blue_size;
   1.476 -		int accum_alpha_size;
   1.477 -		int stereo;
   1.478 -		int multisamplebuffers;
   1.479 -		int multisamplesamples;
   1.480 -		int accelerated;
   1.481 -		int swap_control;
   1.482 -		int driver_loaded;
   1.483 -		char driver_path[256];
   1.484 -		void* dll_handle;
   1.485 -	} gl_config;
   1.486 -
   1.487 -	/* * * */
   1.488 -	/* Data private to this driver */
   1.489 -	struct SDL_PrivateVideoData *hidden;
   1.490 -	struct SDL_PrivateGLData *gl_data;
   1.491 -
   1.492 -	/* * * */
   1.493 -	/* The function used to dispose of this structure */
   1.494 -	void (*free)(_THIS);
   1.495 +    /* * * */
   1.496 +    /* The function used to dispose of this structure */
   1.497 +    void (*free) (_THIS);
   1.498  };
   1.499  #undef _THIS
   1.500  
   1.501 -typedef struct VideoBootStrap {
   1.502 -	const char *name;
   1.503 -	const char *desc;
   1.504 -	int (*available)(void);
   1.505 -	SDL_VideoDevice *(*create)(int devindex);
   1.506 +typedef struct VideoBootStrap
   1.507 +{
   1.508 +    const char *name;
   1.509 +    const char *desc;
   1.510 +    int (*available) (void);
   1.511 +    SDL_VideoDevice *(*create) (int devindex);
   1.512  } VideoBootStrap;
   1.513  
   1.514  #if SDL_VIDEO_DRIVER_QUARTZ
   1.515 @@ -411,11 +426,18 @@
   1.516  extern VideoBootStrap glSDL_bootstrap;
   1.517  #endif
   1.518  
   1.519 -/* This is the current video device */
   1.520 -extern SDL_VideoDevice *current_video;
   1.521 +#define SDL_CurrentDisplay	(_this->displays[_this->current_display])
   1.522 +#define SDL_CurrentWindow	(SDL_CurrentDisplay.windows[0])
   1.523 +#define SDL_VideoSurface	((_this && SDL_CurrentDisplay.num_windows > 0) ? SDL_CurrentWindow.surface : NULL)
   1.524 +#define SDL_ShadowSurface	((_this && SDL_CurrentDisplay.num_windows > 0) ? SDL_CurrentWindow.shadow : NULL)
   1.525 +#define SDL_PublicSurface	(SDL_ShadowSurface ? SDL_ShadowSurface : SDL_VideoSurface)
   1.526  
   1.527 -#define SDL_VideoSurface	(current_video->screen)
   1.528 -#define SDL_ShadowSurface	(current_video->shadow)
   1.529 -#define SDL_PublicSurface	(current_video->visible)
   1.530 +extern SDL_VideoDevice *SDL_GetVideoDevice ();
   1.531 +extern void SDL_AddBasicVideoDisplay (const SDL_DisplayMode * desktop_mode);
   1.532 +extern void SDL_AddVideoDisplay (SDL_VideoDisplay * display);
   1.533 +extern void SDL_AddDisplayMode (int display, const SDL_DisplayMode * mode);
   1.534 +extern SDL_Window *SDL_GetWindowFromSurface (SDL_Surface * surface);
   1.535  
   1.536  #endif /* _SDL_sysvideo_h */
   1.537 +
   1.538 +/* vi: set ts=4 sw=4 expandtab: */