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