stw: move get_proc_address and extension functions to shared
[mesa.git] / src / gallium / state_trackers / wgl / wgl / stw_wgl.c
1 /**************************************************************************
2 *
3 * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas.
4 * All Rights Reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
13 *
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
16 * of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21 * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
22 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 *
26 **************************************************************************/
27
28 #include <windows.h>
29
30 #include "pipe/p_debug.h"
31 #include "shared/stw_public.h"
32 #include "stw_wgl.h"
33 #include "stw.h"
34
35 boolean stw_wgl_init( void )
36 {
37 debug_printf("%s\n", __FUNCTION__);
38 return TRUE;
39 }
40
41 void stw_wgl_cleanup( void )
42 {
43 }
44
45
46 WINGDIAPI BOOL APIENTRY
47 wglCopyContext(
48 HGLRC hglrcSrc,
49 HGLRC hglrcDst,
50 UINT mask )
51 {
52 return stw_copy_context( hglrcSrc, hglrcDst, mask );
53 }
54
55 WINGDIAPI HGLRC APIENTRY
56 wglCreateContext(
57 HDC hdc )
58 {
59 return (HGLRC) stw_create_context( hdc, 0 );
60 }
61
62 WINGDIAPI HGLRC APIENTRY
63 wglCreateLayerContext(
64 HDC hdc,
65 int iLayerPlane )
66 {
67 return (HGLRC) stw_create_context( hdc, iLayerPlane );
68 }
69
70 WINGDIAPI BOOL APIENTRY
71 wglDeleteContext(
72 HGLRC hglrc )
73 {
74 return stw_delete_context( hglrc );
75 }
76
77
78 WINGDIAPI HGLRC APIENTRY
79 wglGetCurrentContext( VOID )
80 {
81 return stw_get_current_context();
82 }
83
84 WINGDIAPI HDC APIENTRY
85 wglGetCurrentDC( VOID )
86 {
87 return stw_get_current_dc();
88 }
89
90 WINGDIAPI BOOL APIENTRY
91 wglMakeCurrent(
92 HDC hdc,
93 HGLRC hglrc )
94 {
95 return stw_make_current( hdc, hglrc );
96 }
97
98
99 WINGDIAPI BOOL APIENTRY
100 wglSwapBuffers(
101 HDC hdc )
102 {
103 return stw_swap_buffers( hdc );
104 }
105
106
107 WINGDIAPI BOOL APIENTRY
108 wglSwapLayerBuffers(
109 HDC hdc,
110 UINT fuPlanes )
111 {
112 (void) hdc;
113 (void) fuPlanes;
114
115 return FALSE;
116 }
117
118 WINGDIAPI PROC APIENTRY
119 wglGetProcAddress(
120 LPCSTR lpszProc )
121 {
122 return stw_get_proc_address( lpszProc );
123 }
124
125
126 WINGDIAPI BOOL APIENTRY
127 wglUseFontBitmapsA(
128 HDC hdc,
129 DWORD first,
130 DWORD count,
131 DWORD listBase )
132 {
133 (void) hdc;
134 (void) first;
135 (void) count;
136 (void) listBase;
137
138 assert( 0 );
139
140 return FALSE;
141 }
142
143 WINGDIAPI BOOL APIENTRY
144 wglShareLists(
145 HGLRC hglrc1,
146 HGLRC hglrc2 )
147 {
148 (void) hglrc1;
149 (void) hglrc2;
150
151 assert( 0 );
152
153 return FALSE;
154 }
155
156 WINGDIAPI BOOL APIENTRY
157 wglUseFontBitmapsW(
158 HDC hdc,
159 DWORD first,
160 DWORD count,
161 DWORD listBase )
162 {
163 (void) hdc;
164 (void) first;
165 (void) count;
166 (void) listBase;
167
168 assert( 0 );
169
170 return FALSE;
171 }
172
173 WINGDIAPI BOOL APIENTRY
174 wglUseFontOutlinesA(
175 HDC hdc,
176 DWORD first,
177 DWORD count,
178 DWORD listBase,
179 FLOAT deviation,
180 FLOAT extrusion,
181 int format,
182 LPGLYPHMETRICSFLOAT lpgmf )
183 {
184 (void) hdc;
185 (void) first;
186 (void) count;
187 (void) listBase;
188 (void) deviation;
189 (void) extrusion;
190 (void) format;
191 (void) lpgmf;
192
193 assert( 0 );
194
195 return FALSE;
196 }
197
198 WINGDIAPI BOOL APIENTRY
199 wglUseFontOutlinesW(
200 HDC hdc,
201 DWORD first,
202 DWORD count,
203 DWORD listBase,
204 FLOAT deviation,
205 FLOAT extrusion,
206 int format,
207 LPGLYPHMETRICSFLOAT lpgmf )
208 {
209 (void) hdc;
210 (void) first;
211 (void) count;
212 (void) listBase;
213 (void) deviation;
214 (void) extrusion;
215 (void) format;
216 (void) lpgmf;
217
218 assert( 0 );
219
220 return FALSE;
221 }
222
223 WINGDIAPI BOOL APIENTRY
224 wglDescribeLayerPlane(
225 HDC hdc,
226 int iPixelFormat,
227 int iLayerPlane,
228 UINT nBytes,
229 LPLAYERPLANEDESCRIPTOR plpd )
230 {
231 (void) hdc;
232 (void) iPixelFormat;
233 (void) iLayerPlane;
234 (void) nBytes;
235 (void) plpd;
236
237 assert( 0 );
238
239 return FALSE;
240 }
241
242 WINGDIAPI int APIENTRY
243 wglSetLayerPaletteEntries(
244 HDC hdc,
245 int iLayerPlane,
246 int iStart,
247 int cEntries,
248 CONST COLORREF *pcr )
249 {
250 (void) hdc;
251 (void) iLayerPlane;
252 (void) iStart;
253 (void) cEntries;
254 (void) pcr;
255
256 assert( 0 );
257
258 return 0;
259 }
260
261 WINGDIAPI int APIENTRY
262 wglGetLayerPaletteEntries(
263 HDC hdc,
264 int iLayerPlane,
265 int iStart,
266 int cEntries,
267 COLORREF *pcr )
268 {
269 (void) hdc;
270 (void) iLayerPlane;
271 (void) iStart;
272 (void) cEntries;
273 (void) pcr;
274
275 assert( 0 );
276
277 return 0;
278 }
279
280 WINGDIAPI BOOL APIENTRY
281 wglRealizeLayerPalette(
282 HDC hdc,
283 int iLayerPlane,
284 BOOL bRealize )
285 {
286 (void) hdc;
287 (void) iLayerPlane;
288 (void) bRealize;
289
290 assert( 0 );
291
292 return FALSE;
293 }