src/video/windows/SDL_windowsopengl.c
changeset 8144 855b1d6d7d8e
parent 8093 b43765095a6f
child 8149 681eb46b8ac4
     1.1 --- a/src/video/windows/SDL_windowsopengl.c	Thu Jan 30 12:27:24 2014 -0800
     1.2 +++ b/src/video/windows/SDL_windowsopengl.c	Thu Jan 30 12:30:40 2014 -0800
     1.3 @@ -759,6 +759,26 @@
     1.4      _this->gl_data->wglDeleteContext((HGLRC) context);
     1.5  }
     1.6  
     1.7 +
     1.8 +SDL_bool
     1.9 +WIN_GL_SetPixelFormatFrom(_THIS, SDL_Window * fromWindow, SDL_Window * toWindow)
    1.10 +{
    1.11 +    HDC hfromdc = ((SDL_WindowData *) fromWindow->driverdata)->hdc;
    1.12 +    HDC htodc = ((SDL_WindowData *) toWindow->driverdata)->hdc;
    1.13 +    BOOL result;
    1.14 +
    1.15 +    /* get the pixel format of the fromWindow */
    1.16 +    int pixel_format = GetPixelFormat(hfromdc);
    1.17 +    PIXELFORMATDESCRIPTOR pfd;
    1.18 +    SDL_memset(&pfd, 0, sizeof(pfd));
    1.19 +    DescribePixelFormat(hfromdc, pixel_format, sizeof(pfd), &pfd);
    1.20 +
    1.21 +    /* set the pixel format of the toWindow */
    1.22 +    result = SetPixelFormat(htodc, pixel_format, &pfd);
    1.23 +
    1.24 +    return result ? SDL_TRUE : SDL_FALSE;
    1.25 +}
    1.26 +
    1.27  #endif /* SDL_VIDEO_OPENGL_WGL */
    1.28  
    1.29  #endif /* SDL_VIDEO_DRIVER_WINDOWS */