src/video/windows/SDL_windowswindow.c
author Sam Lantinga <slouken@libsdl.org>
Sat, 02 Jan 2016 10:10:34 -0800
changeset 9998 f67cf37e9cd4
parent 9990 c8fd9b498b67
child 10025 bf4f8cde1c54
permissions -rw-r--r--
Updated copyright to 2016
slouken@1895
     1
/*
slouken@5535
     2
  Simple DirectMedia Layer
slouken@9998
     3
  Copyright (C) 1997-2016 Sam Lantinga <slouken@libsdl.org>
slouken@1895
     4
slouken@5535
     5
  This software is provided 'as-is', without any express or implied
slouken@5535
     6
  warranty.  In no event will the authors be held liable for any damages
slouken@5535
     7
  arising from the use of this software.
slouken@1895
     8
slouken@5535
     9
  Permission is granted to anyone to use this software for any purpose,
slouken@5535
    10
  including commercial applications, and to alter it and redistribute it
slouken@5535
    11
  freely, subject to the following restrictions:
slouken@1895
    12
slouken@5535
    13
  1. The origin of this software must not be misrepresented; you must not
slouken@5535
    14
     claim that you wrote the original software. If you use this software
slouken@5535
    15
     in a product, an acknowledgment in the product documentation would be
slouken@5535
    16
     appreciated but is not required.
slouken@5535
    17
  2. Altered source versions must be plainly marked as such, and must not be
slouken@5535
    18
     misrepresented as being the original software.
slouken@5535
    19
  3. This notice may not be removed or altered from any source distribution.
slouken@1895
    20
*/
icculus@8093
    21
#include "../../SDL_internal.h"
slouken@1895
    22
slouken@6044
    23
#if SDL_VIDEO_DRIVER_WINDOWS
slouken@6044
    24
slouken@7828
    25
#include "../../core/windows/SDL_windows.h"
slouken@7828
    26
slouken@7523
    27
#include "SDL_assert.h"
slouken@1895
    28
#include "../SDL_sysvideo.h"
slouken@2970
    29
#include "../SDL_pixels_c.h"
slouken@1895
    30
#include "../../events/SDL_keyboard_c.h"
slouken@8072
    31
#include "../../events/SDL_mouse_c.h"
slouken@1895
    32
slouken@5062
    33
#include "SDL_windowsvideo.h"
slouken@5062
    34
#include "SDL_windowswindow.h"
slouken@8144
    35
#include "SDL_hints.h"
slouken@1895
    36
slouken@6523
    37
/* Dropfile support */
slouken@6523
    38
#include <shellapi.h>
slouken@6523
    39
slouken@5062
    40
/* This is included after SDL_windowsvideo.h, which includes windows.h */
slouken@1895
    41
#include "SDL_syswm.h"
slouken@1895
    42
slouken@5086
    43
/* Windows CE compatibility */
slouken@5086
    44
#ifndef SWP_NOCOPYBITS
slouken@5086
    45
#define SWP_NOCOPYBITS 0
slouken@5086
    46
#endif
slouken@3168
    47
slouken@2713
    48
/* Fake window to help with DirectInput events. */
slouken@2713
    49
HWND SDL_HelperWindow = NULL;
slouken@2714
    50
static WCHAR *SDL_HelperWindowClassName = TEXT("SDLHelperWindowInputCatcher");
slouken@2714
    51
static WCHAR *SDL_HelperWindowName = TEXT("SDLHelperWindowInputMsgWindow");
slouken@2713
    52
static ATOM SDL_HelperWindowClass = 0;
slouken@2713
    53
slouken@5305
    54
#define STYLE_BASIC         (WS_CLIPSIBLINGS | WS_CLIPCHILDREN)
slouken@5305
    55
#define STYLE_FULLSCREEN    (WS_POPUP)
slouken@5305
    56
#define STYLE_BORDERLESS    (WS_POPUP)
slouken@5305
    57
#define STYLE_NORMAL        (WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX)
slouken@5305
    58
#define STYLE_RESIZABLE     (WS_THICKFRAME | WS_MAXIMIZEBOX)
slouken@5305
    59
#define STYLE_MASK          (STYLE_FULLSCREEN | STYLE_BORDERLESS | STYLE_NORMAL | STYLE_RESIZABLE)
slouken@5305
    60
slouken@5305
    61
static DWORD
slouken@5305
    62
GetWindowStyle(SDL_Window * window)
slouken@5305
    63
{
slouken@5305
    64
    DWORD style = 0;
slouken@5305
    65
slouken@6078
    66
    if (window->flags & SDL_WINDOW_FULLSCREEN) {
slouken@5305
    67
        style |= STYLE_FULLSCREEN;
slouken@6078
    68
    } else {
slouken@6078
    69
        if (window->flags & SDL_WINDOW_BORDERLESS) {
slouken@5305
    70
            style |= STYLE_BORDERLESS;
slouken@6078
    71
        } else {
slouken@5305
    72
            style |= STYLE_NORMAL;
slouken@6078
    73
        }
slouken@6078
    74
        if (window->flags & SDL_WINDOW_RESIZABLE) {
slouken@5305
    75
            style |= STYLE_RESIZABLE;
slouken@6078
    76
        }
slouken@6078
    77
    }
slouken@5305
    78
    return style;
slouken@5305
    79
}
slouken@5305
    80
slouken@7585
    81
static void
slouken@7585
    82
