Added a way to get the Windows OpenGL context in SDL_syswm.h
--HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40439
This commit is contained in:
parent
44bb9d26b0
commit
e8d4a664cc
2 changed files with 12 additions and 0 deletions
|
@ -111,6 +111,7 @@ typedef struct {
|
|||
} SDL_SysWMinfo;
|
||||
|
||||
#elif defined(WIN32)
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
|
||||
/* The windows custom event structure */
|
||||
|
@ -126,6 +127,7 @@ struct SDL_SysWMmsg {
|
|||
typedef struct {
|
||||
SDL_version version;
|
||||
HWND window; /* The Win32 display window */
|
||||
HGLRC hglrc; /* The OpenGL context, if any */
|
||||
} SDL_SysWMinfo;
|
||||
|
||||
#else
|
||||
|
|
|
@ -267,6 +267,16 @@ int WIN_GetWMInfo(_THIS, SDL_SysWMinfo *info)
|
|||
{
|
||||
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",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue