src/video/SDL_sysvideo.h
author Sam Lantinga <slouken@libsdl.org>
Thu, 21 Jan 2010 06:21:52 +0000
changeset 3685 64ce267332c6
parent 3678 8e961ef35d4b
child 3695 f6a8be3fefa0
permissions -rw-r--r--
Switched from SDL_WindowID and SDL_TextureID to SDL_Window* and SDL_Texture* for code simplicity and improved performance.
slouken@0
     1
/*
slouken@0
     2
    SDL - Simple DirectMedia Layer
slouken@2859
     3
    Copyright (C) 1997-2009 Sam Lantinga
slouken@0
     4
slouken@0
     5
    This library is free software; you can redistribute it and/or
slouken@1312
     6
    modify it under the terms of the GNU Lesser General Public
slouken@0
     7
    License as published by the Free Software Foundation; either
slouken@1312
     8
    version 2.1 of the License, or (at your option) any later version.
slouken@0
     9
slouken@0
    10
    This library is distributed in the hope that it will be useful,
slouken@0
    11
    but WITHOUT ANY WARRANTY; without even the implied warranty of
slouken@0
    12
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
slouken@1312
    13
    Lesser General Public License for more details.
slouken@0
    14
slouken@1312
    15
    You should have received a copy of the GNU Lesser General Public
slouken@1312
    16
    License along with this library; if not, write to the Free Software
slouken@1312
    17
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
slouken@0
    18
slouken@0
    19
    Sam Lantinga
slouken@252
    20
    slouken@libsdl.org
slouken@0
    21
*/
slouken@1402
    22
#include "SDL_config.h"
slouken@0
    23
slouken@0
    24
#ifndef _SDL_sysvideo_h
slouken@0
    25
#define _SDL_sysvideo_h
slouken@0
    26
slouken@0
    27
#include "SDL_mouse.h"
slouken@2268
    28
#include "SDL_keysym.h"
slouken@0
    29
slouken@0
    30
/* The SDL video driver */
slouken@1895
    31
slouken@1895
    32
typedef struct SDL_Renderer SDL_Renderer;
slouken@1895
    33
typedef struct SDL_RenderDriver SDL_RenderDriver;
slouken@1895
    34
typedef struct SDL_VideoDisplay SDL_VideoDisplay;
slouken@0
    35
typedef struct SDL_VideoDevice SDL_VideoDevice;
slouken@0
    36
slouken@1895
    37
/* Define the SDL texture structure */
slouken@2753
    38
struct SDL_Texture
slouken@2753
    39
{
slouken@2753
    40
    Uint32 format;              /**< The pixel format of the texture */
slouken@2753
    41
    int access;                 /**< SDL_TextureAccess */
slouken@2753
    42
    int w;                      /**< The width of the texture */
slouken@2753
    43
    int h;                      /**< The height of the texture */
slouken@2753
    44
    int modMode;                /**< The texture modulation mode */
slouken@3685
    45
    int blendMode;              /**< The texture blend mode */
slouken@3685
    46
    int scaleMode;              /**< The texture scale mode */
slouken@3685
    47
    Uint8 r, g, b, a;           /**< Texture modulation values */
slouken@1895
    48
slouken@2753
    49
    SDL_Renderer *renderer;
slouken@1895
    50
slouken@3685
    51
    void *driverdata;           /**< Driver specific texture representation */
slouken@1895
    52
slouken@3685
    53
    SDL_Texture *prev;
slouken@2753
    54
    SDL_Texture *next;
slouken@1895
    55
};
slouken@1895
    56
slouken@1895
    57
/* Define the SDL renderer structure */
slouken@2753
    58
