Skip to content

Commit

Permalink
Windows: Report window HDC in SDL_SysWMinfo.
Browse files Browse the repository at this point in the history
Fixes Bugzilla #2668.
  • Loading branch information
icculus committed Mar 23, 2015
1 parent 528e48b commit 331a434
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions include/SDL_syswm.h
Expand Up @@ -186,6 +186,7 @@ struct SDL_SysWMinfo
struct
{
HWND window; /**< The window handle */
HDC hdc; /**< The window device context */
} win;
#endif
#if defined(SDL_VIDEO_DRIVER_WINRT)
Expand Down
5 changes: 3 additions & 2 deletions src/video/windows/SDL_windowswindow.c
Expand Up @@ -643,10 +643,11 @@ WIN_DestroyWindow(_THIS, SDL_Window * window)
SDL_bool
WIN_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_SysWMinfo * info)
{
HWND hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
const SDL_WindowData *data = (const SDL_WindowData *) window->driverdata;
if (info->version.major <= SDL_MAJOR_VERSION) {
info->subsystem = SDL_SYSWM_WINDOWS;
info->info.win.window = hwnd;
info->info.win.window = data->hwnd;
info->info.win.hdc = data->hdc;
return SDL_TRUE;
} else {
SDL_SetError("Application not compiled with SDL %d.%d\n",
Expand Down

0 comments on commit 331a434

Please sign in to comment.