| Summary: | OpenGL 3.2 | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Alistair Lowe <alistair.lowe> |
| Component: | video | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | enhancement | ||
| Priority: | P2 | CC: | hymedia, schreiberx |
| Version: | HG 2.0 | ||
| Hardware: | x86 | ||
| OS: | Windows Vista | ||
| Attachments: |
SVN 1.3.0 OpenGL Patch File
OpenGL 3.2 Context patch Similar patch from Riku Palomäki patch including {WGL,GLX}_ARB_create_context_robustness updates to enable opengl core mode context creation patch |
||
Ah I almost forgot: Corrected a typo in one of the WGL definitions. Improved fallback to openGL 2.x in Win32. The repost of testgl2 is due to a mistake where CommonInit() was being called after setting GL Attributes, causing them to not be recognised. Many thanks. Created attachment 344 [details]
OpenGL 3.2 Context patch
Please find attached a new patch that allows for full user control of the OpenGL context, again only test in windows but also changed in x11. Introduced new SDL_GL attributes SDL_GL_CONTEXT_FLAGS and SDL_GL_CONTEXT_PROFILE_MASK. These allow for support for all openGL contexts 3.0, 3.1 and 3.2 and should be fine coping with new revisions. They will default to core non-backwards compatible profiles if none are passed. Should an openGL context not be obtainable due to incorrect configuration or lack of driver support automatic fall back to 2.1 will take place.
Many thanks.
Thanks! I'll be reviewing this patch for inclusion in SDL 1.3. Do you give me permission to release your code with SDL 1.3 and future versions of SDL under both the LGPL and a closed-source commercial license? Yes, no problem. Thanks! Created attachment 591 [details]
Similar patch from Riku Palomäki
Hello,
I needed to use OpenGL 3.2 compatibility profile with SDL 1.3, so I
made small patch that adds a new attribute SDL_GL_CONTEXT_PROFILE for
requesting specific OpenGL 3.x context profile.
Requesting specific profile works now like:
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);
If no specific profile is requested, the default behavior is the same
as earlier (Core profile will be used).
Tested with X11 (Ubuntu 64 bit) but even though I did implement the
same change to win32 code, I don't have Windows to try it.
I also (partially) fixed X11_GetWindowWMInfo, now you can actually get
the X11 Window with SDL_GetWindowWMInfo.
Attached "hg export" patch with two commits, please import these.
--
Riku Palomäki
Created attachment 679 [details]
patch including {WGL,GLX}_ARB_create_context_robustness
This is a slightly updated version of patch 591 including the new {WGL,GLX}_CONTEXT_ROBUST_ACCESS_BIT_ARB context flags.
Also it defines new SDL constants that mirror the WGL or GLX constants, so that SDL users don't have to pass the system-dependant WGL* or GLX* constants.
Created attachment 702 [details]
updates to enable opengl core mode
OpenGL core mode initialization updated: otherwise a core mode context is never created.
This error can be reproduced by printing SDL_GetError() after trying to create a core mode window.
(In reply to comment #8) > Created attachment 702 [details] > updates to enable opengl core mode > > OpenGL core mode initialization updated: otherwise a core mode context is never > created. > > This error can be reproduced by printing SDL_GetError() after trying to create > a core mode window. I've updated the SDL core mode context creation on the opengl.org website: http://www.opengl.org/wiki/Tutorial1:_Creating_a_Cross_Platform_OpenGL_3.2_Context_in_SDL_%28C_/_SDL%29 this should help to reproduce the error and to see that the error does not occur anymore when applying the patch. Created attachment 725 [details]
context creation patch
I've updated the context creation patch to include the bugfixes by Martin Schreiber and also included a profile bit to request a ES2 compatible profile.
The wgl context creation may use 2 call to wglChoosePixelFormat if no acceleration attribute is selected, this should work around a bug with buggy AMD drivers (see #1254).
Ryan and I have reviewed the patch, and it looks good. Thanks! http://hg.libsdl.org/SDL/rev/b42657486c0d |
Created attachment 343 [details] SVN 1.3.0 OpenGL Patch File Hello, Attached is a patch based on the 4657 1.3.0 SVN build. This enables creation of openGL 3.2+ core contexts in the Win32 driver through the normal means of assigning an openGL version number. I have also made such changes to the X11 driver however am unable to test these. I have also updated sdl_opengl.h to include the current version of glext.h with openGL 3.2 support and included the current gl3.h with the opt-in compile flag SDL_GL3 - this also ensures that gl.h,glu.h and extensions are not compiled as they are not compatible. Many thanks. p.s. - If you can provide any information on becoming a direct contributor to the SVN it would be much appreciated.