# HG changeset patch # User Sam Lantinga # Date 1029606567 0 # Node ID f9c5f135a8b93ab2db390025bb1019b33d870a8f # Parent 5602f069ccb2a0eb4d7f0beb55aeb93ad11d76e2 Added a way to get the Windows OpenGL context in SDL_syswm.h diff -r 5602f069ccb2 -r f9c5f135a8b9 include/SDL_syswm.h --- a/include/SDL_syswm.h Sat Aug 17 17:21:04 2002 +0000 +++ b/include/SDL_syswm.h Sat Aug 17 17:49:27 2002 +0000 @@ -111,6 +111,7 @@ } SDL_SysWMinfo; #elif defined(WIN32) +#define WIN32_LEAN_AND_MEAN #include /* The windows custom event structure */ @@ -126,6 +127,7 @@ typedef struct { SDL_version version; HWND window; /* The Win32 display window */ + HGLRC hglrc; /* The OpenGL context, if any */ } SDL_SysWMinfo; #else diff -r 5602f069ccb2 -r f9c5f135a8b9 src/video/wincommon/SDL_syswm.c --- a/src/video/wincommon/SDL_syswm.c Sat Aug 17 17:21:04 2002 +0000 +++ b/src/video/wincommon/SDL_syswm.c Sat Aug 17 17:49:27 2002 +0000 @@ -267,6 +267,16 @@ { if ( info->version.major <= SDL_MAJOR_VERSION ) { info->window = SDL_Window; + if ( SDL_VERSIONNUM(info->version.major, + info->version.minor, + info->version.patch) >= + SDL_VERSION(1, 2, 5) ) { +#ifdef HAVE_OPENGL + info->hglrc = GL_hrc; +#else + info->hglrc = NULL; +#endif + } return(1); } else { SDL_SetError("Application not compiled with SDL %d.%d\n",