WIN_SetWindowPositionInternal(_THIS, SDL_Window * window, UINT flags)
slouken@7585
    83
{
slouken@7941
    84
    SDL_WindowData *data = (SDL_WindowData *)window->driverdata;
slouken@7941
    85
    HWND hwnd = data->hwnd;
slouken@7585
    86
    RECT rect;
slouken@7585
    87
    DWORD style;
slouken@7585
    88
    HWND top;
slouken@7585
    89
    BOOL menu;
slouken@7585
    90
    int x, y;
slouken@7585
    91
    int w, h;
slouken@7585
    92
slouken@7585
    93
    /* Figure out what the window area will be */
slouken@7585
    94
    if (SDL_ShouldAllowTopmost() && (window->flags & (SDL_WINDOW_FULLSCREEN|SDL_WINDOW_INPUT_FOCUS)) == (SDL_WINDOW_FULLSCREEN|SDL_WINDOW_INPUT_FOCUS)) {
slouken@7585
    95
        top = HWND_TOPMOST;
slouken@7585
    96
    } else {
slouken@7585
    97
        top = HWND_NOTOPMOST;
slouken@7585
    98
    }
slouken@7585
    99
    style = GetWindowLong(hwnd, GWL_STYLE);
slouken@7585
   100
    rect.left = 0;
slouken@7585
   101
    rect.top = 0;
slouken@7585
   102
    rect.right = window->w;
slouken@7585
   103
    rect.bottom = window->h;
slouken@7585
   104
    menu = (style & WS_CHILDWINDOW) ? FALSE : (GetMenu(hwnd) != NULL);
slouken@7585
   105
    AdjustWindowRectEx(&rect, style, menu, 0);
slouken@7585
   106
    w = (rect.right - rect.left);
slouken@7585
   107
    h = (rect.bottom - rect.top);
slouken@7585
   108
    x = window->x + rect.left;
slouken@7585
   109
    y = window->y + rect.top;
slouken@7585
   110
slouken@8817
   111
    data->expected_resize = SDL_TRUE;
slouken@9886
   112
    SetWindowPos(hwnd, top, x, y, w, h, flags);
slouken@8817
   113
    data->expected_resize = SDL_FALSE;
slouken@7585
   114
}
slouken@7585
   115
slouken@1895
   116
static int
slouken@1951
   117
SetupWindowData(_THIS, SDL_Window * window, HWND hwnd, SDL_bool created)
slouken@1895
   118
{
slouken@1951
   119
    SDL_VideoData *videodata = (SDL_VideoData *) _this->driverdata;
slouken@1895
   120
    SDL_WindowData *data;
slouken@1895
   121
slouken@1895
   122
    /* Allocate the window data */
slouken@7775
   123
    data = (SDL_WindowData *) SDL_calloc(1, sizeof(*data));
slouken@1895
   124
    if (!data) {
icculus@7037
   125
        return SDL_OutOfMemory();
slouken@1895
   126
    }
slouken@3685
   127
    data->window = window;
slouken@1895
   128
    data->hwnd = hwnd;
slouken@1913
   129
    data->hdc = GetDC(hwnd);
slouken@1895
   130
    data->created = created;
slouken@6943
   131
    data->mouse_button_flags = 0;
slouken@1951
   132
    data->videodata = videodata;
slouken@9889
   133
    data->initializing = SDL_TRUE;
slouken@1895
   134
icculus@5980
   135
    window->driverdata = data;
icculus@5980
   136
slouken@1895
   137
    /* Associate the data with the window */
slouken@1895
   138
    if (!SetProp(hwnd, TEXT("SDL_WindowData"), data)) {
slouken@1913
   139
        ReleaseDC(hwnd, data->hdc);
slouken@1895
   140
        SDL_free(data);
icculus@7037
   141
        return WIN_SetError("SetProp() failed");
slouken@1895
   142
    }
slouken@1895
   143
slouken@1895
   144
    /* Set up the window proc function */
slouken@5086
   145
#ifdef GWLP_WNDPROC
slouken@1895
   146
    data->wndproc = (WNDPROC) GetWindowLongPtr(hwnd, GWLP_WNDPROC);
dewyatt@4733
   147
    if (data->wndproc == WIN_WindowProc) {
slouken@3566
   148
        data->wndproc = NULL;
slouken@5086
   149
    } else {
dewyatt@4735
   150
        SetWindowLongPtr(hwnd, GWLP_WNDPROC, (LONG_PTR) WIN_WindowProc);
dewyatt@4735
   151
    }
slouken@5086
   152
#else
slouken@5086
   153
    data->wndproc = (WNDPROC) GetWindowLong(hwnd, GWL_WNDPROC);
slouken@5086
   154
    if (data->wndproc == WIN_WindowProc) {
slouken@5086
   155
        data->wndproc = NULL;
slouken@5086
   156
    } else {
slouken@5086
   157
        SetWindowLong(hwnd, GWL_WNDPROC, (LONG_PTR) WIN_WindowProc);
slouken@5086
   158
    }
slouken@5086
   159
#endif
slouken@1895
   160
slouken@1895
   161
    /* Fill in the SDL window with the window data */
slouken@1895
   162
    {
slouken@7585
   163
        RECT rect;
slouken@7585
   164
        if (GetClientRect(hwnd, &rect)) {
slouken@7585
   165
            int w = rect.right;
slouken@7585
   166
            int h = rect.bottom;
slouken@7585
   167
            if ((window->w && window->w != w) || (window->h && window->h != h)) {
gabomdq@7663
   168
                /* We tried to create a window larger than the desktop and Windows didn't allow it.  Override! */
slouken@9886
   169
                RECT rect;
slouken@9886
   170
                DWORD style;
slouken@9886
   171
                BOOL menu;
slouken@9886
   172
                int x, y;
slouken@9886
   173
                int w, h;
slouken@9886
   174
slouken@9886
   175
                /* Figure out what the window area will be */
slouken@9886
   176
                style = GetWindowLong(hwnd, GWL_STYLE);
slouken@9886
   177
                rect.left = 0;
slouken@9886
   178
                rect.top = 0;
slouken@9886
   179
                rect.right = window->w;
slouken@9886
   180
                rect.bottom = window->h;
slouken@9886
   181
                menu = (style & WS_CHILDWINDOW) ? FALSE : (GetMenu(hwnd) != NULL);
slouken@9886
   182
                AdjustWindowRectEx(&rect, style, menu, 0);
slouken@9886
   183
                w = (rect.right - rect.left);
slouken@9886
   184
                h = (rect.bottom - rect.top);
slouken@9886
   185
                x = window->x + rect.left;
slouken@9886
   186
                y = window->y + rect.top;
slouken@9886
   187
slouken@9886
   188
                SetWindowPos(hwnd, HWND_NOTOPMOST, x, y, w, h, SWP_NOCOPYBITS | SWP_NOZORDER | SWP_NOACTIVATE);
slouken@7585
   189
            } else {
slouken@7585
   190
                window->w = w;
slouken@7585
   191
                window->h = h;
slouken@7585
   192
            }
slouken@7585
   193
        }
slouken@7585
   194
    }
slouken@7585
   195
    {
slouken@1895
   196
        POINT point;
slouken@1895
   197
        point.x = 0;
slouken@1895
   198
        point.y = 0;
slouken@1895
   199
        if (ClientToScreen(hwnd, &point)) {
slouken@5246
   200
            window->x = point.x;
slouken@5246
   201
            window->y = point.y;
slouken@1895
   202
        }
slouken@1895
   203
    }
slouken@1895
   204
    {
slouken@1895
   205
        DWORD style = GetWindowLong(hwnd, GWL_STYLE);
slouken@1895
   206
        if (style & WS_VISIBLE) {
slouken@1895
   207
            window->flags |= SDL_WINDOW_SHOWN;
slouken@1895
   208
        } else {
slouken@1895
   209
            window->flags &= ~SDL_WINDOW_SHOWN;
slouken@1895
   210
        }
slouken@1895
   211
        if (style & (WS_BORDER | WS_THICKFRAME)) {
slouken@1895
   212
            window->flags &= ~SDL_WINDOW_BORDERLESS;
slouken@1895
   213
        } else {
slouken@1895
   214
            window->flags |= SDL_WINDOW_BORDERLESS;
slouken@1895
   215
        }
slouken@1895
   216
        if (style & WS_THICKFRAME) {
slouken@1895
   217
            window->flags |= SDL_WINDOW_RESIZABLE;
slouken@1895
   218
        } else {
slouken@1895
   219
            window->flags &= ~SDL_WINDOW_RESIZABLE;
slouken@1895
   220
        }
slouken@5086
   221
#ifdef WS_MAXIMIZE
slouken@1895
   222
        if (style & WS_MAXIMIZE) {
slouken@1895
   223
            window->flags |= SDL_WINDOW_MAXIMIZED;
slouken@5086
   224
        } else
slouken@5086
   225
#endif
slouken@5086
   226
        {
slouken@1895
   227
            window->flags &= ~SDL_WINDOW_MAXIMIZED;
slouken@1895
   228
        }
slouken@5086
   229
#ifdef WS_MINIMIZE
slouken@1895
   230
        if (style & WS_MINIMIZE) {
slouken@1895
   231
            window->flags |= SDL_WINDOW_MINIMIZED;
slouken@5086
   232
        } else
slouken@5086
   233
#endif
slouken@5086
   234
        {
slouken@1895
   235
            window->flags &= ~SDL_WINDOW_MINIMIZED;
slouken@1895
   236
        }
slouken@1895
   237
    }
slouken@1895
   238
    if (GetFocus() == hwnd) {
slouken@1895
   239
        window->flags |= SDL_WINDOW_INPUT_FOCUS;
slouken@4465
   240
        SDL_SetKeyboardFocus(data->window);
slouken@1895
   241
slouken@1895
   242
        if (window->flags & SDL_WINDOW_INPUT_GRABBED) {
slouken@1895
   243
            RECT rect;
slouken@1895
   244
            GetClientRect(hwnd, &rect);
slouken@1895
   245
            ClientToScreen(hwnd, (LPPOINT) & rect);
slouken@1895
   246
            ClientToScreen(hwnd, (LPPOINT) & rect + 1);
slouken@1895
   247
            ClipCursor(&rect);
slouken@1895
   248
        }
slouken@1895
   249
    }
slouken@1895
   250
slouken@6078
   251
    /* Enable multi-touch */
slouken@4948
   252
    if (videodata->RegisterTouchWindow) {
slouken@4948
   253
        videodata->RegisterTouchWindow(hwnd, (TWF_FINETOUCH|TWF_WANTPALM));
slouken@4948
   254
    }
slouken@4919
   255
slouken@6523
   256
    /* Enable dropping files */
slouken@6523
   257
    DragAcceptFiles(hwnd, TRUE);
slouken@6523
   258
slouken@9889
   259
    data->initializing = SDL_FALSE;
slouken@9888
   260
slouken@1895
   261
    /* All done! */
slouken@1895
   262
    return 0;
slouken@1895
   263
}
slouken@1895
   264