struct SDL_Renderer
slouken@2753
    59
{
slouken@2753
    60
    int (*ActivateRenderer) (SDL_Renderer * renderer);
slouken@2753
    61
    int (*DisplayModeChanged) (SDL_Renderer * renderer);
slouken@2753
    62
    int (*CreateTexture) (SDL_Renderer * renderer, SDL_Texture * texture);
slouken@2753
    63
    int (*QueryTexturePixels) (SDL_Renderer * renderer, SDL_Texture * texture,
slouken@2753
    64
                               void **pixels, int *pitch);
slouken@2753
    65
    int (*SetTexturePalette) (SDL_Renderer * renderer, SDL_Texture * texture,
slouken@2753
    66
                              const SDL_Color * colors, int firstcolor,
slouken@2753
    67
                              int ncolors);
slouken@2753
    68
    int (*GetTexturePalette) (SDL_Renderer * renderer, SDL_Texture * texture,
slouken@2753
    69
                              SDL_Color * colors, int firstcolor,
slouken@2753
    70
                              int ncolors);
slouken@2753
    71
    int (*SetTextureColorMod) (SDL_Renderer * renderer,
slouken@2753
    72
                               SDL_Texture * texture);
slouken@2753
    73
    int (*SetTextureAlphaMod) (SDL_Renderer * renderer,
slouken@2753
    74
                               SDL_Texture * texture);
slouken@2753
    75
    int (*SetTextureBlendMode) (SDL_Renderer * renderer,
slouken@2753
    76
                                SDL_Texture * texture);
slouken@2753
    77
    int (*SetTextureScaleMode) (SDL_Renderer * renderer,
slouken@2753
    78
                                SDL_Texture * texture);
slouken@2753
    79
    int (*UpdateTexture) (SDL_Renderer * renderer, SDL_Texture * texture,
slouken@2753
    80
                          const SDL_Rect * rect, const void *pixels,
slouken@2753
    81
                          int pitch);
slouken@2753
    82
    int (*LockTexture) (SDL_Renderer * renderer, SDL_Texture * texture,
slouken@2753
    83
                        const SDL_Rect * rect, int markDirty, void **pixels,
slouken@2753
    84
                        int *pitch);
slouken@2753
    85
    void (*UnlockTexture) (SDL_Renderer * renderer, SDL_Texture * texture);
slouken@2753
    86
    void (*DirtyTexture) (SDL_Renderer * renderer, SDL_Texture * texture,
slouken@2753
    87
                          int numrects, const SDL_Rect * rects);
slouken@2884
    88
    int (*SetDrawColor) (SDL_Renderer * renderer);
slouken@2884
    89
    int (*SetDrawBlendMode) (SDL_Renderer * renderer);
slouken@3596
    90
    int (*RenderClear) (SDL_Renderer * renderer);
slouken@3596
    91
    int (*RenderDrawPoints) (SDL_Renderer * renderer, const SDL_Point * points,
slouken@3596
    92
                             int count);
slouken@3596
    93
    int (*RenderDrawLines) (SDL_Renderer * renderer, const SDL_Point * points,
slouken@3596
    94
                            int count);
slouken@3596
    95
    int (*RenderDrawRects) (SDL_Renderer * renderer, const SDL_Rect ** rects,
slouken@3596
    96
                            int count);
slouken@3596
    97
    int (*RenderFillRects) (SDL_Renderer * renderer, const SDL_Rect ** rects,
slouken@3596
    98
                            int count);
slouken@3596
    99
    int (*RenderDrawEllipse) (SDL_Renderer * renderer, int x, int y,
slouken@3596
   100
                              int w, int h);
slouken@3596
   101
    int (*RenderFillEllipse) (SDL_Renderer * renderer, int x, int y,
slouken@3596
   102
                              int w, int h);
slouken@2753
   103
    int (*RenderCopy) (SDL_Renderer * renderer, SDL_Texture * texture,
slouken@2753
   104
                       const SDL_Rect * srcrect, const SDL_Rect * dstrect);
slouken@3427
   105
    int (*RenderReadPixels) (SDL_Renderer * renderer, const SDL_Rect * rect,
slouken@3435
   106
                             Uint32 format, void * pixels, int pitch);
slouken@3427
   107
    int (*RenderWritePixels) (SDL_Renderer * renderer, const SDL_Rect * rect,
slouken@3435
   108
                              Uint32 format, const void * pixels, int pitch);
slouken@2753
   109
    void (*RenderPresent) (SDL_Renderer * renderer);
slouken@2753
   110
    void (*DestroyTexture) (SDL_Renderer * renderer, SDL_Texture * texture);
slouken@1895
   111
slouken@2753
   112
    void (*DestroyRenderer) (SDL_Renderer * renderer);
slouken@1895
   113
slouken@2753
   114
    /* The current renderer info */
slouken@2753
   115
    SDL_RendererInfo info;
slouken@1895
   116
slouken@2753
   117
    /* The window associated with the renderer */
slouken@3685
   118
    SDL_Window *window;
slouken@3685
   119
slouken@3685
   120
    /* The list of textures */
slouken@3685
   121
    SDL_Texture *textures;
slouken@1895
   122
slouken@2884
   123
    Uint8 r, g, b, a;                   /**< Color for drawing operations values */
slouken@2884
   124
    int blendMode;                      /**< The drawing blend mode */
slouken@2884
   125
slouken@2753
   126
    void *driverdata;
slouken@1895
   127
};
slouken@1895
   128
