Add OpenGL 3.X context creation support

Matthias Bentrup 2011-10-30 03:58:24 PDT

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).
This commit is contained in:
Sam Lantinga 2012-02-20 23:37:57 -05:00
parent e4461d199e
commit 38463b3a0c
5 changed files with 144 additions and 22 deletions

View file

@ -182,9 +182,25 @@ typedef enum
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_FLAGS,
SDL_GL_CONTEXT_PROFILE_MASK
} SDL_GLattr;
typedef enum
{
SDL_GL_CONTEXT_PROFILE_CORE = 0x0001,
SDL_GL_CONTEXT_PROFILE_COMPATIBILITY = 0x0002,
SDL_GL_CONTEXT_PROFILE_ES2 = 0x0004
} SDL_GLprofile;
typedef enum
{
SDL_GL_CONTEXT_DEBUG_FLAG = 0x0001,
SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG = 0x0002,
SDL_GL_CONTEXT_ROBUST_ACCESS_FLAG = 0x0004
} SDL_GLcontextFlag;
/* Function prototypes */