slouken@1895
   265
int
slouken@1895
   266
WIN_CreateWindow(_THIS, SDL_Window * window)
slouken@1895
   267
{
slouken@1895
   268
    HWND hwnd;
slouken@1895
   269
    RECT rect;
slouken@5305
   270
    DWORD style = STYLE_BASIC;
slouken@1895
   271
    int x, y;
slouken@1895
   272
    int w, h;
slouken@7191
   273
slouken@5305
   274
    style |= GetWindowStyle(window);
slouken@1895
   275
slouken@1895
   276
    /* Figure out what the window area will be */
slouken@5382
   277
    rect.left = window->x;
slouken@5382
   278
    rect.top = window->y;
slouken@5382
   279
    rect.right = window->x + window->w;
slouken@5382
   280
    rect.bottom = window->y + window->h;
slouken@1895
   281
    AdjustWindowRectEx(&rect, style, FALSE, 0);
slouken@5382
   282
    x = rect.left;
slouken@5382
   283
    y = rect.top;
slouken@1895
   284
    w = (rect.right - rect.left);
slouken@1895
   285
    h = (rect.bottom - rect.top);
slouken@1895
   286
slouken@1956
   287
    hwnd =
slouken@1956
   288
        CreateWindow(SDL_Appname, TEXT(""), style, x, y, w, h, NULL, NULL,
slouken@1956
   289
                     SDL_Instance, NULL);
slouken@1895
   290
    if (!hwnd) {
icculus@7037
   291
        return WIN_SetError("Couldn't create window");
slouken@1895
   292
    }
slouken@1895
   293
slouken@2710
   294
    WIN_PumpEvents(_this);
slouken@2710
   295
slouken@1951
   296
    if (SetupWindowData(_this, window, hwnd, SDL_TRUE) < 0) {
slouken@1895
   297
        DestroyWindow(hwnd);
slouken@1895
   298
        return -1;
slouken@1895
   299
    }
gabomdq@8021
   300
gabomdq@8021
   301
#if SDL_VIDEO_OPENGL_WGL
gabomdq@8021
   302
    /* We need to initialize the extensions before deciding how to create ES profiles */
gabomdq@8021
   303
    if (window->flags & SDL_WINDOW_OPENGL) {
gabomdq@8021
   304
        WIN_GL_InitExtensions(_this);
gabomdq@8021
   305
    }
gabomdq@8021
   306
#endif
gabomdq@8021
   307
gabomdq@8021
   308
#if SDL_VIDEO_OPENGL_ES2
gabomdq@8021
   309
    if ((window->flags & SDL_WINDOW_OPENGL) &&
gabomdq@8021
   310
        _this->gl_config.profile_mask == SDL_GL_CONTEXT_PROFILE_ES
gabomdq@8021
   311
#if SDL_VIDEO_OPENGL_WGL           
gabomdq@8021
   312
        && (!_this->gl_data || !_this->gl_data->HAS_WGL_EXT_create_context_es2_profile)
gabomdq@8021
   313
#endif  
gabomdq@8021
   314
        ) {
gabomdq@8021
   315
#if SDL_VIDEO_OPENGL_EGL  
gabomdq@8021
   316
        if (WIN_GLES_SetupWindow(_this, window) < 0) {
gabomdq@8021
   317
            WIN_DestroyWindow(_this, window);
gabomdq@8021
   318
            return -1;
gabomdq@8021
   319
        }
gabomdq@8021
   320
#else
gabomdq@8021
   321
        return SDL_SetError("Could not create GLES window surface (no EGL support available)");
gabomdq@8021
   322
#endif /* SDL_VIDEO_OPENGL_EGL */
gabomdq@8021
   323
    } else 
gabomdq@8021
   324
#endif /* SDL_VIDEO_OPENGL_ES2 */
gabomdq@8021
   325
slouken@5088
   326
#if SDL_VIDEO_OPENGL_WGL
slouken@1913
   327
    if (window->flags & SDL_WINDOW_OPENGL) {
slouken@1913
   328
        if (WIN_GL_SetupWindow(_this, window) < 0) {
slouken@1913
   329
            WIN_DestroyWindow(_this, window);
slouken@1913
   330
            return -1;
slouken@1913
   331
        }
slouken@1913
   332
    }
slouken@1913
   333
#endif
gabomdq@8021
   334
slouken@1895
   335
    return 0;
slouken@1895
   336
}
slouken@1895
   337