slouken@1895
   129
/* Define the SDL render driver structure */
slouken@2753
   130
struct SDL_RenderDriver
slouken@2753
   131
{
slouken@2753
   132
    SDL_Renderer *(*CreateRenderer) (SDL_Window * window, Uint32 flags);
slouken@1895
   133
slouken@2753
   134
    /* Info about the renderer capabilities */
slouken@2753
   135
    SDL_RendererInfo info;
slouken@1895
   136
};
slouken@1895
   137
slouken@1895
   138
/* Define the SDL window structure, corresponding to toplevel windows */
slouken@2753
   139
struct SDL_Window
slouken@2753
   140
{
slouken@2753
   141
    Uint32 id;
slouken@2753
   142
    char *title;
slouken@2753
   143
    int x, y;
slouken@2753
   144
    int w, h;
slouken@2753
   145
    Uint32 flags;
slouken@1895
   146
slouken@3685
   147
    SDL_VideoDisplay *display;
slouken@2753
   148
    SDL_Renderer *renderer;
slouken@1895
   149
slouken@3500
   150
    SDL_DisplayMode fullscreen_mode;
slouken@3500
   151
slouken@2753
   152
    void *userdata;
slouken@2753
   153
    void *driverdata;
slouken@3685
   154
slouken@3685
   155
    SDL_Window *prev;
slouken@3685
   156
    SDL_Window *next;
slouken@1895
   157
};
slouken@1895
   158
#define FULLSCREEN_VISIBLE(W) \
slouken@1895
   159
    (((W)->flags & SDL_WINDOW_FULLSCREEN) && \
slouken@1895
   160
     ((W)->flags & SDL_WINDOW_SHOWN) && \
slouken@1895
   161
     !((W)->flags & SDL_WINDOW_MINIMIZED))
slouken@1895
   162
hfutrell@2742
   163
/*
hfutrell@2742
   164
 * Define the SDL display structure This corresponds to physical monitors
hfutrell@2742
   165
 * attached to the system.
slouken@1895
   166
 */
slouken@2753
   167
struct SDL_VideoDisplay
slouken@2753
   168
{
slouken@2753
   169
    int max_display_modes;
slouken@2753
   170
    int num_display_modes;
slouken@2753
   171
    SDL_DisplayMode *display_modes;
slouken@2753
   172
    SDL_DisplayMode desktop_mode;
slouken@2753
   173
    SDL_DisplayMode current_mode;
slouken@3502
   174
    SDL_bool updating_fullscreen;
slouken@2753
   175
    SDL_Palette *palette;
slouken@1895
   176
slouken@2753
   177
    Uint16 *gamma;
slouken@2753
   178
    Uint16 *saved_gamma;        /* (just offset into gamma) */
slouken@1895
   179
slouken@2753
   180
    int num_render_drivers;
slouken@2753
   181
    SDL_RenderDriver *render_drivers;
slouken@1895
   182
slouken@2753
   183
    int num_windows;
slouken@2753
   184
    SDL_Window *windows;
slouken@3517
   185
    SDL_Window *fullscreen_window;
slouken@1895
   186
slouken@2753
   187
    SDL_Renderer *current_renderer;
slouken@1895
   188
slouken@2753
   189
    SDL_VideoDevice *device;
slouken@1895
   190
slouken@2753
   191
    void *driverdata;
slouken@1895
   192
};
slouken@1895
   193
slouken@0
   194
/* Define the SDL video driver structure */
slouken@0
   195
