comparison src/video/win32/SDL_win32opengl.h @ 1913:83420da906a5

Implemented Windows OpenGL support Fixed slowdown enumerating display modes, which was hosing OpenGL as well... Removed SDL_ from the render driver prefixes
author Sam Lantinga <slouken@libsdl.org>
date Mon, 17 Jul 2006 06:47:33 +0000
parents
children 83946ee0ff1f
comparison
equal deleted inserted replaced
1912:8d384b647307 1913:83420da906a5
1 /*
2 SDL - Simple DirectMedia Layer
3 Copyright (C) 1997-2006 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_win32opengl_h
25 #define _SDL_win32opengl_h
26
27 #if SDL_VIDEO_OPENGL
28
29 struct SDL_GLDriverData
30 {
31 int initialized;
32 int WGL_ARB_pixel_format;
33
34 void *(WINAPI * wglGetProcAddress) (const char *proc);
35 HGLRC(WINAPI * wglCreateContext) (HDC hdc);
36 BOOL(WINAPI * wglDeleteContext) (HGLRC hglrc);
37 BOOL(WINAPI * wglMakeCurrent) (HDC hdc, HGLRC hglrc);
38 BOOL(WINAPI * wglChoosePixelFormatARB) (HDC hdc,
39 const int *piAttribIList,
40 const FLOAT * pfAttribFList,
41 UINT nMaxFormats,
42 int *piFormats,
43 UINT * nNumFormats);
44 BOOL(WINAPI * wglGetPixelFormatAttribivARB) (HDC hdc, int iPixelFormat,
45 int iLayerPlane,
46 UINT nAttributes,
47 const int *piAttributes,
48 int *piValues);
49 void (WINAPI * wglSwapIntervalEXT) (int interval);
50 int (WINAPI * wglGetSwapIntervalEXT) (void);
51 };
52
53 /* OpenGL functions */
54 extern int WIN_GL_LoadLibrary(_THIS, const char *path);
55 extern void *WIN_GL_GetProcAddress(_THIS, const char *proc);
56 extern int WIN_GL_SetupWindow(_THIS, SDL_Window * window);
57 extern void WIN_GL_CleanupWindow(_THIS, SDL_Window * window);
58 extern int WIN_GL_GetWindowAttribute(_THIS, SDL_Window * window,
59 SDL_GLattr attrib, int *value);
60 extern SDL_GLContext WIN_GL_CreateContext(_THIS, SDL_Window * window);
61 extern int WIN_GL_MakeCurrent(_THIS, SDL_Window * window,
62 SDL_GLContext context);
63 extern int WIN_GL_SetSwapInterval(_THIS, int interval);
64 extern int WIN_GL_GetSwapInterval(_THIS);
65 extern void WIN_GL_SwapWindow(_THIS, SDL_Window * window);
66 extern void WIN_GL_DeleteContext(_THIS, SDL_GLContext context);
67
68 #ifndef WGL_ARB_pixel_format
69 #define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000
70 #define WGL_DRAW_TO_WINDOW_ARB 0x2001
71 #define WGL_DRAW_TO_BITMAP_ARB 0x2002
72 #define WGL_ACCELERATION_ARB 0x2003
73 #define WGL_NEED_PALETTE_ARB 0x2004
74 #define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005
75 #define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006
76 #define WGL_SWAP_METHOD_ARB 0x2007
77 #define WGL_NUMBER_OVERLAYS_ARB 0x2008
78 #define WGL_NUMBER_UNDERLAYS_ARB 0x2009
79 #define WGL_TRANSPARENT_ARB 0x200A
80 #define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037
81 #define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038
82 #define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039
83 #define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A
84 #define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B
85 #define WGL_SHARE_DEPTH_ARB 0x200C
86 #define WGL_SHARE_STENCIL_ARB 0x200D
87 #define WGL_SHARE_ACCUM_ARB 0x200E
88 #define WGL_SUPPORT_GDI_ARB 0x200F
89 #define WGL_SUPPORT_OPENGL_ARB 0x2010
90 #define WGL_DOUBLE_BUFFER_ARB 0x2011
91 #define WGL_STEREO_ARB 0x2012
92 #define WGL_PIXEL_TYPE_ARB 0x2013
93 #define WGL_COLOR_BITS_ARB 0x2014
94 #define WGL_RED_BITS_ARB 0x2015
95 #define WGL_RED_SHIFT_ARB 0x2016
96 #define WGL_GREEN_BITS_ARB 0x2017
97 #define WGL_GREEN_SHIFT_ARB 0x2018
98 #define WGL_BLUE_BITS_ARB 0x2019
99 #define WGL_BLUE_SHIFT_ARB 0x201A
100 #define WGL_ALPHA_BITS_ARB 0x201B
101 #define WGL_ALPHA_SHIFT_ARB 0x201C
102 #define WGL_ACCUM_BITS_ARB 0x201D
103 #define WGL_ACCUM_RED_BITS_ARB 0x201E
104 #define WGL_ACCUM_GREEN_BITS_ARB 0x201F
105 #define WGL_ACCUM_BLUE_BITS_ARB 0x2020
106 #define WGL_ACCUM_ALPHA_BITS_ARB 0x2021
107 #define WGL_DEPTH_BITS_ARB 0x2022
108 #define WGL_STENCIL_BITS_ARB 0x2023
109 #define WGL_AUX_BUFFERS_ARB 0x2024
110 #define WGL_NO_ACCELERATION_ARB 0x2025
111 #define WGL_GENERIC_ACCELERATION_ARB 0x2026
112 #define WGL_FULL_ACCELERATION_ARB 0x2027
113 #define WGL_SWAP_EXCHANGE_ARB 0x2028
114 #define WGL_SWAP_COPY_ARB 0x2029
115 #define WGL_SWAP_UNDEFINED_ARB 0x202A
116 #define WGL_TYPE_RGBA_ARB 0x202B
117 #define WGL_TYPE_COLORINDEX_ARB 0x202C
118 #endif
119
120 #ifndef WGL_ARB_multisample
121 #define WGL_SAMPLE_BUFFERS_ARB 0x2041
122 #define WGL_SAMPLES_ARB 0x2042
123 #endif
124
125 #endif /* SDL_VIDEO_OPENGL */
126
127 #endif /* _SDL_win32opengl_h */
128
129 /* vi: set ts=4 sw=4 expandtab: */