exporting patches: # HG changeset patch # User Riku Palomäki # Date 1272981430 -10800 # Node ID ce6d40f982ce93523c0822a19689a75c25c2baa4 # Parent 8b03a20b320f4b6c30d72135b0be15a05922b8e3 Partially implemented X11_GetWindowWMInfo, now it returns the X11 Window. diff -r 8b03a20b320f -r ce6d40f982ce src/video/x11/SDL_x11window.c --- a/src/video/x11/SDL_x11window.c Sun May 02 05:08:12 2010 -0400 +++ b/src/video/x11/SDL_x11window.c Tue May 04 16:57:10 2010 +0300 @@ -1044,7 +1044,9 @@ SDL_bool X11_GetWindowWMInfo(_THIS, SDL_Window * window, SDL_SysWMinfo * info) { + SDL_WindowData *data = (SDL_WindowData*) window->driverdata; if (info->version.major <= SDL_MAJOR_VERSION) { + info->info.x11.window = data->xwindow; /* FIXME! */ return SDL_TRUE; } else { # HG changeset patch # User Riku Palomäki # Date 1272981649 -10800 # Node ID 1e66889ed2337011aef9f66ea3a746ddc805ed98 # Parent ce6d40f982ce93523c0822a19689a75c25c2baa4 New attribute SDL_GL_CONTEXT_PROFILE for requesting specific OpenGL 3.x profile. Use like this: SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3); SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 2); SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE, GL_CONTEXT_COMPATIBILITY_PROFILE_BIT); diff -r ce6d40f982ce -r 1e66889ed233 include/SDL_video.h --- a/include/SDL_video.h Tue May 04 16:57:10 2010 +0300 +++ b/include/SDL_video.h Tue May 04 17:00:49 2010 +0300 @@ -280,7 +280,8 @@ SDL_GL_ACCELERATED_VISUAL, SDL_GL_RETAINED_BACKING, SDL_GL_CONTEXT_MAJOR_VERSION, - SDL_GL_CONTEXT_MINOR_VERSION + SDL_GL_CONTEXT_MINOR_VERSION, + SDL_GL_CONTEXT_PROFILE } SDL_GLattr; diff -r ce6d40f982ce -r 1e66889ed233 src/video/SDL_sysvideo.h --- a/src/video/SDL_sysvideo.h Tue May 04 16:57:10 2010 +0300 +++ b/src/video/SDL_sysvideo.h Tue May 04 17:00:49 2010 +0300 @@ -335,6 +335,7 @@ int accelerated; int major_version; int minor_version; + int profile; int retained_backing; int driver_loaded; char driver_path[256]; diff -r ce6d40f982ce -r 1e66889ed233 src/video/SDL_video.c --- a/src/video/SDL_video.c Tue May 04 16:57:10 2010 +0300 +++ b/src/video/SDL_video.c Tue May 04 17:00:49 2010 +0300 @@ -261,6 +261,7 @@ _this->gl_config.accelerated = -1; /* accelerated or not, both are fine */ _this->gl_config.major_version = 2; _this->gl_config.minor_version = 1; + _this->gl_config.profile = 1; /* core profile */ /* Initialize the video subsystem */ if (_this->VideoInit(_this) < 0) { @@ -3037,6 +3038,9 @@ case SDL_GL_CONTEXT_MINOR_VERSION: _this->gl_config.minor_version = value; break; + case SDL_GL_CONTEXT_PROFILE: + _this->gl_config.profile = value; + break; default: SDL_SetError("Unknown OpenGL attribute"); retval = -1; diff -r ce6d40f982ce -r 1e66889ed233 src/video/win32/SDL_win32opengl.c --- a/src/video/win32/SDL_win32opengl.c Tue May 04 16:57:10 2010 +0300 +++ b/src/video/win32/SDL_win32opengl.c Tue May 04 17:00:49 2010 +0300 @@ -36,6 +36,7 @@ #define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092 #define WGL_CONTEXT_LAYER_PLANE_ARB 0x2093 #define WGL_CONTEXT_FLAGS_ARB 0x2093 +#define WGL_CONTEXT_PROFILE_MASK_ARB 0x9126 #define WGL_CONTEXT_DEBUG_BIT_ARB 0x0001 #define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002 #endif @@ -526,6 +527,7 @@ int attribs[] = { WGL_CONTEXT_MAJOR_VERSION_ARB, _this->gl_config.major_version, WGL_CONTEXT_MINOR_VERSION_ARB, _this->gl_config.minor_version, + WGL_CONTEXT_PROFILE_MASK_ARB, _this->gl_config.profile, 0 }; /* Create the GL 3.x context */ diff -r ce6d40f982ce -r 1e66889ed233 src/video/x11/SDL_x11opengl.c --- a/src/video/x11/SDL_x11opengl.c Tue May 04 16:57:10 2010 +0300 +++ b/src/video/x11/SDL_x11opengl.c Tue May 04 17:00:49 2010 +0300 @@ -62,6 +62,7 @@ #define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091 #define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092 #define GLX_CONTEXT_FLAGS_ARB 0x2094 +#define GLX_CONTEXT_PROFILE_MASK_ARB 0x9126 #define GLX_CONTEXT_DEBUG_BIT_ARB 0x0001 #define GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002 #endif @@ -424,6 +425,8 @@ _this->gl_config.major_version, GLX_CONTEXT_MINOR_VERSION_ARB, _this->gl_config.minor_version, + GLX_CONTEXT_PROFILE_MASK_ARB, + _this->gl_config.profile, 0 }; diff -r ce6d40f982ce -r 1e66889ed233 test/common.c --- a/test/common.c Tue May 04 16:57:10 2010 +0300 +++ b/test/common.c Tue May 04 17:00:49 2010 +0300 @@ -107,6 +107,7 @@ state->gl_accelerated = -1; state->gl_major_version = 2; state->gl_minor_version = 1; + state->gl_profile = 1; return state; } @@ -666,6 +667,7 @@ SDL_GL_SetAttribute(SDL_GL_RETAINED_BACKING, state->gl_retained_backing); SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, state->gl_major_version); SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, state->gl_minor_version); + SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE, state->gl_profile); if (state->verbose & VERBOSE_MODES) { SDL_DisplayMode mode; diff -r ce6d40f982ce -r 1e66889ed233 test/common.h --- a/test/common.h Tue May 04 16:57:10 2010 +0300 +++ b/test/common.h Tue May 04 17:00:49 2010 +0300 @@ -63,6 +63,7 @@ int gl_accelerated; int gl_major_version; int gl_minor_version; + int gl_profile; } CommonState; extern CommonState *CommonCreateState(char **argv, Uint32 flags);