#define _THIS	SDL_VideoDevice *_this
slouken@0
   196
slouken@2753
   197
struct SDL_VideoDevice
slouken@2753
   198
{
slouken@2753
   199
    /* * * */
slouken@2753
   200
    /* The name of this video driver */
slouken@2753
   201
    const char *name;
slouken@0
   202
slouken@2753
   203
    /* * * */
slouken@2753
   204
    /* Initialization/Query functions */
slouken@0
   205
slouken@2753
   206
    /*
slouken@2753
   207
     * Initialize the native video subsystem, filling in the list of
slouken@2753
   208
     * displays for this driver, returning 0 or -1 if there's an error.
slouken@2753
   209
     */
slouken@2753
   210
    int (*VideoInit) (_THIS);
slouken@0
   211
slouken@2753
   212
    /*
slouken@2753
   213
     * Reverse the effects VideoInit() -- called if VideoInit() fails or
slouken@2753
   214
     * if the application is shutting down the video subsystem.
slouken@2753
   215
     */
slouken@2753
   216
    void (*VideoQuit) (_THIS);
slouken@1913
   217
slouken@2753
   218
    /* * * */
slouken@2753
   219
    /*
slouken@2753
   220
     * Display functions
slouken@2753
   221
     */
slouken@0
   222
slouken@2753
   223
    /*
slouken@3528
   224
     * Get the bounds of a display
slouken@3528
   225
     */
slouken@3528
   226
    int (*GetDisplayBounds) (_THIS, SDL_VideoDisplay * display, SDL_Rect * rect);
slouken@3528
   227
slouken@3528
   228
    /*
slouken@2753
   229
     * Get a list of the available display modes. e.g.
slouken@2753
   230
     * SDL_AddDisplayMode(_this->current_display, mode)
slouken@2753
   231
     */
slouken@3500
   232
    void (*GetDisplayModes) (_THIS, SDL_VideoDisplay * display);
slouken@0
   233
slouken@2753
   234
    /*
slouken@2753
   235
     * Setting the display mode is independent of creating windows, so
slouken@2753
   236
     * when the display mode is changed, all existing windows should have
slouken@2753
   237
     * their data updated accordingly, including the display surfaces
slouken@2753
   238
     * associated with them.
slouken@2753
   239
     */
slouken@3500
   240
    int (*SetDisplayMode) (_THIS, SDL_VideoDisplay * display, SDL_DisplayMode * mode);
slouken@0
   241
slouken@2753
   242
    /* Set the color entries of the display palette */
slouken@3500
   243
    int (*SetDisplayPalette) (_THIS, SDL_VideoDisplay * display, SDL_Palette * palette);
slouken@0
   244
slouken@2753
   245
    /* Get the color entries of the display palette */
slouken@3500
   246
    int (*GetDisplayPalette) (_THIS, SDL_VideoDisplay * display, SDL_Palette * palette);
slouken@0
   247
slouken@2753
   248
    /* Set the gamma ramp */
slouken@3500
   249
    int (*SetDisplayGammaRamp) (_THIS, SDL_VideoDisplay * display, Uint16 * ramp);
slouken@0
   250
slouken@2753
   251
    /* Get the gamma ramp */
slouken@3500
   252
    int (*GetDisplayGammaRamp) (_THIS, SDL_VideoDisplay * display, Uint16 * ramp);
slouken@0
   253
slouken@2753
   254
    /* * * */
slouken@2753
   255
    /*
slouken@2753
   256
     * Window functions
slouken@2753
   257
     */
slouken@2753
   258
    int (*CreateWindow) (_THIS, SDL_Window * window);
slouken@2753
   259
    int (*CreateWindowFrom) (_THIS, SDL_Window * window, const void *data);
slouken@2753
   260
    void (*SetWindowTitle) (_THIS, SDL_Window * window);
slouken@2967
   261
    void (*SetWindowIcon) (_THIS, SDL_Window * window, SDL_Surface * icon);
slouken@2753
   262
    void (*SetWindowPosition) (_THIS, SDL_Window * window);
slouken@2753
   263
    void (*SetWindowSize) (_THIS, SDL_Window * window);
slouken@2753
   264
    void (*ShowWindow) (_THIS, SDL_Window * window);
slouken@2753
   265
    void (*HideWindow) (_THIS, SDL_Window * window);
slouken@2753
   266
    void (*RaiseWindow) (_THIS, SDL_Window * window);
slouken@2753
   267
    void (*MaximizeWindow) (_THIS, SDL_Window * window);
slouken@2753
   268
    void (*MinimizeWindow) (_THIS, SDL_Window * window);
slouken@2753
   269
    void (*RestoreWindow) (_THIS, SDL_Window * window);
slouken@2753
   270
    void (*SetWindowGrab) (_THIS, SDL_Window * window);
slouken@2753
   271
    void (*DestroyWindow) (_THIS, SDL_Window * window);
slouken@0
   272
slouken@2753
   273
    /* Get some platform dependent window information */
slouken@2753
   274
      SDL_bool(*GetWindowWMInfo) (_THIS, SDL_Window * window,
slouken@2753
   275
                                  struct SDL_SysWMinfo * info);
slouken@0
   276
slouken@2753
   277
    /* * * */
slouken@2753
   278
    /*
slouken@2753
   279
     * OpenGL support
slouken@2753
   280
     */
slouken@2753
   281
    int (*GL_LoadLibrary) (_THIS, const char *path);
slouken@2753
   282
    void *(*GL_GetProcAddress) (_THIS, const char *proc);
slouken@3057
   283
    void (*GL_UnloadLibrary) (_THIS);
slouken@2753
   284
      SDL_GLContext(*GL_CreateContext) (_THIS, SDL_Window * window);
slouken@2753
   285
    int (*GL_MakeCurrent) (_THIS, SDL_Window * window, SDL_GLContext context);
slouken@2753
   286
    int (*GL_SetSwapInterval) (_THIS, int interval);
slouken@2753
   287
    int (*GL_GetSwapInterval) (_THIS);
slouken@2753
   288
    void (*GL_SwapWindow) (_THIS, SDL_Window * window);
slouken@2753
   289
    void (*GL_DeleteContext) (_THIS, SDL_GLContext context);
slouken@0
   290
slouken@2753
   291
    /* * * */
slouken@2753
   292
    /*
slouken@2753
   293
     * Event manager functions
slouken@2753
   294
     */
slouken@2753
   295
    void (*PumpEvents) (_THIS);
slouken@0
   296
slouken@3025
   297
    /* Suspend the screensaver */
slouken@3025
   298
    void (*SuspendScreenSaver) (_THIS);
slouken@3025
   299
slouken@3280
   300
    /* Text input */
slouken@3280
   301
    void (*StartTextInput) (_THIS);
slouken@3280
   302
    void (*StopTextInput) (_THIS);
slouken@3280
   303
    void (*SetTextInputRect) (_THIS, SDL_Rect *rect);
slouken@3280
   304
slouken@2753
   305
    /* * * */
slouken@2753
   306
    /* Data common to all drivers */
slouken@3025
   307
    SDL_bool suspend_screensaver;
slouken@2753
   308
    int num_displays;
slouken@2753
   309
    SDL_VideoDisplay *displays;
slouken@2753
   310
    int current_display;
slouken@2753
   311
    Uint32 next_object_id;
slouken@0
   312
slouken@2753
   313
    /* * * */
slouken@2753
   314
    /* Data used by the GL drivers */
slouken@2753
   315
    struct
slouken@2753
   316
    {
slouken@2753
   317
        int red_size;
slouken@2753
   318
        int green_size;
slouken@2753
   319
        int blue_size;
slouken@2753
   320
        int alpha_size;
slouken@2753
   321
        int depth_size;
slouken@2753
   322
        int buffer_size;
slouken@2753
   323
        int stencil_size;
slouken@2753
   324
        int double_buffer;
slouken@2753
   325
        int accum_red_size;
slouken@2753
   326
        int accum_green_size;
slouken@2753
   327
        int accum_blue_size;
slouken@2753
   328
        int accum_alpha_size;
slouken@2753
   329
        int stereo;
slouken@2753
   330
        int multisamplebuffers;
slouken@2753
   331
        int multisamplesamples;
slouken@2753
   332
        int accelerated;
slouken@3100
   333
        int major_version;
slouken@3100
   334
        int minor_version;
slouken@2753
   335
        int retained_backing;
slouken@2753
   336
        int driver_loaded;
slouken@2753
   337
        char driver_path[256];
slouken@2753
   338
        void *dll_handle;
slouken@2753
   339
    } gl_config;
slouken@0
   340
slouken@2753
   341
    /* * * */
slouken@2753
   342
    /* Data private to this driver */
slouken@2753
   343
    void *driverdata;
slouken@2753
   344
    struct SDL_GLDriverData *gl_data;
slouken@0
   345
slouken@3161
   346
#if SDL_VIDEO_DRIVER_PANDORA
slouken@3161
   347
    struct SDL_PrivateGLESData *gles_data;
slouken@3161
   348
#endif
slouken@3161
   349
slouken@2753
   350
    /* * * */
slouken@2753
   351
    /* The function used to dispose of this structure */
slouken@2753
   352
    void (*free) (_THIS);
slouken@1895
   353
};
slouken@0
   354
