Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Yes, you need to set the pixel format before creating a context.
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Jul 12, 2007
1 parent 6599422 commit 6a9d92e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/video/win32/SDL_win32opengl.c
Expand Up @@ -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;
Expand All @@ -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);
Expand Down

0 comments on commit 6a9d92e

Please sign in to comment.