Windows: Report window HDC in SDL_SysWMinfo.
authorRyan C. Gordon <icculus@icculus.org>
Mon, 23 Mar 2015 19:47:08 -0400
changeset 9422286c854c1d5b
parent 9421 fd5dd91ec0ce
child 9423 3df83030dab9
Windows: Report window HDC in SDL_SysWMinfo.

Fixes Bugzilla #2668.
include/SDL_syswm.h
src/video/windows/SDL_windowswindow.c
     1.1 --- a/include/SDL_syswm.h	Mon Mar 23 20:24:04 2015 +0100
     1.2 +++ b/include/SDL_syswm.h	Mon Mar 23 19:47:08 2015 -0400
     1.3 @@ -186,6 +186,7 @@
     1.4          struct
     1.5          {
     1.6              HWND window;                /**< The window handle */
     1.7 +            HDC hdc;                    /**< The window device context */
     1.8          } win;
     1.9  #endif
    1.10  #if defined(SDL_VIDEO_DRIVER_WINRT)
     2.1 --- a/src/video/windows/SDL_windowswindow.c	Mon Mar 23 20:24:04 2015 +0100
     2.2 +++ b/src/video/windows/SDL_windowswindow.c	Mon Mar 23 19:47:08 2015 -0400
     2.3 @@ -643,10 +643,11 @@
     2.4  SDL_bool
     2.5  WIN_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_SysWMinfo * info)
     2.6  {
     2.7 -    HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
     2.8 +    const SDL_WindowData *data = (const SDL_WindowData *) window->driverdata;
     2.9      if (info->version.major <= SDL_MAJOR_VERSION) {
    2.10          info->subsystem = SDL_SYSWM_WINDOWS;
    2.11 -        info->info.win.window = hwnd;
    2.12 +        info->info.win.window = data->hwnd;
    2.13 +        info->info.win.hdc = data->hdc;
    2.14          return SDL_TRUE;
    2.15      } else {
    2.16          SDL_SetError("Application not compiled with SDL %d.%d\n",