slouken@2753
   355
typedef struct VideoBootStrap
slouken@2753
   356
{
slouken@2753
   357
    const char *name;
slouken@2753
   358
    const char *desc;
slouken@2753
   359
    int (*available) (void);
slouken@2753
   360
    SDL_VideoDevice *(*create) (int devindex);
slouken@2753
   361
} VideoBootStrap;
slouken@0
   362
slouken@1931
   363
#if SDL_VIDEO_DRIVER_COCOA
slouken@1931
   364
extern VideoBootStrap COCOA_bootstrap;
slouken@1361
   365
#endif
slouken@1361
   366
#if SDL_VIDEO_DRIVER_X11
slouken@0
   367
extern VideoBootStrap X11_bootstrap;
slouken@0
   368
#endif
slouken@1361
   369
#if SDL_VIDEO_DRIVER_FBCON
slouken@0
   370
extern VideoBootStrap FBCON_bootstrap;
slouken@0
   371
#endif
slouken@1361
   372
#if SDL_VIDEO_DRIVER_DIRECTFB
slouken@167
   373
extern VideoBootStrap DirectFB_bootstrap;
slouken@167
   374
#endif
slouken@3257
   375
#if SDL_VIDEO_DRIVER_PS3
slouken@3257
   376
extern VideoBootStrap PS3_bootstrap;
slouken@3257
   377