slouken@1895
   338
int
slouken@1895
   339
WIN_CreateWindowFrom(_THIS, SDL_Window * window, const void *data)
slouken@1895
   340
{
slouken@1895
   341
    HWND hwnd = (HWND) data;
slouken@1895
   342
    LPTSTR title;
slouken@1895
   343
    int titleLen;
slouken@1895
   344
slouken@1895
   345
    /* Query the title from the existing window */
slouken@1895
   346
    titleLen = GetWindowTextLength(hwnd);
slouken@1895
   347
    title = SDL_stack_alloc(TCHAR, titleLen + 1);
slouken@1895
   348
    if (title) {
slouken@1895
   349
        titleLen = GetWindowText(hwnd, title, titleLen);
slouken@1895
   350
    } else {
slouken@1895
   351
        titleLen = 0;
slouken@1895
   352
    }
slouken@1895
   353
    if (titleLen > 0) {
slouken@1895
   354
        window->title = WIN_StringToUTF8(title);
slouken@1895
   355
    }
slouken@1895
   356
    if (title) {
slouken@1895
   357
        SDL_stack_free(title);
slouken@1895
   358
    }
slouken@1895
   359
slouken@1951
   360
    if (SetupWindowData(_this, window, hwnd, SDL_FALSE) < 0) {
slouken@1895
   361
        return -1;
slouken@1895
   362
    }
slouken@8144
   363
slouken@8144
   364
#if SDL_VIDEO_OPENGL_WGL
slouken@8144
   365
    {
slouken@8144
   366
        const char *hint = SDL_GetHint(SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT);
slouken@8144
   367
        if (hint) {
philipp@8778
   368
            /* This hint is a pointer (in string form) of the address of
philipp@8778
   369
               the window to share a pixel format with
philipp@8778
   370
            */
slouken@8144
   371
            SDL_Window *otherWindow = NULL;
slouken@8144
   372
            SDL_sscanf(hint, "%p", (void**)&otherWindow);
slouken@8144
   373
philipp@8778
   374
            /* Do some error checking on the pointer */
slouken@8144
   375
            if (otherWindow != NULL && otherWindow->magic == &_this->window_magic)
slouken@8144
   376
            {
philipp@8778
   377
                /* If the otherWindow has SDL_WINDOW_OPENGL set, set it for the new window as well */
slouken@8144
   378
                if (otherWindow->flags & SDL_WINDOW_OPENGL)
slouken@8144
   379
                {
slouken@8144
   380
                    window->flags |= SDL_WINDOW_OPENGL;
slouken@8144
   381
                    if(!WIN_GL_SetPixelFormatFrom(_this, otherWindow, window)) {
slouken@8144
   382
                        return -1;
slouken@8144
   383
                    }
slouken@8144
   384
                }
slouken@8144
   385
            }
slouken@8144
   386
        }
slouken@8144
   387
    }
slouken@8144
   388
#endif
slouken@1895
   389
    return 0;
slouken@1895
   390
}
slouken@1895
   391
slouken@1895
   392
void
slouken@1895
   393
WIN_SetWindowTitle(_THIS, SDL_Window * window)
slouken@1895
   394
{
slouken@1895
   395
    HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
icculus@9474
   396
    LPTSTR title = WIN_UTF8ToString(window->title);
icculus@9474
   397
    SetWindowText(hwnd, title);
slouken@7719
   398
    SDL_free(title);
slouken@1895
   399
}
slouken@1895
   400
slouken@1895
   401
void
slouken@2970
   402
