From 6a9d92ef747dd15ea56afa937f12b81a925f28a1 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Thu, 12 Jul 2007 06:59:43 +0000 Subject: [PATCH] Yes, you need to set the pixel format before creating a context. --- src/video/win32/SDL_win32opengl.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/video/win32/SDL_win32opengl.c b/src/video/win32/SDL_win32opengl.c index a79f665db..66184e2ec 100644 --- a/src/video/win32/SDL_win32opengl.c +++ b/src/video/win32/SDL_win32opengl.c @@ -340,6 +340,7 @@ WIN_GL_ChoosePixelFormatARB(_THIS, int *iAttribs, float *fAttribs) { HWND hwnd; HDC hdc; + PIXELFORMATDESCRIPTOR pfd; HGLRC hglrc; int pixel_format = 0; unsigned int matching; @@ -351,6 +352,10 @@ WIN_GL_ChoosePixelFormatARB(_THIS, int *iAttribs, float *fAttribs) hdc = GetDC(hwnd); + WIN_GL_SetupPixelFormat(_this, &pfd); + + SetPixelFormat(hdc, ChoosePixelFormat(hdc, &pfd), &pfd); + hglrc = _this->gl_data->wglCreateContext(hdc); if (hglrc) { _this->gl_data->wglMakeCurrent(hdc, hglrc);