#endif
slouken@1361
   378
#if SDL_VIDEO_DRIVER_SVGALIB
slouken@0
   379
extern VideoBootStrap SVGALIB_bootstrap;
slouken@0
   380
#endif
slouken@1361
   381
#if SDL_VIDEO_DRIVER_GAPI
slouken@1361
   382
extern VideoBootStrap GAPI_bootstrap;
slouken@1361
   383
#endif
slouken@1895
   384
#if SDL_VIDEO_DRIVER_WIN32
slouken@1895
   385
extern VideoBootStrap WIN32_bootstrap;
slouken@1361
   386
#endif
slouken@1361
   387
#if SDL_VIDEO_DRIVER_BWINDOW
slouken@1361
   388
extern VideoBootStrap BWINDOW_bootstrap;
slouken@1361
   389
#endif
slouken@1361
   390
#if SDL_VIDEO_DRIVER_PHOTON
slouken@3083
   391
extern VideoBootStrap photon_bootstrap;
slouken@3083
   392
#endif
slouken@3083
   393
#if SDL_VIDEO_DRIVER_QNXGF
slouken@3083
   394
extern VideoBootStrap qnxgf_bootstrap;
slouken@1361
   395
#endif
slouken@1361
   396
#if SDL_VIDEO_DRIVER_EPOC
slouken@1361
   397
extern VideoBootStrap EPOC_bootstrap;
slouken@1361
   398
#endif
slouken@1361
   399
#if SDL_VIDEO_DRIVER_RISCOS
slouken@1361
   400
extern VideoBootStrap RISCOS_bootstrap;
slouken@1361
   401
#endif
hfutrell@2742
   402
#if SDL_VIDEO_DRIVER_UIKIT
hfutrell@2742
   403
extern VideoBootStrap UIKIT_bootstrap;
hfutrell@2742
   404
#endif
slouken@1361
   405