WIN_SetWindowIcon(_THIS, SDL_Window * window, SDL_Surface * icon)
slouken@2970
   403
{
slouken@2970
   404
    HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
slouken@2970
   405
    HICON hicon = NULL;
slouken@5418
   406
    BYTE *icon_bmp;
slouken@7527
   407
    int icon_len, y;
slouken@5418
   408
    SDL_RWops *dst;
slouken@2970
   409
slouken@5418
   410
    /* Create temporary bitmap buffer */
slouken@5418
   411
    icon_len = 40 + icon->h * icon->w * 4;
slouken@5418
   412
    icon_bmp = SDL_stack_alloc(BYTE, icon_len);
slouken@5418
   413
    dst = SDL_RWFromMem(icon_bmp, icon_len);
slouken@5418
   414
    if (!dst) {
slouken@5418
   415
        SDL_stack_free(icon_bmp);
slouken@5418
   416
        return;
slouken@5418
   417
    }
slouken@2970
   418
slouken@5418
   419
    /* Write the BITMAPINFO header */
slouken@5418
   420
    SDL_WriteLE32(dst, 40);
slouken@5418
   421
    SDL_WriteLE32(dst, icon->w);
slouken@5418
   422
    SDL_WriteLE32(dst, icon->h * 2);
slouken@5418
   423
    SDL_WriteLE16(dst, 1);
slouken@5418
   424
    SDL_WriteLE16(dst, 32);
slouken@5418
   425
    SDL_WriteLE32(dst, BI_RGB);
slouken@5418
   426
    SDL_WriteLE32(dst, icon->h * icon->w * 4);
slouken@5418
   427
    SDL_WriteLE32(dst, 0);
slouken@5418
   428
    SDL_WriteLE32(dst, 0);
slouken@5418
   429
    SDL_WriteLE32(dst, 0);
slouken@5418
   430
    SDL_WriteLE32(dst, 0);
slouken@5418
   431
slouken@7523
   432
    /* Write the pixels upside down into the bitmap buffer */
slouken@7523
   433
    SDL_assert(icon->format->format == SDL_PIXELFORMAT_ARGB8888);
slouken@7527
   434
    y = icon->h;
slouken@7523
   435
    while (y--) {
slouken@7523
   436
        Uint8 *src = (Uint8 *) icon->pixels + y * icon->pitch;
slouken@7523
   437
        SDL_RWwrite(dst, src, icon->pitch, 1);
slouken@7523
   438
    }
slouken@2970
   439
slouken@7523
   440
    hicon = CreateIconFromResource(icon_bmp, icon_len, TRUE, 0x00030000);
slouken@7523
   441
slouken@5418
   442
    SDL_RWclose(dst);
slouken@5418
   443
    SDL_stack_free(icon_bmp);
slouken@2970
   444
slouken@2971
   445
    /* Set the icon for the window */
slouken@2990
   446
    SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LPARAM) hicon);
slouken@2971
   447
slouken@2971
   448
    /* Set the icon in the task manager (should we do this?) */
slouken@2990
   449
    SendMessage(hwnd, WM_SETICON, ICON_BIG, (LPARAM) hicon);
slouken@2970
   450
}
slouken@2970
   451
icculus@6427
   452
void
icculus@6427
   453
WIN_SetWindowPosition(_THIS, SDL_Window * window)
icculus@6427
   454
{
slouken@6535
   455
    WIN_SetWindowPositionInternal(_this, window, SWP_NOCOPYBITS | SWP_NOSIZE | SWP_NOACTIVATE);
slouken@1895
   456
}
slouken@1895
   457
slouken@1895
   458
void
slouken@1895
   459
WIN_SetWindowSize(_THIS, SDL_Window * window)
slouken@1895
   460
{
slouken@6535
   461
    WIN_SetWindowPositionInternal(_this, window, SWP_NOCOPYBITS | SWP_NOMOVE | SWP_NOACTIVATE);
slouken@5246
   462
}
slouken@5178
   463
slouken@1895
   464
void
slouken@1895
   465
WIN_ShowWindow(_THIS, SDL_Window * window)
slouken@1895
   466
{
slouken@1895
   467
    HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
slouken@1895
   468
    ShowWindow(hwnd, SW_SHOW);
slouken@1895
   469
}
slouken@1895
   470
slouken@1895
   471
void
slouken@1895
   472
WIN_HideWindow(_THIS, SDL_Window * window)
slouken@1895
   473
{
slouken@1895
   474
    HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
slouken@1895
   475
    ShowWindow(hwnd, SW_HIDE);
slouken@1895
   476
}
slouken@1895
   477
slouken@1895
   478
void
slouken@1895
   479
WIN_RaiseWindow(_THIS, SDL_Window * window)
slouken@1895
   480
{
slouken@7585
   481
    WIN_SetWindowPositionInternal(_this, window, SWP_NOCOPYBITS | SWP_NOMOVE | SWP_NOSIZE);
slouken@1895
   482
}
slouken@1895
   483
slouken@1895
   484
void
slouken@1895
   485
WIN_MaximizeWindow(_THIS, SDL_Window * window)
slouken@1895
   486
{
slouken@7941
   487
    SDL_WindowData *data = (SDL_WindowData *)window->driverdata;
slouken@7941
   488
    HWND hwnd = data->hwnd;
slouken@8817
   489
    data->expected_resize = SDL_TRUE;
slouken@1895
   490
    ShowWindow(hwnd, SW_MAXIMIZE);
slouken@8817
   491
    data->expected_resize = SDL_FALSE;
slouken@1895
   492
}
slouken@1895
   493
slouken@1895
   494
void
slouken@1895
   495
WIN_MinimizeWindow(_THIS, SDL_Window * window)
slouken@1895
   496
{
slouken@1895
   497
    HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
slouken@1895
   498
    ShowWindow(hwnd, SW_MINIMIZE);
slouken@1895
   499
}
slouken@1895
   500
slouken@1895
   501
void
icculus@6422
   502
WIN_SetWindowBordered(_THIS, SDL_Window * window, SDL_bool bordered)
icculus@6422
   503
{
slouken@8817
   504
    SDL_WindowData *data = (SDL_WindowData *)window->driverdata;
slouken@8817
   505
    HWND hwnd = data->hwnd;
icculus@6428
   506
    DWORD style = GetWindowLong(hwnd, GWL_STYLE);
icculus@6428
   507
icculus@6428
   508
    if (bordered) {
icculus@6428
   509
        style &= ~STYLE_BORDERLESS;
icculus@6428
   510
        style |= STYLE_NORMAL;
icculus@6428
   511
    } else {
icculus@6428
   512
        style &= ~STYLE_NORMAL;
icculus@6428
   513
        style |= STYLE_BORDERLESS;
icculus@6428
   514
    }
icculus@6428
   515
slouken@8817
   516
    data->in_border_change = SDL_TRUE;
slouken@9886
   517
    SetWindowLong(hwnd, GWL_STYLE, style);
slouken@8817
   518
    WIN_SetWindowPositionInternal(_this, window, SWP_NOCOPYBITS | SWP_FRAMECHANGED | SWP_NOZORDER | SWP_NOACTIVATE);
slouken@8817
   519
    data->in_border_change = SDL_FALSE;
icculus@6422
   520
}
icculus@6422
   521
