--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403608
This commit is contained in:
Sam Lantinga 2009-05-23 22:41:08 +00:00
parent 3071101f22
commit 483f2ba3fb
41 changed files with 7305 additions and 7366 deletions

View file

@ -40,7 +40,11 @@
#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002
#endif
typedef HGLRC (APIENTRYP PFNWGLCREATECONTEXTATTRIBSARBPROC) (HDC hDC, HGLRC hShareContext, const int * attribList);
typedef HGLRC(APIENTRYP PFNWGLCREATECONTEXTATTRIBSARBPROC) (HDC hDC,
HGLRC
hShareContext,
const int
*attribList);
int
WIN_GL_LoadLibrary(_THIS, const char *path)
@ -502,17 +506,19 @@ WIN_GL_CreateContext(_THIS, SDL_Window * window)
PFNWGLCREATECONTEXTATTRIBSARBPROC wglCreateContextAttribsARB;
HGLRC temp_context = _this->gl_data->wglCreateContext(hdc);
if (!temp_context) {
SDL_SetError("Could not create GL context");
SDL_SetError("Could not create GL context");
return NULL;
}
/* Make the context current */
if (WIN_GL_MakeCurrent(_this, window, temp_context) < 0) {
WIN_GL_DeleteContext(_this, temp_context);
return NULL;
}
wglCreateContextAttribsARB = (PFNWGLCREATECONTEXTATTRIBSARBPROC) _this->gl_data->wglGetProcAddress("wglCreateContextAttribsARB");
wglCreateContextAttribsARB =
(PFNWGLCREATECONTEXTATTRIBSARBPROC) _this->gl_data->
wglGetProcAddress("wglCreateContextAttribsARB");
if (!wglCreateContextAttribsARB) {
SDL_SetError("GL 3.x is not supported");
context = temp_context;
@ -520,7 +526,7 @@ WIN_GL_CreateContext(_THIS, SDL_Window * window)
int attribs[] = {
WGL_CONTEXT_MAJOR_VERSION_ARB, _this->gl_config.major_version,
WGL_CONTEXT_MINOR_VERSION_ARB, _this->gl_config.minor_version,
0
0
};
/* Create the GL 3.x context */
context = wglCreateContextAttribsARB(hdc, 0, attribs);
@ -528,7 +534,7 @@ WIN_GL_CreateContext(_THIS, SDL_Window * window)
_this->gl_data->wglDeleteContext(temp_context);
}
}
if (!context) {
SDL_SetError("Could not create GL context");
return NULL;