Mercurial > sdl-ios-xcode
comparison src/video/wincommon/SDL_wingl_c.h @ 655:9c42ee1b7d77
Date: Thu, 24 Apr 2003 15:13:47 -0400
From: Shawn Kirst
Subject: SDL-1.2.5 patch to add ARB_multisample support
Attached is a patch I have written for SDL-1.2.5 that adds ARB_multisample
support. I only have the X11 and Win32 video patched. The Win32 patch also
adds support for WGL_ARB_pixel_format, as it was required for getting a
multisample capable pixel format. No additional GL header files are required
to compile on either platform (though you need an up-to-date glx.h for X11).
Requesting a multisample pixel format is made possible using
SDL_GL_SetAttribute with the two new SDL_GLattr's I've added
(SDL_GL_SAMPLE_BUFFERS and SDL_GL_SAMPLES). I've been using SDL in my
projects for quite a while now, so I am happy to contribute back to the
project. Now you can have and control FSAA in your SDL/GL apps at the
application level!
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Tue, 22 Jul 2003 15:10:06 +0000 |
parents | f6ffac90895c |
children | b8d311d90021 |
comparison
equal
deleted
inserted
replaced
654:e92bcf2573cb | 655:9c42ee1b7d77 |
---|---|
35 | 35 |
36 #ifdef HAVE_OPENGL | 36 #ifdef HAVE_OPENGL |
37 PIXELFORMATDESCRIPTOR GL_pfd; | 37 PIXELFORMATDESCRIPTOR GL_pfd; |
38 HDC GL_hdc; | 38 HDC GL_hdc; |
39 HGLRC GL_hrc; | 39 HGLRC GL_hrc; |
40 int pixel_format; | |
41 int wgl_arb_pixel_format; | |
40 | 42 |
41 void * (WINAPI *wglGetProcAddress)(const char *proc); | 43 void * (WINAPI *wglGetProcAddress)(const char *proc); |
42 | 44 |
43 HGLRC (WINAPI *wglCreateContext)(HDC hdc); | 45 HGLRC (WINAPI *wglCreateContext)(HDC hdc); |
44 | 46 |
45 BOOL (WINAPI *wglDeleteContext)(HGLRC hglrc); | 47 BOOL (WINAPI *wglDeleteContext)(HGLRC hglrc); |
46 | 48 |
47 BOOL (WINAPI *wglMakeCurrent)(HDC hdc, HGLRC hglrc); | 49 BOOL (WINAPI *wglMakeCurrent)(HDC hdc, HGLRC hglrc); |
48 | 50 |
51 BOOL (WINAPI *wglChoosePixelFormatARB)(HDC hdc, const int *piAttribIList, | |
52 const FLOAT *pfAttribFList, | |
53 UINT nMaxFormats, int *piFormats, | |
54 UINT *nNumFormats); | |
55 BOOL (WINAPI *wglGetPixelFormatAttribivARB)(HDC hdc, int iPixelFormat, | |
56 int iLayerPlane, | |
57 UINT nAttributes, | |
58 const int *piAttributes, | |
59 int *piValues); | |
49 #endif /* HAVE_OPENGL */ | 60 #endif /* HAVE_OPENGL */ |
50 }; | 61 }; |
51 | 62 |
52 /* Old variable names */ | 63 /* Old variable names */ |
53 #define gl_active (this->gl_data->gl_active) | 64 #define gl_active (this->gl_data->gl_active) |
54 #define GL_pfd (this->gl_data->GL_pfd) | 65 #define GL_pfd (this->gl_data->GL_pfd) |
55 #define GL_hdc (this->gl_data->GL_hdc) | 66 #define GL_hdc (this->gl_data->GL_hdc) |
56 #define GL_hrc (this->gl_data->GL_hrc) | 67 #define GL_hrc (this->gl_data->GL_hrc) |
68 #define pixel_format (this->gl_data->pixel_format) | |
57 | 69 |
58 /* OpenGL functions */ | 70 /* OpenGL functions */ |
59 extern int WIN_GL_SetupWindow(_THIS); | 71 extern int WIN_GL_SetupWindow(_THIS); |
60 extern void WIN_GL_ShutDown(_THIS); | 72 extern void WIN_GL_ShutDown(_THIS); |
61 #ifdef HAVE_OPENGL | 73 #ifdef HAVE_OPENGL |
65 extern void WIN_GL_UnloadLibrary(_THIS); | 77 extern void WIN_GL_UnloadLibrary(_THIS); |
66 extern int WIN_GL_LoadLibrary(_THIS, const char* path); | 78 extern int WIN_GL_LoadLibrary(_THIS, const char* path); |
67 extern void *WIN_GL_GetProcAddress(_THIS, const char* proc); | 79 extern void *WIN_GL_GetProcAddress(_THIS, const char* proc); |
68 #endif | 80 #endif |
69 | 81 |
82 #ifdef HAVE_OPENGL | |
83 | |
84 #ifndef WGL_ARB_pixel_format | |
85 #define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000 | |
86 #define WGL_DRAW_TO_WINDOW_ARB 0x2001 | |
87 #define WGL_DRAW_TO_BITMAP_ARB 0x2002 | |
88 #define WGL_ACCELERATION_ARB 0x2003 | |
89 #define WGL_NEED_PALETTE_ARB 0x2004 | |
90 #define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005 | |
91 #define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006 | |
92 #define WGL_SWAP_METHOD_ARB 0x2007 | |
93 #define WGL_NUMBER_OVERLAYS_ARB 0x2008 | |
94 #define WGL_NUMBER_UNDERLAYS_ARB 0x2009 | |
95 #define WGL_TRANSPARENT_ARB 0x200A | |
96 #define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037 | |
97 #define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038 | |
98 #define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039 | |
99 #define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A | |
100 #define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B | |
101 #define WGL_SHARE_DEPTH_ARB 0x200C | |
102 #define WGL_SHARE_STENCIL_ARB 0x200D | |
103 #define WGL_SHARE_ACCUM_ARB 0x200E | |
104 #define WGL_SUPPORT_GDI_ARB 0x200F | |
105 #define WGL_SUPPORT_OPENGL_ARB 0x2010 | |
106 #define WGL_DOUBLE_BUFFER_ARB 0x2011 | |
107 #define WGL_STEREO_ARB 0x2012 | |
108 #define WGL_PIXEL_TYPE_ARB 0x2013 | |
109 #define WGL_COLOR_BITS_ARB 0x2014 | |
110 #define WGL_RED_BITS_ARB 0x2015 | |
111 #define WGL_RED_SHIFT_ARB 0x2016 | |
112 #define WGL_GREEN_BITS_ARB 0x2017 | |
113 #define WGL_GREEN_SHIFT_ARB 0x2018 | |
114 #define WGL_BLUE_BITS_ARB 0x2019 | |
115 #define WGL_BLUE_SHIFT_ARB 0x201A | |
116 #define WGL_ALPHA_BITS_ARB 0x201B | |
117 #define WGL_ALPHA_SHIFT_ARB 0x201C | |
118 #define WGL_ACCUM_BITS_ARB 0x201D | |
119 #define WGL_ACCUM_RED_BITS_ARB 0x201E | |
120 #define WGL_ACCUM_GREEN_BITS_ARB 0x201F | |
121 #define WGL_ACCUM_BLUE_BITS_ARB 0x2020 | |
122 #define WGL_ACCUM_ALPHA_BITS_ARB 0x2021 | |
123 #define WGL_DEPTH_BITS_ARB 0x2022 | |
124 #define WGL_STENCIL_BITS_ARB 0x2023 | |
125 #define WGL_AUX_BUFFERS_ARB 0x2024 | |
126 #define WGL_NO_ACCELERATION_ARB 0x2025 | |
127 #define WGL_GENERIC_ACCELERATION_ARB 0x2026 | |
128 #define WGL_FULL_ACCELERATION_ARB 0x2027 | |
129 #define WGL_SWAP_EXCHANGE_ARB 0x2028 | |
130 #define WGL_SWAP_COPY_ARB 0x2029 | |
131 #define WGL_SWAP_UNDEFINED_ARB 0x202A | |
132 #define WGL_TYPE_RGBA_ARB 0x202B | |
133 #define WGL_TYPE_COLORINDEX_ARB 0x202C | |
134 #endif | |
135 | |
136 #ifndef WGL_ARB_multisample | |
137 #define WGL_SAMPLE_BUFFERS_ARB 0x2041 | |
138 #define WGL_SAMPLES_ARB 0x2042 | |
139 #endif | |
140 | |
141 #endif |