icculus@6422
   522
void
slouken@1895
   523
WIN_RestoreWindow(_THIS, SDL_Window * window)
slouken@1895
   524
{
slouken@7941
   525
    SDL_WindowData *data = (SDL_WindowData *)window->driverdata;
slouken@7941
   526
    HWND hwnd = data->hwnd;
slouken@8817
   527
    data->expected_resize = SDL_TRUE;
slouken@1895
   528
    ShowWindow(hwnd, SW_RESTORE);
slouken@8817
   529
    data->expected_resize = SDL_FALSE;
slouken@1895
   530
}
slouken@1895
   531
slouken@1895
   532
void
slouken@5305
   533
WIN_SetWindowFullscreen(_THIS, SDL_Window * window, SDL_VideoDisplay * display, SDL_bool fullscreen)
slouken@5305
   534
{
slouken@5305
   535
    SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
slouken@5305
   536
    HWND hwnd = data->hwnd;
slouken@5305
   537
    RECT rect;
slouken@5305
   538
    SDL_Rect bounds;
slouken@5305
   539
    DWORD style;
slouken@5305
   540
    HWND top;
slouken@5305
   541
    BOOL menu;
slouken@5305
   542
    int x, y;
slouken@5305
   543
    int w, h;
slouken@5305
   544
slouken@7585
   545
    if (SDL_ShouldAllowTopmost() && (window->flags & (SDL_WINDOW_FULLSCREEN|SDL_WINDOW_INPUT_FOCUS)) == (SDL_WINDOW_FULLSCREEN|SDL_WINDOW_INPUT_FOCUS)) {
slouken@7191
   546
        top = HWND_TOPMOST;
slouken@7191
   547
    } else {
slouken@7191
   548
        top = HWND_NOTOPMOST;
slouken@7191
   549
    }
slouken@6782
   550
slouken@5305
   551
    style = GetWindowLong(hwnd, GWL_STYLE);
slouken@5305
   552
    style &= ~STYLE_MASK;
slouken@5305
   553
    style |= GetWindowStyle(window);
slouken@5305
   554
slouken@5305
   555
    WIN_GetDisplayBounds(_this, display, &bounds);
slouken@5305
   556
slouken@5305
   557
    if (fullscreen) {
slouken@5305
   558
        x = bounds.x;
slouken@5305
   559
        y = bounds.y;
slouken@5305
   560
        w = bounds.w;
slouken@5305
   561
        h = bounds.h;
dludwig@9990
   562
dludwig@9990
   563
        /* Unset the maximized flag.  This fixes
dludwig@9990
   564
           https://bugzilla.libsdl.org/show_bug.cgi?id=3215
dludwig@9990
   565
        */
dludwig@9990
   566
        if (style & WS_MAXIMIZE) {
dludwig@9990
   567
            data->windowed_mode_was_maximized = SDL_TRUE;
dludwig@9990
   568
            style &= ~WS_MAXIMIZE;
dludwig@9990
   569
        }
slouken@5305
   570
    } else {
dludwig@9990
   571
        /* Restore window-maximization state, as applicable.
dludwig@9990
   572
           Special care is taken to *not* do this if and when we're
dludwig@9990
   573
           alt-tab'ing away (to some other window; as indicated by
dludwig@9990
   574
           in_window_deactivation), otherwise
dludwig@9990
   575
           https://bugzilla.libsdl.org/show_bug.cgi?id=3215 can reproduce!
dludwig@9990
   576
        */
dludwig@9990
   577
        if (data->windowed_mode_was_maximized && !data->in_window_deactivation) {
dludwig@9990
   578
            style |= WS_MAXIMIZE;
dludwig@9990
   579
            data->windowed_mode_was_maximized = SDL_FALSE;
dludwig@9990
   580
        }
slouken@5305
   581
        rect.left = 0;
slouken@5305
   582
        rect.top = 0;
slouken@5398
   583
        rect.right = window->windowed.w;
slouken@5398
   584
        rect.bottom = window->windowed.h;
slouken@5305
   585
        menu = (style & WS_CHILDWINDOW) ? FALSE : (GetMenu(hwnd) != NULL);
slouken@5305
   586
        AdjustWindowRectEx(&rect, style, menu, 0);
slouken@5305
   587
        w = (rect.right - rect.left);
slouken@5305
   588
        h = (rect.bottom - rect.top);
slouken@5398
   589
        x = window->windowed.x + rect.left;
slouken@5398
   590
        y = window->windowed.y + rect.top;
slouken@5305
   591
    }
slouken@5305
   592
    SetWindowLong(hwnd, GWL_STYLE, style);
slouken@8817
   593
    data->expected_resize = SDL_TRUE;
slouken@8205
   594
    SetWindowPos(hwnd, top, x, y, w, h, SWP_NOCOPYBITS | SWP_NOACTIVATE);
slouken@8817
   595
    data->expected_resize = SDL_FALSE;
slouken@5305
   596
}
slouken@5305
   597
slouken@5466
   598
int
slouken@5466
   599
WIN_SetWindowGammaRamp(_THIS, SDL_Window * window, const Uint16 * ramp)
slouken@5466
   600
{
slouken@5466
   601
    SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
slouken@5466
   602
    SDL_DisplayData *data = (SDL_DisplayData *) display->driverdata;
slouken@5466
   603
    HDC hdc;
slouken@5466
   604
    BOOL succeeded = FALSE;
slouken@5466
   605
slouken@5466
   606
    hdc = CreateDC(data->DeviceName, NULL, NULL, NULL);
slouken@5466
   607
    if (hdc) {
slouken@5466
   608
        succeeded = SetDeviceGammaRamp(hdc, (LPVOID)ramp);
slouken@5466
   609
        if (!succeeded) {
slouken@5466
   610
            WIN_SetError("SetDeviceGammaRamp()");
slouken@5466
   611
        }
slouken@5466
   612
        DeleteDC(hdc);
slouken@5466
   613
    }
slouken@5466
   614
    return succeeded ? 0 : -1;
slouken@5466
   615
}
slouken@5466
   616
