Yes, you need to set the pixel format before creating a context.
authorSam Lantinga <slouken@libsdl.org>
Thu, 12 Jul 2007 06:59:43 +0000
changeset 21805ed37b16c1a7
parent 2179 8b76cc268771
child 2181 791cdc226105
Yes, you need to set the pixel format before creating a context.
src/video/win32/SDL_win32opengl.c
     1.1 --- a/src/video/win32/SDL_win32opengl.c	Thu Jul 12 06:53:20 2007 +0000
     1.2 +++ b/src/video/win32/SDL_win32opengl.c	Thu Jul 12 06:59:43 2007 +0000
     1.3 @@ -340,6 +340,7 @@
     1.4  {
     1.5      HWND hwnd;
     1.6      HDC hdc;
     1.7 +    PIXELFORMATDESCRIPTOR pfd;
     1.8      HGLRC hglrc;
     1.9      int pixel_format = 0;
    1.10      unsigned int matching;
    1.11 @@ -351,6 +352,10 @@
    1.12  
    1.13      hdc = GetDC(hwnd);
    1.14  
    1.15 +    WIN_GL_SetupPixelFormat(_this, &pfd);
    1.16 +
    1.17 +    SetPixelFormat(hdc, ChoosePixelFormat(hdc, &pfd), &pfd);
    1.18 +
    1.19      hglrc = _this->gl_data->wglCreateContext(hdc);
    1.20      if (hglrc) {
    1.21          _this->gl_data->wglMakeCurrent(hdc, hglrc);