src/video/win32/SDL_win32opengl.h
changeset 1913 83420da906a5
child 1936 83946ee0ff1f
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/video/win32/SDL_win32opengl.h	Mon Jul 17 06:47:33 2006 +0000
     1.3 @@ -0,0 +1,129 @@
     1.4 +/*
     1.5 +    SDL - Simple DirectMedia Layer
     1.6 +    Copyright (C) 1997-2006 Sam Lantinga
     1.7 +
     1.8 +    This library is free software; you can redistribute it and/or
     1.9 +    modify it under the terms of the GNU Lesser General Public
    1.10 +    License as published by the Free Software Foundation; either
    1.11 +    version 2.1 of the License, or (at your option) any later version.
    1.12 +
    1.13 +    This library is distributed in the hope that it will be useful,
    1.14 +    but WITHOUT ANY WARRANTY; without even the implied warranty of
    1.15 +    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    1.16 +    Lesser General Public License for more details.
    1.17 +
    1.18 +    You should have received a copy of the GNU Lesser General Public
    1.19 +    License along with this library; if not, write to the Free Software
    1.20 +    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    1.21 +
    1.22 +    Sam Lantinga
    1.23 +    slouken@libsdl.org
    1.24 +*/
    1.25 +#include "SDL_config.h"
    1.26 +
    1.27 +#ifndef _SDL_win32opengl_h
    1.28 +#define _SDL_win32opengl_h
    1.29 +
    1.30 +#if SDL_VIDEO_OPENGL
    1.31 +
    1.32 +struct SDL_GLDriverData
    1.33 +{
    1.34 +    int initialized;
    1.35 +    int WGL_ARB_pixel_format;
    1.36 +
    1.37 +    void *(WINAPI * wglGetProcAddress) (const char *proc);
    1.38 +      HGLRC(WINAPI * wglCreateContext) (HDC hdc);
    1.39 +      BOOL(WINAPI * wglDeleteContext) (HGLRC hglrc);
    1.40 +      BOOL(WINAPI * wglMakeCurrent) (HDC hdc, HGLRC hglrc);
    1.41 +      BOOL(WINAPI * wglChoosePixelFormatARB) (HDC hdc,
    1.42 +                                              const int *piAttribIList,
    1.43 +                                              const FLOAT * pfAttribFList,
    1.44 +                                              UINT nMaxFormats,
    1.45 +                                              int *piFormats,
    1.46 +                                              UINT * nNumFormats);
    1.47 +      BOOL(WINAPI * wglGetPixelFormatAttribivARB) (HDC hdc, int iPixelFormat,
    1.48 +                                                   int iLayerPlane,
    1.49 +                                                   UINT nAttributes,
    1.50 +                                                   const int *piAttributes,
    1.51 +                                                   int *piValues);
    1.52 +    void (WINAPI * wglSwapIntervalEXT) (int interval);
    1.53 +    int (WINAPI * wglGetSwapIntervalEXT) (void);
    1.54 +};
    1.55 +
    1.56 +/* OpenGL functions */
    1.57 +extern int WIN_GL_LoadLibrary(_THIS, const char *path);
    1.58 +extern void *WIN_GL_GetProcAddress(_THIS, const char *proc);
    1.59 +extern int WIN_GL_SetupWindow(_THIS, SDL_Window * window);
    1.60 +extern void WIN_GL_CleanupWindow(_THIS, SDL_Window * window);
    1.61 +extern int WIN_GL_GetWindowAttribute(_THIS, SDL_Window * window,
    1.62 +                                     SDL_GLattr attrib, int *value);
    1.63 +extern SDL_GLContext WIN_GL_CreateContext(_THIS, SDL_Window * window);
    1.64 +extern int WIN_GL_MakeCurrent(_THIS, SDL_Window * window,
    1.65 +                              SDL_GLContext context);
    1.66 +extern int WIN_GL_SetSwapInterval(_THIS, int interval);
    1.67 +extern int WIN_GL_GetSwapInterval(_THIS);
    1.68 +extern void WIN_GL_SwapWindow(_THIS, SDL_Window * window);
    1.69 +extern void WIN_GL_DeleteContext(_THIS, SDL_GLContext context);
    1.70 +
    1.71 +#ifndef WGL_ARB_pixel_format
    1.72 +#define WGL_NUMBER_PIXEL_FORMATS_ARB   0x2000
    1.73 +#define WGL_DRAW_TO_WINDOW_ARB         0x2001
    1.74 +#define WGL_DRAW_TO_BITMAP_ARB         0x2002
    1.75 +#define WGL_ACCELERATION_ARB           0x2003
    1.76 +#define WGL_NEED_PALETTE_ARB           0x2004
    1.77 +#define WGL_NEED_SYSTEM_PALETTE_ARB    0x2005
    1.78 +#define WGL_SWAP_LAYER_BUFFERS_ARB     0x2006
    1.79 +#define WGL_SWAP_METHOD_ARB            0x2007
    1.80 +#define WGL_NUMBER_OVERLAYS_ARB        0x2008
    1.81 +#define WGL_NUMBER_UNDERLAYS_ARB       0x2009
    1.82 +#define WGL_TRANSPARENT_ARB            0x200A
    1.83 +#define WGL_TRANSPARENT_RED_VALUE_ARB  0x2037
    1.84 +#define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038
    1.85 +#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039
    1.86 +#define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A
    1.87 +#define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B
    1.88 +#define WGL_SHARE_DEPTH_ARB            0x200C
    1.89 +#define WGL_SHARE_STENCIL_ARB          0x200D
    1.90 +#define WGL_SHARE_ACCUM_ARB            0x200E
    1.91 +#define WGL_SUPPORT_GDI_ARB            0x200F
    1.92 +#define WGL_SUPPORT_OPENGL_ARB         0x2010
    1.93 +#define WGL_DOUBLE_BUFFER_ARB          0x2011
    1.94 +#define WGL_STEREO_ARB                 0x2012
    1.95 +#define WGL_PIXEL_TYPE_ARB             0x2013
    1.96 +#define WGL_COLOR_BITS_ARB             0x2014
    1.97 +#define WGL_RED_BITS_ARB               0x2015
    1.98 +#define WGL_RED_SHIFT_ARB              0x2016
    1.99 +#define WGL_GREEN_BITS_ARB             0x2017
   1.100 +#define WGL_GREEN_SHIFT_ARB            0x2018
   1.101 +#define WGL_BLUE_BITS_ARB              0x2019
   1.102 +#define WGL_BLUE_SHIFT_ARB             0x201A
   1.103 +#define WGL_ALPHA_BITS_ARB             0x201B
   1.104 +#define WGL_ALPHA_SHIFT_ARB            0x201C
   1.105 +#define WGL_ACCUM_BITS_ARB             0x201D
   1.106 +#define WGL_ACCUM_RED_BITS_ARB         0x201E
   1.107 +#define WGL_ACCUM_GREEN_BITS_ARB       0x201F
   1.108 +#define WGL_ACCUM_BLUE_BITS_ARB        0x2020
   1.109 +#define WGL_ACCUM_ALPHA_BITS_ARB       0x2021
   1.110 +#define WGL_DEPTH_BITS_ARB             0x2022
   1.111 +#define WGL_STENCIL_BITS_ARB           0x2023
   1.112 +#define WGL_AUX_BUFFERS_ARB            0x2024
   1.113 +#define WGL_NO_ACCELERATION_ARB        0x2025
   1.114 +#define WGL_GENERIC_ACCELERATION_ARB   0x2026
   1.115 +#define WGL_FULL_ACCELERATION_ARB      0x2027
   1.116 +#define WGL_SWAP_EXCHANGE_ARB          0x2028
   1.117 +#define WGL_SWAP_COPY_ARB              0x2029
   1.118 +#define WGL_SWAP_UNDEFINED_ARB         0x202A
   1.119 +#define WGL_TYPE_RGBA_ARB              0x202B
   1.120 +#define WGL_TYPE_COLORINDEX_ARB        0x202C
   1.121 +#endif
   1.122 +
   1.123 +#ifndef WGL_ARB_multisample
   1.124 +#define WGL_SAMPLE_BUFFERS_ARB         0x2041
   1.125 +#define WGL_SAMPLES_ARB                0x2042
   1.126 +#endif
   1.127 +
   1.128 +#endif /* SDL_VIDEO_OPENGL */
   1.129 +
   1.130 +#endif /* _SDL_win32opengl_h */
   1.131 +
   1.132 +/* vi: set ts=4 sw=4 expandtab: */