slouken@5466
   617
int
slouken@5466
   618
WIN_GetWindowGammaRamp(_THIS, SDL_Window * window, Uint16 * ramp)
slouken@5466
   619
{
slouken@5466
   620
    SDL_VideoDisplay *display = SDL_GetDisplayForWindow(window);
slouken@5466
   621
    SDL_DisplayData *data = (SDL_DisplayData *) display->driverdata;
slouken@5466
   622
    HDC hdc;
slouken@5466
   623
    BOOL succeeded = FALSE;
slouken@5466
   624
slouken@5466
   625
    hdc = CreateDC(data->DeviceName, NULL, NULL, NULL);
slouken@5466
   626
    if (hdc) {
slouken@5466
   627
        succeeded = GetDeviceGammaRamp(hdc, (LPVOID)ramp);
slouken@5466
   628
        if (!succeeded) {
slouken@5466
   629
            WIN_SetError("GetDeviceGammaRamp()");
slouken@5466
   630
        }
slouken@5466
   631
        DeleteDC(hdc);
slouken@5466
   632
    }
slouken@5466
   633
    return succeeded ? 0 : -1;
slouken@5466
   634
}
slouken@5466
   635
slouken@5305
   636
void
slouken@6662
   637
WIN_SetWindowGrab(_THIS, SDL_Window * window, SDL_bool grabbed)
slouken@1895
   638
{
slouken@8072
   639
    WIN_UpdateClipCursor(window);
slouken@6782
   640
slouken@7585
   641
    if (window->flags & SDL_WINDOW_FULLSCREEN) {
slouken@7584
   642
        UINT flags = SWP_NOCOPYBITS | SWP_NOMOVE | SWP_NOSIZE;
slouken@6782
   643
slouken@7584
   644
        if (!(window->flags & SDL_WINDOW_SHOWN)) {
slouken@7584
   645
            flags |= SWP_NOACTIVATE;
slouken@7584
   646
        }
slouken@7585
   647
        WIN_SetWindowPositionInternal(_this, window, flags);
slouken@7191
   648
    }
slouken@1895
   649
}
slouken@1895
   650
slouken@1895
   651
void
slouken@1895
   652
WIN_DestroyWindow(_THIS, SDL_Window * window)
slouken@1895
   653
{
slouken@1895
   654
    SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
slouken@1895
   655
slouken@1895
   656
    if (data) {
slouken@1913
   657
        ReleaseDC(data->hwnd, data->hdc);
slouken@9665
   658
        RemoveProp(data->hwnd, TEXT("SDL_WindowData"));
slouken@1895
   659
        if (data->created) {
slouken@1895
   660
            DestroyWindow(data->hwnd);
icculus@5580
   661
        } else {
icculus@5580
   662
            /* Restore any original event handler... */
icculus@5580
   663
            if (data->wndproc != NULL) {
icculus@5580
   664
#ifdef GWLP_WNDPROC
icculus@5581
   665
                SetWindowLongPtr(data->hwnd, GWLP_WNDPROC,
icculus@5581
   666
                                 (LONG_PTR) data->wndproc);
icculus@5580
   667
#else
icculus@5581
   668
                SetWindowLong(data->hwnd, GWL_WNDPROC,
icculus@5581
   669
                              (LONG_PTR) data->wndproc);
icculus@5580
   670
#endif
icculus@5580
   671
            }
slouken@1895
   672
        }
slouken@1895
   673
        SDL_free(data);
slouken@1895
   674
    }
slouken@8978
   675
    window->driverdata = NULL;
slouken@1895
   676
}
slouken@1895
   677
slouken@1895
   678
SDL_bool
slouken@1895
   679
WIN_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_SysWMinfo * info)
slouken@1895
   680
{
icculus@9422
   681
    const SDL_WindowData *data = (const SDL_WindowData *) window->driverdata;
slouken@1895
   682
    if (info->version.major <= SDL_MAJOR_VERSION) {
slouken@4900
   683
        info->subsystem = SDL_SYSWM_WINDOWS;
icculus@9422
   684
        info->info.win.window = data->hwnd;
icculus@9422
   685
        info->info.win.hdc = data->hdc;
slouken@1895
   686
        return SDL_TRUE;
slouken@1895
   687
    } else {
slouken@1895
   688
        SDL_SetError("Application not compiled with SDL %d.%d\n",
slouken@1895
   689
                     SDL_MAJOR_VERSION, SDL_MINOR_VERSION);
slouken@1895
   690
        return SDL_FALSE;
slouken@1895
   691
    }
slouken@1895
   692
}
slouken@1895
   693
slouken@2713
   694
slouken@2713
   695
/*
slouken@2713
   696
 * Creates a HelperWindow used for DirectInput events.
slouken@2713
   697
 */
slouken@2713
   698
int
slouken@2713
   699
SDL_HelperWindowCreate(void)
slouken@2713
   700
{
slouken@3097
   701
    HINSTANCE hInstance = GetModuleHandle(NULL);
slouken@3097
   702
    WNDCLASS wce;
slouken@2713
   703
bobbens@3045
   704
    /* Make sure window isn't created twice. */
bobbens@3045
   705
    if (SDL_HelperWindow != NULL) {
bobbens@3045
   706
        return 0;
bobbens@3045
   707
    }
bobbens@3045
   708
slouken@2713
   709
    /* Create the class. */
slouken@2714
   710
    SDL_zero(wce);
slouken@3097
   711
    wce.lpfnWndProc = DefWindowProc;
slouken@2713
   712
    wce.lpszClassName = (LPCWSTR) SDL_HelperWindowClassName;
slouken@2713
   713
    wce.hInstance = hInstance;
slouken@2713
   714
slouken@2713
   715
    /* Register the class. */
slouken@3097
   716
    SDL_HelperWindowClass = RegisterClass(&wce);
slouken@8238
   717
    if (SDL_HelperWindowClass == 0 && GetLastError() != ERROR_CLASS_ALREADY_EXISTS) {
icculus@7037
   718
        return WIN_SetError("Unable to create Helper Window Class");
slouken@2713
   719
    }
slouken@2713
   720
slouken@2713
   721
    /* Create the window. */
slouken@2714
   722
    SDL_HelperWindow = CreateWindowEx(0, SDL_HelperWindowClassName,
slouken@2714
   723
                                      SDL_HelperWindowName,
slouken@3168
   724
                                      WS_OVERLAPPED, CW_USEDEFAULT,
slouken@2714
   725
                                      CW_USEDEFAULT, CW_USEDEFAULT,
icculus@6430
   726
                                      CW_USEDEFAULT, HWND_MESSAGE, NULL,
slouken@2714
   727
                                      hInstance, NULL);
slouken@2713
   728
    if (SDL_HelperWindow == NULL) {
bobbens@3045
   729
        UnregisterClass(SDL_HelperWindowClassName, hInstance);
icculus@7037
   730
        return WIN_SetError("Unable to create Helper Window");
slouken@2713
   731
    }
slouken@2713
   732
slouken@2713
   733
    return 0;
slouken@2713
   734
}
slouken@2713
   735