#if SDL_VIDEO_DRIVER_DUMMY
slouken@173
   406
extern VideoBootStrap DUMMY_bootstrap;
slouken@173
   407
#endif
slouken@2735
   408
#if SDL_VIDEO_DRIVER_NDS
slouken@2735
   409
extern VideoBootStrap NDS_bootstrap;
slouken@2735
   410
#endif
slouken@3161
   411
#if SDL_VIDEO_DRIVER_PANDORA
slouken@3161
   412
extern VideoBootStrap PND_bootstrap;
slouken@3161
   413
#endif
slouken@1361
   414
slouken@3685
   415
#define SDL_CurrentDisplay	(&_this->displays[_this->current_display])
slouken@3685
   416
#define SDL_CurrentRenderer	(SDL_CurrentDisplay->current_renderer)
slouken@0
   417
slouken@1895
   418
extern SDL_VideoDevice *SDL_GetVideoDevice();
slouken@2753
   419
extern int SDL_AddBasicVideoDisplay(const SDL_DisplayMode * desktop_mode);
slouken@2753
   420
extern int SDL_AddVideoDisplay(const SDL_VideoDisplay * display);
slouken@3500
   421
extern SDL_bool SDL_AddDisplayMode(SDL_VideoDisplay *display, const SDL_DisplayMode * mode);
slouken@3500
   422
extern int SDL_GetNumDisplayModesForDisplay(SDL_VideoDisplay * display);
slouken@3500
   423
extern int SDL_GetDisplayModeForDisplay(SDL_VideoDisplay * display, int index, SDL_DisplayMode * mode);
slouken@3500
   424
extern int SDL_GetDesktopDisplayModeForDisplay(SDL_VideoDisplay * display, SDL_DisplayMode * mode);
slouken@3500
   425
extern int SDL_GetCurrentDisplayModeForDisplay(SDL_VideoDisplay * display, SDL_DisplayMode * mode);
slouken@3500
   426
extern SDL_DisplayMode * SDL_GetClosestDisplayModeForDisplay(SDL_VideoDisplay * display, const SDL_DisplayMode * mode, SDL_DisplayMode * closest);
slouken@3500
   427
extern int SDL_SetDisplayModeForDisplay(SDL_VideoDisplay * display, const SDL_DisplayMode * mode);
slouken@3501
   428
extern int SDL_SetPaletteForDisplay(SDL_VideoDisplay * display, const SDL_Color * colors, int firstcolor, int ncolors);
slouken@3501
   429
extern int SDL_GetPaletteForDisplay(SDL_VideoDisplay * display, SDL_Color * colors, int firstcolor, int ncolors);
slouken@3500
   430
extern int SDL_SetGammaRampForDisplay(SDL_VideoDisplay * display, const Uint16 * red, const Uint16 * green, const Uint16 * blue);
slouken@3500
   431
extern int SDL_GetGammaRampForDisplay(SDL_VideoDisplay * display, Uint16 * red, Uint16 * green, Uint16 * blue);
slouken@3501
   432
extern void SDL_AddRenderDriver(SDL_VideoDisplay *display, const SDL_RenderDriver * driver);
slouken@1895
   433
slouken@2753
   434
extern int SDL_RecreateWindow(SDL_Window * window, Uint32 flags);
slouken@1895
   435
slouken@2753
   436
extern void SDL_OnWindowShown(SDL_Window * window);
slouken@2753
   437
extern void SDL_OnWindowHidden(SDL_Window * window);
slouken@2753
   438
extern void SDL_OnWindowResized(SDL_Window * window);
slouken@3502
   439
extern void SDL_OnWindowMinimized(SDL_Window * window);
slouken@3502
   440
extern void SDL_OnWindowRestored(SDL_Window * window);
slouken@2753
   441
extern void SDL_OnWindowFocusGained(SDL_Window * window);
slouken@2753
   442
extern void SDL_OnWindowFocusLost(SDL_Window * window);
slouken@3685
   443
extern SDL_Window * SDL_GetFocusWindow(void);
slouken@0
   444
slouken@2753
   445
#endif /* _SDL_sysvideo_h */
slouken@1895
   446
slouken@1895
   447
/* vi: set ts=4 sw=4 expandtab: */