src/video/windows/SDL_windowsopengl.h
author Sam Lantinga <slouken@libsdl.org>
Thu, 20 Jan 2011 18:04:05 -0800
changeset 5062 e8916fe9cfc8
parent 3697 src/video/win32/SDL_win32opengl.h@f7b03b6838cb
child 5262 b530ef003506
permissions -rw-r--r--
Fixed bug #925

Changed "win32" to "windows"
     1 /*
     2     SDL - Simple DirectMedia Layer
     3     Copyright (C) 1997-2010 Sam Lantinga
     4 
     5     This library is free software; you can redistribute it and/or
     6     modify it under the terms of the GNU Lesser General Public
     7     License as published by the Free Software Foundation; either
     8     version 2.1 of the License, or (at your option) any later version.
     9 
    10     This library is distributed in the hope that it will be useful,
    11     but WITHOUT ANY WARRANTY; without even the implied warranty of
    12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    13     Lesser General Public License for more details.
    14 
    15     You should have received a copy of the GNU Lesser General Public
    16     License along with this library; if not, write to the Free Software
    17     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    18 
    19     Sam Lantinga
    20     slouken@libsdl.org
    21 */
    22 #include "SDL_config.h"
    23 
    24 #ifndef _SDL_windowsopengl_h
    25 #define _SDL_windowsopengl_h
    26 
    27 #if SDL_VIDEO_OPENGL_WGL
    28 
    29 struct SDL_GLDriverData
    30 {
    31     int WGL_ARB_pixel_format;
    32 
    33     void *(WINAPI * wglGetProcAddress) (const char *proc);
    34       HGLRC(WINAPI * wglCreateContext) (HDC hdc);
    35       BOOL(WINAPI * wglDeleteContext) (HGLRC hglrc);
    36       BOOL(WINAPI * wglMakeCurrent) (HDC hdc, HGLRC hglrc);
    37       BOOL(WINAPI * wglChoosePixelFormatARB) (HDC hdc,
    38                                               const int *piAttribIList,
    39                                               const FLOAT * pfAttribFList,
    40                                               UINT nMaxFormats,
    41                                               int *piFormats,
    42                                               UINT * nNumFormats);
    43       BOOL(WINAPI * wglGetPixelFormatAttribivARB) (HDC hdc, int iPixelFormat,
    44                                                    int iLayerPlane,
    45                                                    UINT nAttributes,
    46                                                    const int *piAttributes,
    47                                                    int *piValues);
    48     void (WINAPI * wglSwapIntervalEXT) (int interval);
    49     int (WINAPI * wglGetSwapIntervalEXT) (void);
    50 };
    51 
    52 /* OpenGL functions */
    53 extern int WIN_GL_LoadLibrary(_THIS, const char *path);
    54 extern void *WIN_GL_GetProcAddress(_THIS, const char *proc);
    55 extern void WIN_GL_UnloadLibrary(_THIS);
    56 extern int WIN_GL_SetupWindow(_THIS, SDL_Window * window);
    57 extern SDL_GLContext WIN_GL_CreateContext(_THIS, SDL_Window * window);
    58 extern int WIN_GL_MakeCurrent(_THIS, SDL_Window * window,
    59                               SDL_GLContext context);
    60 extern int WIN_GL_SetSwapInterval(_THIS, int interval);
    61 extern int WIN_GL_GetSwapInterval(_THIS);
    62 extern void WIN_GL_SwapWindow(_THIS, SDL_Window * window);
    63 extern void WIN_GL_DeleteContext(_THIS, SDL_GLContext context);
    64 
    65 #ifndef WGL_ARB_pixel_format
    66 #define WGL_NUMBER_PIXEL_FORMATS_ARB   0x2000
    67 #define WGL_DRAW_TO_WINDOW_ARB         0x2001
    68 #define WGL_DRAW_TO_BITMAP_ARB         0x2002
    69 #define WGL_ACCELERATION_ARB           0x2003
    70 #define WGL_NEED_PALETTE_ARB           0x2004
    71 #define WGL_NEED_SYSTEM_PALETTE_ARB    0x2005
    72 #define WGL_SWAP_LAYER_BUFFERS_ARB     0x2006
    73 #define WGL_SWAP_METHOD_ARB            0x2007
    74 #define WGL_NUMBER_OVERLAYS_ARB        0x2008
    75 #define WGL_NUMBER_UNDERLAYS_ARB       0x2009
    76 #define WGL_TRANSPARENT_ARB            0x200A
    77 #define WGL_TRANSPARENT_RED_VALUE_ARB  0x2037
    78 #define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038
    79 #define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039
    80 #define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A
    81 #define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B
    82 #define WGL_SHARE_DEPTH_ARB            0x200C
    83 #define WGL_SHARE_STENCIL_ARB          0x200D
    84 #define WGL_SHARE_ACCUM_ARB            0x200E
    85 #define WGL_SUPPORT_GDI_ARB            0x200F
    86 #define WGL_SUPPORT_OPENGL_ARB         0x2010
    87 #define WGL_DOUBLE_BUFFER_ARB          0x2011
    88 #define WGL_STEREO_ARB                 0x2012
    89 #define WGL_PIXEL_TYPE_ARB             0x2013
    90 #define WGL_COLOR_BITS_ARB             0x2014
    91 #define WGL_RED_BITS_ARB               0x2015
    92 #define WGL_RED_SHIFT_ARB              0x2016
    93 #define WGL_GREEN_BITS_ARB             0x2017
    94 #define WGL_GREEN_SHIFT_ARB            0x2018
    95 #define WGL_BLUE_BITS_ARB              0x2019
    96 #define WGL_BLUE_SHIFT_ARB             0x201A
    97 #define WGL_ALPHA_BITS_ARB             0x201B
    98 #define WGL_ALPHA_SHIFT_ARB            0x201C
    99 #define WGL_ACCUM_BITS_ARB             0x201D
   100 #define WGL_ACCUM_RED_BITS_ARB         0x201E
   101 #define WGL_ACCUM_GREEN_BITS_ARB       0x201F
   102 #define WGL_ACCUM_BLUE_BITS_ARB        0x2020
   103 #define WGL_ACCUM_ALPHA_BITS_ARB       0x2021
   104 #define WGL_DEPTH_BITS_ARB             0x2022
   105 #define WGL_STENCIL_BITS_ARB           0x2023
   106 #define WGL_AUX_BUFFERS_ARB            0x2024
   107 #define WGL_NO_ACCELERATION_ARB        0x2025
   108 #define WGL_GENERIC_ACCELERATION_ARB   0x2026
   109 #define WGL_FULL_ACCELERATION_ARB      0x2027
   110 #define WGL_SWAP_EXCHANGE_ARB          0x2028
   111 #define WGL_SWAP_COPY_ARB              0x2029
   112 #define WGL_SWAP_UNDEFINED_ARB         0x202A
   113 #define WGL_TYPE_RGBA_ARB              0x202B
   114 #define WGL_TYPE_COLORINDEX_ARB        0x202C
   115 #endif
   116 
   117 #ifndef WGL_ARB_multisample
   118 #define WGL_SAMPLE_BUFFERS_ARB         0x2041
   119 #define WGL_SAMPLES_ARB                0x2042
   120 #endif
   121 
   122 #endif /* SDL_VIDEO_OPENGL_WGL */
   123 
   124 #endif /* _SDL_windowsopengl_h */
   125 
   126 /* vi: set ts=4 sw=4 expandtab: */