slouken@2713
   736
slouken@2713
   737
/*
slouken@2713
   738
 * Destroys the HelperWindow previously created with SDL_HelperWindowCreate.
slouken@2713
   739
 */
slouken@2713
   740
void
slouken@2713
   741
SDL_HelperWindowDestroy(void)
slouken@2713
   742
{
slouken@3097
   743
    HINSTANCE hInstance = GetModuleHandle(NULL);
bobbens@2863
   744
slouken@2713
   745
    /* Destroy the window. */
bobbens@2863
   746
    if (SDL_HelperWindow != NULL) {
bobbens@2863
   747
        if (DestroyWindow(SDL_HelperWindow) == 0) {
slouken@4500
   748
            WIN_SetError("Unable to destroy Helper Window");
slouken@2865
   749
            return;
bobbens@2863
   750
        }
slouken@2713
   751
        SDL_HelperWindow = NULL;
slouken@2713
   752
    }
slouken@2713
   753
slouken@2713
   754
    /* Unregister the class. */
bobbens@2863
   755
    if (SDL_HelperWindowClass != 0) {
bobbens@2863
   756
        if ((UnregisterClass(SDL_HelperWindowClassName, hInstance)) == 0) {
slouken@4500
   757
            WIN_SetError("Unable to destroy Helper Window Class");
slouken@2865
   758
            return;
bobbens@2863
   759
        }
slouken@2713
   760
        SDL_HelperWindowClass = 0;
slouken@2713
   761
    }
slouken@2713
   762
}
slouken@2713
   763
jorgen@7089
   764
void WIN_OnWindowEnter(_THIS, SDL_Window * window)
jorgen@7089
   765
{
jorgen@7089
   766
#ifdef WM_MOUSELEAVE
jorgen@7089
   767
    SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
jorgen@7089
   768
    TRACKMOUSEEVENT trackMouseEvent;
jorgen@7089
   769
jorgen@7089
   770
    if (!data || !data->hwnd) {
jorgen@7089
   771
        /* The window wasn't fully initialized */
jorgen@7089
   772
        return;
jorgen@7089
   773
    }
jorgen@7089
   774
jorgen@7089
   775
    trackMouseEvent.cbSize = sizeof(TRACKMOUSEEVENT);
jorgen@7089
   776
    trackMouseEvent.dwFlags = TME_LEAVE;
jorgen@7089
   777
    trackMouseEvent.hwndTrack = data->hwnd;
jorgen@7089
   778
jorgen@7089
   779
    TrackMouseEvent(&trackMouseEvent);
jorgen@7089
   780
#endif /* WM_MOUSELEAVE */
jorgen@7089
   781
}
jorgen@7089
   782
slouken@8072
   783
void
slouken@8072
   784
WIN_UpdateClipCursor(SDL_Window *window)
slouken@8072
   785
{
slouken@8072
   786
    SDL_WindowData *data = (SDL_WindowData *) window->driverdata;
slouken@8072
   787
    SDL_Mouse *mouse = SDL_GetMouse();
slouken@8072
   788
slouken@8916
   789
    if (data->focus_click_pending) {
slouken@8072
   790
        return;
slouken@8072
   791
    }
slouken@8072
   792
slouken@8072
   793
    if ((mouse->relative_mode || (window->flags & SDL_WINDOW_INPUT_GRABBED)) &&
slouken@8072
   794
        (window->flags & SDL_WINDOW_INPUT_FOCUS)) {
slouken@8072
   795
        if (mouse->relative_mode && !mouse->relative_mode_warp) {
slouken@8072
   796
            LONG cx, cy;
slouken@8072
   797
            RECT rect;
slouken@8072
   798
            GetWindowRect(data->hwnd, &rect);
slouken@8072
   799
slouken@8072
   800
            cx = (rect.left + rect.right) / 2;
slouken@8072
   801
            cy = (rect.top + rect.bottom) / 2;
slouken@8072
   802
slouken@8072
   803
            /* Make an absurdly small clip rect */
slouken@8072
   804
            rect.left = cx - 1;
slouken@8072
   805
            rect.right = cx + 1;
slouken@8072
   806
            rect.top = cy - 1;
slouken@8072
   807
            rect.bottom = cy + 1;
slouken@8072
   808
slouken@8072
   809
            ClipCursor(&rect);
slouken@8072
   810
        } else {
slouken@8072
   811
            RECT rect;
slouken@8072
   812
            if (GetClientRect(data->hwnd, &rect) && !IsRectEmpty(&rect)) {
slouken@8072
   813
                ClientToScreen(data->hwnd, (LPPOINT) & rect);
slouken@8072
   814
                ClientToScreen(data->hwnd, (LPPOINT) & rect + 1);
slouken@8072
   815
                ClipCursor(&rect);
slouken@8072
   816
            }
slouken@8072
   817
        }
slouken@8072
   818
    } else {
slouken@8072
   819
        ClipCursor(NULL);
slouken@8072
   820
    }
slouken@8072
   821
}
slouken@8072
   822
icculus@8938
   823
int
icculus@8938
   824
WIN_SetWindowHitTest(SDL_Window *window, SDL_bool enabled)
icculus@8938
   825
{
icculus@8938
   826
    return 0;  /* just succeed, the real work is done elsewhere. */
icculus@8938
   827
}
icculus@8938
   828
slouken@6044
   829
#endif /* SDL_VIDEO_DRIVER_WINDOWS */
slouken@6044
   830
slouken@1895
   831
/* vi: set ts=4 sw=4 expandtab: */