1 /* GdkGLExt - OpenGL Extension to GDK
2  * Copyright (C) 2002-2004  Naofumi Yasufuku
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307  USA.
17  */
18 
19 /*
20  * This is a generated file.  Please modify "gen-gdkglwglext-c.pl".
21  */
22 
23 #include "gdkglwin32.h"
24 #include "gdkglprivate-win32.h"
25 #include "gdkglwglext.h"
26 
27 /*
28  * WGL_ARB_buffer_region
29  */
30 
31 static GdkGL_WGL_ARB_buffer_region _procs_WGL_ARB_buffer_region = {
32   (GdkGLProc_wglCreateBufferRegionARB) -1,
33   (GdkGLProc_wglDeleteBufferRegionARB) -1,
34   (GdkGLProc_wglSaveBufferRegionARB) -1,
35   (GdkGLProc_wglRestoreBufferRegionARB) -1
36 };
37 
38 /* wglCreateBufferRegionARB */
39 GdkGLProc
gdk_gl_get_wglCreateBufferRegionARB(void)40 gdk_gl_get_wglCreateBufferRegionARB (void)
41 {
42   if (wglGetCurrentContext () == NULL)
43     return NULL;
44 
45   if (_procs_WGL_ARB_buffer_region.wglCreateBufferRegionARB == (GdkGLProc_wglCreateBufferRegionARB) -1)
46     _procs_WGL_ARB_buffer_region.wglCreateBufferRegionARB =
47       (GdkGLProc_wglCreateBufferRegionARB) gdk_gl_get_proc_address ("wglCreateBufferRegionARB");
48 
49   GDK_GL_NOTE (MISC,
50     g_message (" - gdk_gl_get_wglCreateBufferRegionARB () - %s",
51                (_procs_WGL_ARB_buffer_region.wglCreateBufferRegionARB) ? "supported" : "not supported"));
52 
53   return (GdkGLProc) (_procs_WGL_ARB_buffer_region.wglCreateBufferRegionARB);
54 }
55 
56 /* wglDeleteBufferRegionARB */
57 GdkGLProc
gdk_gl_get_wglDeleteBufferRegionARB(void)58 gdk_gl_get_wglDeleteBufferRegionARB (void)
59 {
60   if (wglGetCurrentContext () == NULL)
61     return NULL;
62 
63   if (_procs_WGL_ARB_buffer_region.wglDeleteBufferRegionARB == (GdkGLProc_wglDeleteBufferRegionARB) -1)
64     _procs_WGL_ARB_buffer_region.wglDeleteBufferRegionARB =
65       (GdkGLProc_wglDeleteBufferRegionARB) gdk_gl_get_proc_address ("wglDeleteBufferRegionARB");
66 
67   GDK_GL_NOTE (MISC,
68     g_message (" - gdk_gl_get_wglDeleteBufferRegionARB () - %s",
69                (_procs_WGL_ARB_buffer_region.wglDeleteBufferRegionARB) ? "supported" : "not supported"));
70 
71   return (GdkGLProc) (_procs_WGL_ARB_buffer_region.wglDeleteBufferRegionARB);
72 }
73 
74 /* wglSaveBufferRegionARB */
75 GdkGLProc
gdk_gl_get_wglSaveBufferRegionARB(void)76 gdk_gl_get_wglSaveBufferRegionARB (void)
77 {
78   if (wglGetCurrentContext () == NULL)
79     return NULL;
80 
81   if (_procs_WGL_ARB_buffer_region.wglSaveBufferRegionARB == (GdkGLProc_wglSaveBufferRegionARB) -1)
82     _procs_WGL_ARB_buffer_region.wglSaveBufferRegionARB =
83       (GdkGLProc_wglSaveBufferRegionARB) gdk_gl_get_proc_address ("wglSaveBufferRegionARB");
84 
85   GDK_GL_NOTE (MISC,
86     g_message (" - gdk_gl_get_wglSaveBufferRegionARB () - %s",
87                (_procs_WGL_ARB_buffer_region.wglSaveBufferRegionARB) ? "supported" : "not supported"));
88 
89   return (GdkGLProc) (_procs_WGL_ARB_buffer_region.wglSaveBufferRegionARB);
90 }
91 
92 /* wglRestoreBufferRegionARB */
93 GdkGLProc
gdk_gl_get_wglRestoreBufferRegionARB(void)94 gdk_gl_get_wglRestoreBufferRegionARB (void)
95 {
96   if (wglGetCurrentContext () == NULL)
97     return NULL;
98 
99   if (_procs_WGL_ARB_buffer_region.wglRestoreBufferRegionARB == (GdkGLProc_wglRestoreBufferRegionARB) -1)
100     _procs_WGL_ARB_buffer_region.wglRestoreBufferRegionARB =
101       (GdkGLProc_wglRestoreBufferRegionARB) gdk_gl_get_proc_address ("wglRestoreBufferRegionARB");
102 
103   GDK_GL_NOTE (MISC,
104     g_message (" - gdk_gl_get_wglRestoreBufferRegionARB () - %s",
105                (_procs_WGL_ARB_buffer_region.wglRestoreBufferRegionARB) ? "supported" : "not supported"));
106 
107   return (GdkGLProc) (_procs_WGL_ARB_buffer_region.wglRestoreBufferRegionARB);
108 }
109 
110 /* Get WGL_ARB_buffer_region functions */
111 GdkGL_WGL_ARB_buffer_region *
gdk_gl_get_WGL_ARB_buffer_region(GdkGLConfig * glconfig)112 gdk_gl_get_WGL_ARB_buffer_region (GdkGLConfig *glconfig)
113 {
114   static gint supported = -1;
115 
116   if (wglGetCurrentContext () == NULL)
117     return NULL;
118 
119   if (supported == -1)
120     {
121       supported = gdk_win32_gl_query_wgl_extension (glconfig, "WGL_ARB_buffer_region");
122 
123       if (supported)
124         {
125           supported &= (gdk_gl_get_wglCreateBufferRegionARB () != NULL);
126           supported &= (gdk_gl_get_wglDeleteBufferRegionARB () != NULL);
127           supported &= (gdk_gl_get_wglSaveBufferRegionARB () != NULL);
128           supported &= (gdk_gl_get_wglRestoreBufferRegionARB () != NULL);
129         }
130     }
131 
132   GDK_GL_NOTE (MISC,
133     g_message (" - gdk_gl_get_WGL_ARB_buffer_region () - %s",
134                (supported) ? "supported" : "not supported"));
135 
136   if (!supported)
137     return NULL;
138 
139   return &_procs_WGL_ARB_buffer_region;
140 }
141 
142 /*
143  * WGL_ARB_extensions_string
144  */
145 
146 static GdkGL_WGL_ARB_extensions_string _procs_WGL_ARB_extensions_string = {
147   (GdkGLProc_wglGetExtensionsStringARB) -1
148 };
149 
150 /* wglGetExtensionsStringARB */
151 GdkGLProc
gdk_gl_get_wglGetExtensionsStringARB(void)152 gdk_gl_get_wglGetExtensionsStringARB (void)
153 {
154   if (wglGetCurrentContext () == NULL)
155     return NULL;
156 
157   if (_procs_WGL_ARB_extensions_string.wglGetExtensionsStringARB == (GdkGLProc_wglGetExtensionsStringARB) -1)
158     _procs_WGL_ARB_extensions_string.wglGetExtensionsStringARB =
159       (GdkGLProc_wglGetExtensionsStringARB) gdk_gl_get_proc_address ("wglGetExtensionsStringARB");
160 
161   GDK_GL_NOTE (MISC,
162     g_message (" - gdk_gl_get_wglGetExtensionsStringARB () - %s",
163                (_procs_WGL_ARB_extensions_string.wglGetExtensionsStringARB) ? "supported" : "not supported"));
164 
165   return (GdkGLProc) (_procs_WGL_ARB_extensions_string.wglGetExtensionsStringARB);
166 }
167 
168 /* Get WGL_ARB_extensions_string functions */
169 GdkGL_WGL_ARB_extensions_string *
gdk_gl_get_WGL_ARB_extensions_string(GdkGLConfig * glconfig)170 gdk_gl_get_WGL_ARB_extensions_string (GdkGLConfig *glconfig)
171 {
172   static gint supported = -1;
173 
174   if (wglGetCurrentContext () == NULL)
175     return NULL;
176 
177   if (supported == -1)
178     {
179       supported = gdk_win32_gl_query_wgl_extension (glconfig, "WGL_ARB_extensions_string");
180 
181       if (supported)
182         {
183           supported &= (gdk_gl_get_wglGetExtensionsStringARB () != NULL);
184         }
185     }
186 
187   GDK_GL_NOTE (MISC,
188     g_message (" - gdk_gl_get_WGL_ARB_extensions_string () - %s",
189                (supported) ? "supported" : "not supported"));
190 
191   if (!supported)
192     return NULL;
193 
194   return &_procs_WGL_ARB_extensions_string;
195 }
196 
197 /*
198  * WGL_ARB_pixel_format
199  */
200 
201 static GdkGL_WGL_ARB_pixel_format _procs_WGL_ARB_pixel_format = {
202   (GdkGLProc_wglGetPixelFormatAttribivARB) -1,
203   (GdkGLProc_wglGetPixelFormatAttribfvARB) -1,
204   (GdkGLProc_wglChoosePixelFormatARB) -1
205 };
206 
207 /* wglGetPixelFormatAttribivARB */
208 GdkGLProc
gdk_gl_get_wglGetPixelFormatAttribivARB(void)209 gdk_gl_get_wglGetPixelFormatAttribivARB (void)
210 {
211   if (wglGetCurrentContext () == NULL)
212     return NULL;
213 
214   if (_procs_WGL_ARB_pixel_format.wglGetPixelFormatAttribivARB == (GdkGLProc_wglGetPixelFormatAttribivARB) -1)
215     _procs_WGL_ARB_pixel_format.wglGetPixelFormatAttribivARB =
216       (GdkGLProc_wglGetPixelFormatAttribivARB) gdk_gl_get_proc_address ("wglGetPixelFormatAttribivARB");
217 
218   GDK_GL_NOTE (MISC,
219     g_message (" - gdk_gl_get_wglGetPixelFormatAttribivARB () - %s",
220                (_procs_WGL_ARB_pixel_format.wglGetPixelFormatAttribivARB) ? "supported" : "not supported"));
221 
222   return (GdkGLProc) (_procs_WGL_ARB_pixel_format.wglGetPixelFormatAttribivARB);
223 }
224 
225 /* wglGetPixelFormatAttribfvARB */
226 GdkGLProc
gdk_gl_get_wglGetPixelFormatAttribfvARB(void)227 gdk_gl_get_wglGetPixelFormatAttribfvARB (void)
228 {
229   if (wglGetCurrentContext () == NULL)
230     return NULL;
231 
232   if (_procs_WGL_ARB_pixel_format.wglGetPixelFormatAttribfvARB == (GdkGLProc_wglGetPixelFormatAttribfvARB) -1)
233     _procs_WGL_ARB_pixel_format.wglGetPixelFormatAttribfvARB =
234       (GdkGLProc_wglGetPixelFormatAttribfvARB) gdk_gl_get_proc_address ("wglGetPixelFormatAttribfvARB");
235 
236   GDK_GL_NOTE (MISC,
237     g_message (" - gdk_gl_get_wglGetPixelFormatAttribfvARB () - %s",
238                (_procs_WGL_ARB_pixel_format.wglGetPixelFormatAttribfvARB) ? "supported" : "not supported"));
239 
240   return (GdkGLProc) (_procs_WGL_ARB_pixel_format.wglGetPixelFormatAttribfvARB);
241 }
242 
243 /* wglChoosePixelFormatARB */
244 GdkGLProc
gdk_gl_get_wglChoosePixelFormatARB(void)245 gdk_gl_get_wglChoosePixelFormatARB (void)
246 {
247   if (wglGetCurrentContext () == NULL)
248     return NULL;
249 
250   if (_procs_WGL_ARB_pixel_format.wglChoosePixelFormatARB == (GdkGLProc_wglChoosePixelFormatARB) -1)
251     _procs_WGL_ARB_pixel_format.wglChoosePixelFormatARB =
252       (GdkGLProc_wglChoosePixelFormatARB) gdk_gl_get_proc_address ("wglChoosePixelFormatARB");
253 
254   GDK_GL_NOTE (MISC,
255     g_message (" - gdk_gl_get_wglChoosePixelFormatARB () - %s",
256                (_procs_WGL_ARB_pixel_format.wglChoosePixelFormatARB) ? "supported" : "not supported"));
257 
258   return (GdkGLProc) (_procs_WGL_ARB_pixel_format.wglChoosePixelFormatARB);
259 }
260 
261 /* Get WGL_ARB_pixel_format functions */
262 GdkGL_WGL_ARB_pixel_format *
gdk_gl_get_WGL_ARB_pixel_format(GdkGLConfig * glconfig)263 gdk_gl_get_WGL_ARB_pixel_format (GdkGLConfig *glconfig)
264 {
265   static gint supported = -1;
266 
267   if (wglGetCurrentContext () == NULL)
268     return NULL;
269 
270   if (supported == -1)
271     {
272       supported = gdk_win32_gl_query_wgl_extension (glconfig, "WGL_ARB_pixel_format");
273 
274       if (supported)
275         {
276           supported &= (gdk_gl_get_wglGetPixelFormatAttribivARB () != NULL);
277           supported &= (gdk_gl_get_wglGetPixelFormatAttribfvARB () != NULL);
278           supported &= (gdk_gl_get_wglChoosePixelFormatARB () != NULL);
279         }
280     }
281 
282   GDK_GL_NOTE (MISC,
283     g_message (" - gdk_gl_get_WGL_ARB_pixel_format () - %s",
284                (supported) ? "supported" : "not supported"));
285 
286   if (!supported)
287     return NULL;
288 
289   return &_procs_WGL_ARB_pixel_format;
290 }
291 
292 /*
293  * WGL_ARB_make_current_read
294  */
295 
296 static GdkGL_WGL_ARB_make_current_read _procs_WGL_ARB_make_current_read = {
297   (GdkGLProc_wglMakeContextCurrentARB) -1,
298   (GdkGLProc_wglGetCurrentReadDCARB) -1
299 };
300 
301 /* wglMakeContextCurrentARB */
302 GdkGLProc
gdk_gl_get_wglMakeContextCurrentARB(void)303 gdk_gl_get_wglMakeContextCurrentARB (void)
304 {
305   if (wglGetCurrentContext () == NULL)
306     return NULL;
307 
308   if (_procs_WGL_ARB_make_current_read.wglMakeContextCurrentARB == (GdkGLProc_wglMakeContextCurrentARB) -1)
309     _procs_WGL_ARB_make_current_read.wglMakeContextCurrentARB =
310       (GdkGLProc_wglMakeContextCurrentARB) gdk_gl_get_proc_address ("wglMakeContextCurrentARB");
311 
312   GDK_GL_NOTE (MISC,
313     g_message (" - gdk_gl_get_wglMakeContextCurrentARB () - %s",
314                (_procs_WGL_ARB_make_current_read.wglMakeContextCurrentARB) ? "supported" : "not supported"));
315 
316   return (GdkGLProc) (_procs_WGL_ARB_make_current_read.wglMakeContextCurrentARB);
317 }
318 
319 /* wglGetCurrentReadDCARB */
320 GdkGLProc
gdk_gl_get_wglGetCurrentReadDCARB(void)321 gdk_gl_get_wglGetCurrentReadDCARB (void)
322 {
323   if (wglGetCurrentContext () == NULL)
324     return NULL;
325 
326   if (_procs_WGL_ARB_make_current_read.wglGetCurrentReadDCARB == (GdkGLProc_wglGetCurrentReadDCARB) -1)
327     _procs_WGL_ARB_make_current_read.wglGetCurrentReadDCARB =
328       (GdkGLProc_wglGetCurrentReadDCARB) gdk_gl_get_proc_address ("wglGetCurrentReadDCARB");
329 
330   GDK_GL_NOTE (MISC,
331     g_message (" - gdk_gl_get_wglGetCurrentReadDCARB () - %s",
332                (_procs_WGL_ARB_make_current_read.wglGetCurrentReadDCARB) ? "supported" : "not supported"));
333 
334   return (GdkGLProc) (_procs_WGL_ARB_make_current_read.wglGetCurrentReadDCARB);
335 }
336 
337 /* Get WGL_ARB_make_current_read functions */
338 GdkGL_WGL_ARB_make_current_read *
gdk_gl_get_WGL_ARB_make_current_read(GdkGLConfig * glconfig)339 gdk_gl_get_WGL_ARB_make_current_read (GdkGLConfig *glconfig)
340 {
341   static gint supported = -1;
342 
343   if (wglGetCurrentContext () == NULL)
344     return NULL;
345 
346   if (supported == -1)
347     {
348       supported = gdk_win32_gl_query_wgl_extension (glconfig, "WGL_ARB_make_current_read");
349 
350       if (supported)
351         {
352           supported &= (gdk_gl_get_wglMakeContextCurrentARB () != NULL);
353           supported &= (gdk_gl_get_wglGetCurrentReadDCARB () != NULL);
354         }
355     }
356 
357   GDK_GL_NOTE (MISC,
358     g_message (" - gdk_gl_get_WGL_ARB_make_current_read () - %s",
359                (supported) ? "supported" : "not supported"));
360 
361   if (!supported)
362     return NULL;
363 
364   return &_procs_WGL_ARB_make_current_read;
365 }
366 
367 /*
368  * WGL_ARB_pbuffer
369  */
370 
371 static GdkGL_WGL_ARB_pbuffer _procs_WGL_ARB_pbuffer = {
372   (GdkGLProc_wglCreatePbufferARB) -1,
373   (GdkGLProc_wglGetPbufferDCARB) -1,
374   (GdkGLProc_wglReleasePbufferDCARB) -1,
375   (GdkGLProc_wglDestroyPbufferARB) -1,
376   (GdkGLProc_wglQueryPbufferARB) -1
377 };
378 
379 /* wglCreatePbufferARB */
380 GdkGLProc
gdk_gl_get_wglCreatePbufferARB(void)381 gdk_gl_get_wglCreatePbufferARB (void)
382 {
383   if (wglGetCurrentContext () == NULL)
384     return NULL;
385 
386   if (_procs_WGL_ARB_pbuffer.wglCreatePbufferARB == (GdkGLProc_wglCreatePbufferARB) -1)
387     _procs_WGL_ARB_pbuffer.wglCreatePbufferARB =
388       (GdkGLProc_wglCreatePbufferARB) gdk_gl_get_proc_address ("wglCreatePbufferARB");
389 
390   GDK_GL_NOTE (MISC,
391     g_message (" - gdk_gl_get_wglCreatePbufferARB () - %s",
392                (_procs_WGL_ARB_pbuffer.wglCreatePbufferARB) ? "supported" : "not supported"));
393 
394   return (GdkGLProc) (_procs_WGL_ARB_pbuffer.wglCreatePbufferARB);
395 }
396 
397 /* wglGetPbufferDCARB */
398 GdkGLProc
gdk_gl_get_wglGetPbufferDCARB(void)399 gdk_gl_get_wglGetPbufferDCARB (void)
400 {
401   if (wglGetCurrentContext () == NULL)
402     return NULL;
403 
404   if (_procs_WGL_ARB_pbuffer.wglGetPbufferDCARB == (GdkGLProc_wglGetPbufferDCARB) -1)
405     _procs_WGL_ARB_pbuffer.wglGetPbufferDCARB =
406       (GdkGLProc_wglGetPbufferDCARB) gdk_gl_get_proc_address ("wglGetPbufferDCARB");
407 
408   GDK_GL_NOTE (MISC,
409     g_message (" - gdk_gl_get_wglGetPbufferDCARB () - %s",
410                (_procs_WGL_ARB_pbuffer.wglGetPbufferDCARB) ? "supported" : "not supported"));
411 
412   return (GdkGLProc) (_procs_WGL_ARB_pbuffer.wglGetPbufferDCARB);
413 }
414 
415 /* wglReleasePbufferDCARB */
416 GdkGLProc
gdk_gl_get_wglReleasePbufferDCARB(void)417 gdk_gl_get_wglReleasePbufferDCARB (void)
418 {
419   if (wglGetCurrentContext () == NULL)
420     return NULL;
421 
422   if (_procs_WGL_ARB_pbuffer.wglReleasePbufferDCARB == (GdkGLProc_wglReleasePbufferDCARB) -1)
423     _procs_WGL_ARB_pbuffer.wglReleasePbufferDCARB =
424       (GdkGLProc_wglReleasePbufferDCARB) gdk_gl_get_proc_address ("wglReleasePbufferDCARB");
425 
426   GDK_GL_NOTE (MISC,
427     g_message (" - gdk_gl_get_wglReleasePbufferDCARB () - %s",
428                (_procs_WGL_ARB_pbuffer.wglReleasePbufferDCARB) ? "supported" : "not supported"));
429 
430   return (GdkGLProc) (_procs_WGL_ARB_pbuffer.wglReleasePbufferDCARB);
431 }
432 
433 /* wglDestroyPbufferARB */
434 GdkGLProc
gdk_gl_get_wglDestroyPbufferARB(void)435 gdk_gl_get_wglDestroyPbufferARB (void)
436 {
437   if (wglGetCurrentContext () == NULL)
438     return NULL;
439 
440   if (_procs_WGL_ARB_pbuffer.wglDestroyPbufferARB == (GdkGLProc_wglDestroyPbufferARB) -1)
441     _procs_WGL_ARB_pbuffer.wglDestroyPbufferARB =
442       (GdkGLProc_wglDestroyPbufferARB) gdk_gl_get_proc_address ("wglDestroyPbufferARB");
443 
444   GDK_GL_NOTE (MISC,
445     g_message (" - gdk_gl_get_wglDestroyPbufferARB () - %s",
446                (_procs_WGL_ARB_pbuffer.wglDestroyPbufferARB) ? "supported" : "not supported"));
447 
448   return (GdkGLProc) (_procs_WGL_ARB_pbuffer.wglDestroyPbufferARB);
449 }
450 
451 /* wglQueryPbufferARB */
452 GdkGLProc
gdk_gl_get_wglQueryPbufferARB(void)453 gdk_gl_get_wglQueryPbufferARB (void)
454 {
455   if (wglGetCurrentContext () == NULL)
456     return NULL;
457 
458   if (_procs_WGL_ARB_pbuffer.wglQueryPbufferARB == (GdkGLProc_wglQueryPbufferARB) -1)
459     _procs_WGL_ARB_pbuffer.wglQueryPbufferARB =
460       (GdkGLProc_wglQueryPbufferARB) gdk_gl_get_proc_address ("wglQueryPbufferARB");
461 
462   GDK_GL_NOTE (MISC,
463     g_message (" - gdk_gl_get_wglQueryPbufferARB () - %s",
464                (_procs_WGL_ARB_pbuffer.wglQueryPbufferARB) ? "supported" : "not supported"));
465 
466   return (GdkGLProc) (_procs_WGL_ARB_pbuffer.wglQueryPbufferARB);
467 }
468 
469 /* Get WGL_ARB_pbuffer functions */
470 GdkGL_WGL_ARB_pbuffer *
gdk_gl_get_WGL_ARB_pbuffer(GdkGLConfig * glconfig)471 gdk_gl_get_WGL_ARB_pbuffer (GdkGLConfig *glconfig)
472 {
473   static gint supported = -1;
474 
475   if (wglGetCurrentContext () == NULL)
476     return NULL;
477 
478   if (supported == -1)
479     {
480       supported = gdk_win32_gl_query_wgl_extension (glconfig, "WGL_ARB_pbuffer");
481 
482       if (supported)
483         {
484           supported &= (gdk_gl_get_wglCreatePbufferARB () != NULL);
485           supported &= (gdk_gl_get_wglGetPbufferDCARB () != NULL);
486           supported &= (gdk_gl_get_wglReleasePbufferDCARB () != NULL);
487           supported &= (gdk_gl_get_wglDestroyPbufferARB () != NULL);
488           supported &= (gdk_gl_get_wglQueryPbufferARB () != NULL);
489         }
490     }
491 
492   GDK_GL_NOTE (MISC,
493     g_message (" - gdk_gl_get_WGL_ARB_pbuffer () - %s",
494                (supported) ? "supported" : "not supported"));
495 
496   if (!supported)
497     return NULL;
498 
499   return &_procs_WGL_ARB_pbuffer;
500 }
501 
502 /*
503  * WGL_ARB_render_texture
504  */
505 
506 static GdkGL_WGL_ARB_render_texture _procs_WGL_ARB_render_texture = {
507   (GdkGLProc_wglBindTexImageARB) -1,
508   (GdkGLProc_wglReleaseTexImageARB) -1,
509   (GdkGLProc_wglSetPbufferAttribARB) -1
510 };
511 
512 /* wglBindTexImageARB */
513 GdkGLProc
gdk_gl_get_wglBindTexImageARB(void)514 gdk_gl_get_wglBindTexImageARB (void)
515 {
516   if (wglGetCurrentContext () == NULL)
517     return NULL;
518 
519   if (_procs_WGL_ARB_render_texture.wglBindTexImageARB == (GdkGLProc_wglBindTexImageARB) -1)
520     _procs_WGL_ARB_render_texture.wglBindTexImageARB =
521       (GdkGLProc_wglBindTexImageARB) gdk_gl_get_proc_address ("wglBindTexImageARB");
522 
523   GDK_GL_NOTE (MISC,
524     g_message (" - gdk_gl_get_wglBindTexImageARB () - %s",
525                (_procs_WGL_ARB_render_texture.wglBindTexImageARB) ? "supported" : "not supported"));
526 
527   return (GdkGLProc) (_procs_WGL_ARB_render_texture.wglBindTexImageARB);
528 }
529 
530 /* wglReleaseTexImageARB */
531 GdkGLProc
gdk_gl_get_wglReleaseTexImageARB(void)532 gdk_gl_get_wglReleaseTexImageARB (void)
533 {
534   if (wglGetCurrentContext () == NULL)
535     return NULL;
536 
537   if (_procs_WGL_ARB_render_texture.wglReleaseTexImageARB == (GdkGLProc_wglReleaseTexImageARB) -1)
538     _procs_WGL_ARB_render_texture.wglReleaseTexImageARB =
539       (GdkGLProc_wglReleaseTexImageARB) gdk_gl_get_proc_address ("wglReleaseTexImageARB");
540 
541   GDK_GL_NOTE (MISC,
542     g_message (" - gdk_gl_get_wglReleaseTexImageARB () - %s",
543                (_procs_WGL_ARB_render_texture.wglReleaseTexImageARB) ? "supported" : "not supported"));
544 
545   return (GdkGLProc) (_procs_WGL_ARB_render_texture.wglReleaseTexImageARB);
546 }
547 
548 /* wglSetPbufferAttribARB */
549 GdkGLProc
gdk_gl_get_wglSetPbufferAttribARB(void)550 gdk_gl_get_wglSetPbufferAttribARB (void)
551 {
552   if (wglGetCurrentContext () == NULL)
553     return NULL;
554 
555   if (_procs_WGL_ARB_render_texture.wglSetPbufferAttribARB == (GdkGLProc_wglSetPbufferAttribARB) -1)
556     _procs_WGL_ARB_render_texture.wglSetPbufferAttribARB =
557       (GdkGLProc_wglSetPbufferAttribARB) gdk_gl_get_proc_address ("wglSetPbufferAttribARB");
558 
559   GDK_GL_NOTE (MISC,
560     g_message (" - gdk_gl_get_wglSetPbufferAttribARB () - %s",
561                (_procs_WGL_ARB_render_texture.wglSetPbufferAttribARB) ? "supported" : "not supported"));
562 
563   return (GdkGLProc) (_procs_WGL_ARB_render_texture.wglSetPbufferAttribARB);
564 }
565 
566 /* Get WGL_ARB_render_texture functions */
567 GdkGL_WGL_ARB_render_texture *
gdk_gl_get_WGL_ARB_render_texture(GdkGLConfig * glconfig)568 gdk_gl_get_WGL_ARB_render_texture (GdkGLConfig *glconfig)
569 {
570   static gint supported = -1;
571 
572   if (wglGetCurrentContext () == NULL)
573     return NULL;
574 
575   if (supported == -1)
576     {
577       supported = gdk_win32_gl_query_wgl_extension (glconfig, "WGL_ARB_render_texture");
578 
579       if (supported)
580         {
581           supported &= (gdk_gl_get_wglBindTexImageARB () != NULL);
582           supported &= (gdk_gl_get_wglReleaseTexImageARB () != NULL);
583           supported &= (gdk_gl_get_wglSetPbufferAttribARB () != NULL);
584         }
585     }
586 
587   GDK_GL_NOTE (MISC,
588     g_message (" - gdk_gl_get_WGL_ARB_render_texture () - %s",
589                (supported) ? "supported" : "not supported"));
590 
591   if (!supported)
592     return NULL;
593 
594   return &_procs_WGL_ARB_render_texture;
595 }
596 
597 /*
598  * WGL_EXT_display_color_table
599  */
600 
601 static GdkGL_WGL_EXT_display_color_table _procs_WGL_EXT_display_color_table = {
602   (GdkGLProc_wglCreateDisplayColorTableEXT) -1,
603   (GdkGLProc_wglLoadDisplayColorTableEXT) -1,
604   (GdkGLProc_wglBindDisplayColorTableEXT) -1,
605   (GdkGLProc_wglDestroyDisplayColorTableEXT) -1
606 };
607 
608 /* wglCreateDisplayColorTableEXT */
609 GdkGLProc
gdk_gl_get_wglCreateDisplayColorTableEXT(void)610 gdk_gl_get_wglCreateDisplayColorTableEXT (void)
611 {
612   if (wglGetCurrentContext () == NULL)
613     return NULL;
614 
615   if (_procs_WGL_EXT_display_color_table.wglCreateDisplayColorTableEXT == (GdkGLProc_wglCreateDisplayColorTableEXT) -1)
616     _procs_WGL_EXT_display_color_table.wglCreateDisplayColorTableEXT =
617       (GdkGLProc_wglCreateDisplayColorTableEXT) gdk_gl_get_proc_address ("wglCreateDisplayColorTableEXT");
618 
619   GDK_GL_NOTE (MISC,
620     g_message (" - gdk_gl_get_wglCreateDisplayColorTableEXT () - %s",
621                (_procs_WGL_EXT_display_color_table.wglCreateDisplayColorTableEXT) ? "supported" : "not supported"));
622 
623   return (GdkGLProc) (_procs_WGL_EXT_display_color_table.wglCreateDisplayColorTableEXT);
624 }
625 
626 /* wglLoadDisplayColorTableEXT */
627 GdkGLProc
gdk_gl_get_wglLoadDisplayColorTableEXT(void)628 gdk_gl_get_wglLoadDisplayColorTableEXT (void)
629 {
630   if (wglGetCurrentContext () == NULL)
631     return NULL;
632 
633   if (_procs_WGL_EXT_display_color_table.wglLoadDisplayColorTableEXT == (GdkGLProc_wglLoadDisplayColorTableEXT) -1)
634     _procs_WGL_EXT_display_color_table.wglLoadDisplayColorTableEXT =
635       (GdkGLProc_wglLoadDisplayColorTableEXT) gdk_gl_get_proc_address ("wglLoadDisplayColorTableEXT");
636 
637   GDK_GL_NOTE (MISC,
638     g_message (" - gdk_gl_get_wglLoadDisplayColorTableEXT () - %s",
639                (_procs_WGL_EXT_display_color_table.wglLoadDisplayColorTableEXT) ? "supported" : "not supported"));
640 
641   return (GdkGLProc) (_procs_WGL_EXT_display_color_table.wglLoadDisplayColorTableEXT);
642 }
643 
644 /* wglBindDisplayColorTableEXT */
645 GdkGLProc
gdk_gl_get_wglBindDisplayColorTableEXT(void)646 gdk_gl_get_wglBindDisplayColorTableEXT (void)
647 {
648   if (wglGetCurrentContext () == NULL)
649     return NULL;
650 
651   if (_procs_WGL_EXT_display_color_table.wglBindDisplayColorTableEXT == (GdkGLProc_wglBindDisplayColorTableEXT) -1)
652     _procs_WGL_EXT_display_color_table.wglBindDisplayColorTableEXT =
653       (GdkGLProc_wglBindDisplayColorTableEXT) gdk_gl_get_proc_address ("wglBindDisplayColorTableEXT");
654 
655   GDK_GL_NOTE (MISC,
656     g_message (" - gdk_gl_get_wglBindDisplayColorTableEXT () - %s",
657                (_procs_WGL_EXT_display_color_table.wglBindDisplayColorTableEXT) ? "supported" : "not supported"));
658 
659   return (GdkGLProc) (_procs_WGL_EXT_display_color_table.wglBindDisplayColorTableEXT);
660 }
661 
662 /* wglDestroyDisplayColorTableEXT */
663 GdkGLProc
gdk_gl_get_wglDestroyDisplayColorTableEXT(void)664 gdk_gl_get_wglDestroyDisplayColorTableEXT (void)
665 {
666   if (wglGetCurrentContext () == NULL)
667     return NULL;
668 
669   if (_procs_WGL_EXT_display_color_table.wglDestroyDisplayColorTableEXT == (GdkGLProc_wglDestroyDisplayColorTableEXT) -1)
670     _procs_WGL_EXT_display_color_table.wglDestroyDisplayColorTableEXT =
671       (GdkGLProc_wglDestroyDisplayColorTableEXT) gdk_gl_get_proc_address ("wglDestroyDisplayColorTableEXT");
672 
673   GDK_GL_NOTE (MISC,
674     g_message (" - gdk_gl_get_wglDestroyDisplayColorTableEXT () - %s",
675                (_procs_WGL_EXT_display_color_table.wglDestroyDisplayColorTableEXT) ? "supported" : "not supported"));
676 
677   return (GdkGLProc) (_procs_WGL_EXT_display_color_table.wglDestroyDisplayColorTableEXT);
678 }
679 
680 /* Get WGL_EXT_display_color_table functions */
681 GdkGL_WGL_EXT_display_color_table *
gdk_gl_get_WGL_EXT_display_color_table(GdkGLConfig * glconfig)682 gdk_gl_get_WGL_EXT_display_color_table (GdkGLConfig *glconfig)
683 {
684   static gint supported = -1;
685 
686   if (wglGetCurrentContext () == NULL)
687     return NULL;
688 
689   if (supported == -1)
690     {
691       supported = gdk_win32_gl_query_wgl_extension (glconfig, "WGL_EXT_display_color_table");
692 
693       if (supported)
694         {
695           supported &= (gdk_gl_get_wglCreateDisplayColorTableEXT () != NULL);
696           supported &= (gdk_gl_get_wglLoadDisplayColorTableEXT () != NULL);
697           supported &= (gdk_gl_get_wglBindDisplayColorTableEXT () != NULL);
698           supported &= (gdk_gl_get_wglDestroyDisplayColorTableEXT () != NULL);
699         }
700     }
701 
702   GDK_GL_NOTE (MISC,
703     g_message (" - gdk_gl_get_WGL_EXT_display_color_table () - %s",
704                (supported) ? "supported" : "not supported"));
705 
706   if (!supported)
707     return NULL;
708 
709   return &_procs_WGL_EXT_display_color_table;
710 }
711 
712 /*
713  * WGL_EXT_extensions_string
714  */
715 
716 static GdkGL_WGL_EXT_extensions_string _procs_WGL_EXT_extensions_string = {
717   (GdkGLProc_wglGetExtensionsStringEXT) -1
718 };
719 
720 /* wglGetExtensionsStringEXT */
721 GdkGLProc
gdk_gl_get_wglGetExtensionsStringEXT(void)722 gdk_gl_get_wglGetExtensionsStringEXT (void)
723 {
724   if (wglGetCurrentContext () == NULL)
725     return NULL;
726 
727   if (_procs_WGL_EXT_extensions_string.wglGetExtensionsStringEXT == (GdkGLProc_wglGetExtensionsStringEXT) -1)
728     _procs_WGL_EXT_extensions_string.wglGetExtensionsStringEXT =
729       (GdkGLProc_wglGetExtensionsStringEXT) gdk_gl_get_proc_address ("wglGetExtensionsStringEXT");
730 
731   GDK_GL_NOTE (MISC,
732     g_message (" - gdk_gl_get_wglGetExtensionsStringEXT () - %s",
733                (_procs_WGL_EXT_extensions_string.wglGetExtensionsStringEXT) ? "supported" : "not supported"));
734 
735   return (GdkGLProc) (_procs_WGL_EXT_extensions_string.wglGetExtensionsStringEXT);
736 }
737 
738 /* Get WGL_EXT_extensions_string functions */
739 GdkGL_WGL_EXT_extensions_string *
gdk_gl_get_WGL_EXT_extensions_string(GdkGLConfig * glconfig)740 gdk_gl_get_WGL_EXT_extensions_string (GdkGLConfig *glconfig)
741 {
742   static gint supported = -1;
743 
744   if (wglGetCurrentContext () == NULL)
745     return NULL;
746 
747   if (supported == -1)
748     {
749       supported = gdk_win32_gl_query_wgl_extension (glconfig, "WGL_EXT_extensions_string");
750 
751       if (supported)
752         {
753           supported &= (gdk_gl_get_wglGetExtensionsStringEXT () != NULL);
754         }
755     }
756 
757   GDK_GL_NOTE (MISC,
758     g_message (" - gdk_gl_get_WGL_EXT_extensions_string () - %s",
759                (supported) ? "supported" : "not supported"));
760 
761   if (!supported)
762     return NULL;
763 
764   return &_procs_WGL_EXT_extensions_string;
765 }
766 
767 /*
768  * WGL_EXT_make_current_read
769  */
770 
771 static GdkGL_WGL_EXT_make_current_read _procs_WGL_EXT_make_current_read = {
772   (GdkGLProc_wglMakeContextCurrentEXT) -1,
773   (GdkGLProc_wglGetCurrentReadDCEXT) -1
774 };
775 
776 /* wglMakeContextCurrentEXT */
777 GdkGLProc
gdk_gl_get_wglMakeContextCurrentEXT(void)778 gdk_gl_get_wglMakeContextCurrentEXT (void)
779 {
780   if (wglGetCurrentContext () == NULL)
781     return NULL;
782 
783   if (_procs_WGL_EXT_make_current_read.wglMakeContextCurrentEXT == (GdkGLProc_wglMakeContextCurrentEXT) -1)
784     _procs_WGL_EXT_make_current_read.wglMakeContextCurrentEXT =
785       (GdkGLProc_wglMakeContextCurrentEXT) gdk_gl_get_proc_address ("wglMakeContextCurrentEXT");
786 
787   GDK_GL_NOTE (MISC,
788     g_message (" - gdk_gl_get_wglMakeContextCurrentEXT () - %s",
789                (_procs_WGL_EXT_make_current_read.wglMakeContextCurrentEXT) ? "supported" : "not supported"));
790 
791   return (GdkGLProc) (_procs_WGL_EXT_make_current_read.wglMakeContextCurrentEXT);
792 }
793 
794 /* wglGetCurrentReadDCEXT */
795 GdkGLProc
gdk_gl_get_wglGetCurrentReadDCEXT(void)796 gdk_gl_get_wglGetCurrentReadDCEXT (void)
797 {
798   if (wglGetCurrentContext () == NULL)
799     return NULL;
800 
801   if (_procs_WGL_EXT_make_current_read.wglGetCurrentReadDCEXT == (GdkGLProc_wglGetCurrentReadDCEXT) -1)
802     _procs_WGL_EXT_make_current_read.wglGetCurrentReadDCEXT =
803       (GdkGLProc_wglGetCurrentReadDCEXT) gdk_gl_get_proc_address ("wglGetCurrentReadDCEXT");
804 
805   GDK_GL_NOTE (MISC,
806     g_message (" - gdk_gl_get_wglGetCurrentReadDCEXT () - %s",
807                (_procs_WGL_EXT_make_current_read.wglGetCurrentReadDCEXT) ? "supported" : "not supported"));
808 
809   return (GdkGLProc) (_procs_WGL_EXT_make_current_read.wglGetCurrentReadDCEXT);
810 }
811 
812 /* Get WGL_EXT_make_current_read functions */
813 GdkGL_WGL_EXT_make_current_read *
gdk_gl_get_WGL_EXT_make_current_read(GdkGLConfig * glconfig)814 gdk_gl_get_WGL_EXT_make_current_read (GdkGLConfig *glconfig)
815 {
816   static gint supported = -1;
817 
818   if (wglGetCurrentContext () == NULL)
819     return NULL;
820 
821   if (supported == -1)
822     {
823       supported = gdk_win32_gl_query_wgl_extension (glconfig, "WGL_EXT_make_current_read");
824 
825       if (supported)
826         {
827           supported &= (gdk_gl_get_wglMakeContextCurrentEXT () != NULL);
828           supported &= (gdk_gl_get_wglGetCurrentReadDCEXT () != NULL);
829         }
830     }
831 
832   GDK_GL_NOTE (MISC,
833     g_message (" - gdk_gl_get_WGL_EXT_make_current_read () - %s",
834                (supported) ? "supported" : "not supported"));
835 
836   if (!supported)
837     return NULL;
838 
839   return &_procs_WGL_EXT_make_current_read;
840 }
841 
842 /*
843  * WGL_EXT_pbuffer
844  */
845 
846 static GdkGL_WGL_EXT_pbuffer _procs_WGL_EXT_pbuffer = {
847   (GdkGLProc_wglCreatePbufferEXT) -1,
848   (GdkGLProc_wglGetPbufferDCEXT) -1,
849   (GdkGLProc_wglReleasePbufferDCEXT) -1,
850   (GdkGLProc_wglDestroyPbufferEXT) -1,
851   (GdkGLProc_wglQueryPbufferEXT) -1
852 };
853 
854 /* wglCreatePbufferEXT */
855 GdkGLProc
gdk_gl_get_wglCreatePbufferEXT(void)856 gdk_gl_get_wglCreatePbufferEXT (void)
857 {
858   if (wglGetCurrentContext () == NULL)
859     return NULL;
860 
861   if (_procs_WGL_EXT_pbuffer.wglCreatePbufferEXT == (GdkGLProc_wglCreatePbufferEXT) -1)
862     _procs_WGL_EXT_pbuffer.wglCreatePbufferEXT =
863       (GdkGLProc_wglCreatePbufferEXT) gdk_gl_get_proc_address ("wglCreatePbufferEXT");
864 
865   GDK_GL_NOTE (MISC,
866     g_message (" - gdk_gl_get_wglCreatePbufferEXT () - %s",
867                (_procs_WGL_EXT_pbuffer.wglCreatePbufferEXT) ? "supported" : "not supported"));
868 
869   return (GdkGLProc) (_procs_WGL_EXT_pbuffer.wglCreatePbufferEXT);
870 }
871 
872 /* wglGetPbufferDCEXT */
873 GdkGLProc
gdk_gl_get_wglGetPbufferDCEXT(void)874 gdk_gl_get_wglGetPbufferDCEXT (void)
875 {
876   if (wglGetCurrentContext () == NULL)
877     return NULL;
878 
879   if (_procs_WGL_EXT_pbuffer.wglGetPbufferDCEXT == (GdkGLProc_wglGetPbufferDCEXT) -1)
880     _procs_WGL_EXT_pbuffer.wglGetPbufferDCEXT =
881       (GdkGLProc_wglGetPbufferDCEXT) gdk_gl_get_proc_address ("wglGetPbufferDCEXT");
882 
883   GDK_GL_NOTE (MISC,
884     g_message (" - gdk_gl_get_wglGetPbufferDCEXT () - %s",
885                (_procs_WGL_EXT_pbuffer.wglGetPbufferDCEXT) ? "supported" : "not supported"));
886 
887   return (GdkGLProc) (_procs_WGL_EXT_pbuffer.wglGetPbufferDCEXT);
888 }
889 
890 /* wglReleasePbufferDCEXT */
891 GdkGLProc
gdk_gl_get_wglReleasePbufferDCEXT(void)892 gdk_gl_get_wglReleasePbufferDCEXT (void)
893 {
894   if (wglGetCurrentContext () == NULL)
895     return NULL;
896 
897   if (_procs_WGL_EXT_pbuffer.wglReleasePbufferDCEXT == (GdkGLProc_wglReleasePbufferDCEXT) -1)
898     _procs_WGL_EXT_pbuffer.wglReleasePbufferDCEXT =
899       (GdkGLProc_wglReleasePbufferDCEXT) gdk_gl_get_proc_address ("wglReleasePbufferDCEXT");
900 
901   GDK_GL_NOTE (MISC,
902     g_message (" - gdk_gl_get_wglReleasePbufferDCEXT () - %s",
903                (_procs_WGL_EXT_pbuffer.wglReleasePbufferDCEXT) ? "supported" : "not supported"));
904 
905   return (GdkGLProc) (_procs_WGL_EXT_pbuffer.wglReleasePbufferDCEXT);
906 }
907 
908 /* wglDestroyPbufferEXT */
909 GdkGLProc
gdk_gl_get_wglDestroyPbufferEXT(void)910 gdk_gl_get_wglDestroyPbufferEXT (void)
911 {
912   if (wglGetCurrentContext () == NULL)
913     return NULL;
914 
915   if (_procs_WGL_EXT_pbuffer.wglDestroyPbufferEXT == (GdkGLProc_wglDestroyPbufferEXT) -1)
916     _procs_WGL_EXT_pbuffer.wglDestroyPbufferEXT =
917       (GdkGLProc_wglDestroyPbufferEXT) gdk_gl_get_proc_address ("wglDestroyPbufferEXT");
918 
919   GDK_GL_NOTE (MISC,
920     g_message (" - gdk_gl_get_wglDestroyPbufferEXT () - %s",
921                (_procs_WGL_EXT_pbuffer.wglDestroyPbufferEXT) ? "supported" : "not supported"));
922 
923   return (GdkGLProc) (_procs_WGL_EXT_pbuffer.wglDestroyPbufferEXT);
924 }
925 
926 /* wglQueryPbufferEXT */
927 GdkGLProc
gdk_gl_get_wglQueryPbufferEXT(void)928 gdk_gl_get_wglQueryPbufferEXT (void)
929 {
930   if (wglGetCurrentContext () == NULL)
931     return NULL;
932 
933   if (_procs_WGL_EXT_pbuffer.wglQueryPbufferEXT == (GdkGLProc_wglQueryPbufferEXT) -1)
934     _procs_WGL_EXT_pbuffer.wglQueryPbufferEXT =
935       (GdkGLProc_wglQueryPbufferEXT) gdk_gl_get_proc_address ("wglQueryPbufferEXT");
936 
937   GDK_GL_NOTE (MISC,
938     g_message (" - gdk_gl_get_wglQueryPbufferEXT () - %s",
939                (_procs_WGL_EXT_pbuffer.wglQueryPbufferEXT) ? "supported" : "not supported"));
940 
941   return (GdkGLProc) (_procs_WGL_EXT_pbuffer.wglQueryPbufferEXT);
942 }
943 
944 /* Get WGL_EXT_pbuffer functions */
945 GdkGL_WGL_EXT_pbuffer *
gdk_gl_get_WGL_EXT_pbuffer(GdkGLConfig * glconfig)946 gdk_gl_get_WGL_EXT_pbuffer (GdkGLConfig *glconfig)
947 {
948   static gint supported = -1;
949 
950   if (wglGetCurrentContext () == NULL)
951     return NULL;
952 
953   if (supported == -1)
954     {
955       supported = gdk_win32_gl_query_wgl_extension (glconfig, "WGL_EXT_pbuffer");
956 
957       if (supported)
958         {
959           supported &= (gdk_gl_get_wglCreatePbufferEXT () != NULL);
960           supported &= (gdk_gl_get_wglGetPbufferDCEXT () != NULL);
961           supported &= (gdk_gl_get_wglReleasePbufferDCEXT () != NULL);
962           supported &= (gdk_gl_get_wglDestroyPbufferEXT () != NULL);
963           supported &= (gdk_gl_get_wglQueryPbufferEXT () != NULL);
964         }
965     }
966 
967   GDK_GL_NOTE (MISC,
968     g_message (" - gdk_gl_get_WGL_EXT_pbuffer () - %s",
969                (supported) ? "supported" : "not supported"));
970 
971   if (!supported)
972     return NULL;
973 
974   return &_procs_WGL_EXT_pbuffer;
975 }
976 
977 /*
978  * WGL_EXT_pixel_format
979  */
980 
981 static GdkGL_WGL_EXT_pixel_format _procs_WGL_EXT_pixel_format = {
982   (GdkGLProc_wglGetPixelFormatAttribivEXT) -1,
983   (GdkGLProc_wglGetPixelFormatAttribfvEXT) -1,
984   (GdkGLProc_wglChoosePixelFormatEXT) -1
985 };
986 
987 /* wglGetPixelFormatAttribivEXT */
988 GdkGLProc
gdk_gl_get_wglGetPixelFormatAttribivEXT(void)989 gdk_gl_get_wglGetPixelFormatAttribivEXT (void)
990 {
991   if (wglGetCurrentContext () == NULL)
992     return NULL;
993 
994   if (_procs_WGL_EXT_pixel_format.wglGetPixelFormatAttribivEXT == (GdkGLProc_wglGetPixelFormatAttribivEXT) -1)
995     _procs_WGL_EXT_pixel_format.wglGetPixelFormatAttribivEXT =
996       (GdkGLProc_wglGetPixelFormatAttribivEXT) gdk_gl_get_proc_address ("wglGetPixelFormatAttribivEXT");
997 
998   GDK_GL_NOTE (MISC,
999     g_message (" - gdk_gl_get_wglGetPixelFormatAttribivEXT () - %s",
1000                (_procs_WGL_EXT_pixel_format.wglGetPixelFormatAttribivEXT) ? "supported" : "not supported"));
1001 
1002   return (GdkGLProc) (_procs_WGL_EXT_pixel_format.wglGetPixelFormatAttribivEXT);
1003 }
1004 
1005 /* wglGetPixelFormatAttribfvEXT */
1006 GdkGLProc
gdk_gl_get_wglGetPixelFormatAttribfvEXT(void)1007 gdk_gl_get_wglGetPixelFormatAttribfvEXT (void)
1008 {
1009   if (wglGetCurrentContext () == NULL)
1010     return NULL;
1011 
1012   if (_procs_WGL_EXT_pixel_format.wglGetPixelFormatAttribfvEXT == (GdkGLProc_wglGetPixelFormatAttribfvEXT) -1)
1013     _procs_WGL_EXT_pixel_format.wglGetPixelFormatAttribfvEXT =
1014       (GdkGLProc_wglGetPixelFormatAttribfvEXT) gdk_gl_get_proc_address ("wglGetPixelFormatAttribfvEXT");
1015 
1016   GDK_GL_NOTE (MISC,
1017     g_message (" - gdk_gl_get_wglGetPixelFormatAttribfvEXT () - %s",
1018                (_procs_WGL_EXT_pixel_format.wglGetPixelFormatAttribfvEXT) ? "supported" : "not supported"));
1019 
1020   return (GdkGLProc) (_procs_WGL_EXT_pixel_format.wglGetPixelFormatAttribfvEXT);
1021 }
1022 
1023 /* wglChoosePixelFormatEXT */
1024 GdkGLProc
gdk_gl_get_wglChoosePixelFormatEXT(void)1025 gdk_gl_get_wglChoosePixelFormatEXT (void)
1026 {
1027   if (wglGetCurrentContext () == NULL)
1028     return NULL;
1029 
1030   if (_procs_WGL_EXT_pixel_format.wglChoosePixelFormatEXT == (GdkGLProc_wglChoosePixelFormatEXT) -1)
1031     _procs_WGL_EXT_pixel_format.wglChoosePixelFormatEXT =
1032       (GdkGLProc_wglChoosePixelFormatEXT) gdk_gl_get_proc_address ("wglChoosePixelFormatEXT");
1033 
1034   GDK_GL_NOTE (MISC,
1035     g_message (" - gdk_gl_get_wglChoosePixelFormatEXT () - %s",
1036                (_procs_WGL_EXT_pixel_format.wglChoosePixelFormatEXT) ? "supported" : "not supported"));
1037 
1038   return (GdkGLProc) (_procs_WGL_EXT_pixel_format.wglChoosePixelFormatEXT);
1039 }
1040 
1041 /* Get WGL_EXT_pixel_format functions */
1042 GdkGL_WGL_EXT_pixel_format *
gdk_gl_get_WGL_EXT_pixel_format(GdkGLConfig * glconfig)1043 gdk_gl_get_WGL_EXT_pixel_format (GdkGLConfig *glconfig)
1044 {
1045   static gint supported = -1;
1046 
1047   if (wglGetCurrentContext () == NULL)
1048     return NULL;
1049 
1050   if (supported == -1)
1051     {
1052       supported = gdk_win32_gl_query_wgl_extension (glconfig, "WGL_EXT_pixel_format");
1053 
1054       if (supported)
1055         {
1056           supported &= (gdk_gl_get_wglGetPixelFormatAttribivEXT () != NULL);
1057           supported &= (gdk_gl_get_wglGetPixelFormatAttribfvEXT () != NULL);
1058           supported &= (gdk_gl_get_wglChoosePixelFormatEXT () != NULL);
1059         }
1060     }
1061 
1062   GDK_GL_NOTE (MISC,
1063     g_message (" - gdk_gl_get_WGL_EXT_pixel_format () - %s",
1064                (supported) ? "supported" : "not supported"));
1065 
1066   if (!supported)
1067     return NULL;
1068 
1069   return &_procs_WGL_EXT_pixel_format;
1070 }
1071 
1072 /*
1073  * WGL_EXT_swap_control
1074  */
1075 
1076 static GdkGL_WGL_EXT_swap_control _procs_WGL_EXT_swap_control = {
1077   (GdkGLProc_wglSwapIntervalEXT) -1,
1078   (GdkGLProc_wglGetSwapIntervalEXT) -1
1079 };
1080 
1081 /* wglSwapIntervalEXT */
1082 GdkGLProc
gdk_gl_get_wglSwapIntervalEXT(void)1083 gdk_gl_get_wglSwapIntervalEXT (void)
1084 {
1085   if (wglGetCurrentContext () == NULL)
1086     return NULL;
1087 
1088   if (_procs_WGL_EXT_swap_control.wglSwapIntervalEXT == (GdkGLProc_wglSwapIntervalEXT) -1)
1089     _procs_WGL_EXT_swap_control.wglSwapIntervalEXT =
1090       (GdkGLProc_wglSwapIntervalEXT) gdk_gl_get_proc_address ("wglSwapIntervalEXT");
1091 
1092   GDK_GL_NOTE (MISC,
1093     g_message (" - gdk_gl_get_wglSwapIntervalEXT () - %s",
1094                (_procs_WGL_EXT_swap_control.wglSwapIntervalEXT) ? "supported" : "not supported"));
1095 
1096   return (GdkGLProc) (_procs_WGL_EXT_swap_control.wglSwapIntervalEXT);
1097 }
1098 
1099 /* wglGetSwapIntervalEXT */
1100 GdkGLProc
gdk_gl_get_wglGetSwapIntervalEXT(void)1101 gdk_gl_get_wglGetSwapIntervalEXT (void)
1102 {
1103   if (wglGetCurrentContext () == NULL)
1104     return NULL;
1105 
1106   if (_procs_WGL_EXT_swap_control.wglGetSwapIntervalEXT == (GdkGLProc_wglGetSwapIntervalEXT) -1)
1107     _procs_WGL_EXT_swap_control.wglGetSwapIntervalEXT =
1108       (GdkGLProc_wglGetSwapIntervalEXT) gdk_gl_get_proc_address ("wglGetSwapIntervalEXT");
1109 
1110   GDK_GL_NOTE (MISC,
1111     g_message (" - gdk_gl_get_wglGetSwapIntervalEXT () - %s",
1112                (_procs_WGL_EXT_swap_control.wglGetSwapIntervalEXT) ? "supported" : "not supported"));
1113 
1114   return (GdkGLProc) (_procs_WGL_EXT_swap_control.wglGetSwapIntervalEXT);
1115 }
1116 
1117 /* Get WGL_EXT_swap_control functions */
1118 GdkGL_WGL_EXT_swap_control *
gdk_gl_get_WGL_EXT_swap_control(GdkGLConfig * glconfig)1119 gdk_gl_get_WGL_EXT_swap_control (GdkGLConfig *glconfig)
1120 {
1121   static gint supported = -1;
1122 
1123   if (wglGetCurrentContext () == NULL)
1124     return NULL;
1125 
1126   if (supported == -1)
1127     {
1128       supported = gdk_win32_gl_query_wgl_extension (glconfig, "WGL_EXT_swap_control");
1129 
1130       if (supported)
1131         {
1132           supported &= (gdk_gl_get_wglSwapIntervalEXT () != NULL);
1133           supported &= (gdk_gl_get_wglGetSwapIntervalEXT () != NULL);
1134         }
1135     }
1136 
1137   GDK_GL_NOTE (MISC,
1138     g_message (" - gdk_gl_get_WGL_EXT_swap_control () - %s",
1139                (supported) ? "supported" : "not supported"));
1140 
1141   if (!supported)
1142     return NULL;
1143 
1144   return &_procs_WGL_EXT_swap_control;
1145 }
1146 
1147 /*
1148  * WGL_NV_vertex_array_range
1149  */
1150 
1151 static GdkGL_WGL_NV_vertex_array_range _procs_WGL_NV_vertex_array_range = {
1152   (GdkGLProc_wglAllocateMemoryNV) -1,
1153   (GdkGLProc_wglFreeMemoryNV) -1
1154 };
1155 
1156 /* wglAllocateMemoryNV */
1157 GdkGLProc
gdk_gl_get_wglAllocateMemoryNV(void)1158 gdk_gl_get_wglAllocateMemoryNV (void)
1159 {
1160   if (wglGetCurrentContext () == NULL)
1161     return NULL;
1162 
1163   if (_procs_WGL_NV_vertex_array_range.wglAllocateMemoryNV == (GdkGLProc_wglAllocateMemoryNV) -1)
1164     _procs_WGL_NV_vertex_array_range.wglAllocateMemoryNV =
1165       (GdkGLProc_wglAllocateMemoryNV) gdk_gl_get_proc_address ("wglAllocateMemoryNV");
1166 
1167   GDK_GL_NOTE (MISC,
1168     g_message (" - gdk_gl_get_wglAllocateMemoryNV () - %s",
1169                (_procs_WGL_NV_vertex_array_range.wglAllocateMemoryNV) ? "supported" : "not supported"));
1170 
1171   return (GdkGLProc) (_procs_WGL_NV_vertex_array_range.wglAllocateMemoryNV);
1172 }
1173 
1174 /* wglFreeMemoryNV */
1175 GdkGLProc
gdk_gl_get_wglFreeMemoryNV(void)1176 gdk_gl_get_wglFreeMemoryNV (void)
1177 {
1178   if (wglGetCurrentContext () == NULL)
1179     return NULL;
1180 
1181   if (_procs_WGL_NV_vertex_array_range.wglFreeMemoryNV == (GdkGLProc_wglFreeMemoryNV) -1)
1182     _procs_WGL_NV_vertex_array_range.wglFreeMemoryNV =
1183       (GdkGLProc_wglFreeMemoryNV) gdk_gl_get_proc_address ("wglFreeMemoryNV");
1184 
1185   GDK_GL_NOTE (MISC,
1186     g_message (" - gdk_gl_get_wglFreeMemoryNV () - %s",
1187                (_procs_WGL_NV_vertex_array_range.wglFreeMemoryNV) ? "supported" : "not supported"));
1188 
1189   return (GdkGLProc) (_procs_WGL_NV_vertex_array_range.wglFreeMemoryNV);
1190 }
1191 
1192 /* Get WGL_NV_vertex_array_range functions */
1193 GdkGL_WGL_NV_vertex_array_range *
gdk_gl_get_WGL_NV_vertex_array_range(GdkGLConfig * glconfig)1194 gdk_gl_get_WGL_NV_vertex_array_range (GdkGLConfig *glconfig)
1195 {
1196   static gint supported = -1;
1197 
1198   if (wglGetCurrentContext () == NULL)
1199     return NULL;
1200 
1201   if (supported == -1)
1202     {
1203       supported = gdk_win32_gl_query_wgl_extension (glconfig, "WGL_NV_vertex_array_range");
1204 
1205       if (supported)
1206         {
1207           supported &= (gdk_gl_get_wglAllocateMemoryNV () != NULL);
1208           supported &= (gdk_gl_get_wglFreeMemoryNV () != NULL);
1209         }
1210     }
1211 
1212   GDK_GL_NOTE (MISC,
1213     g_message (" - gdk_gl_get_WGL_NV_vertex_array_range () - %s",
1214                (supported) ? "supported" : "not supported"));
1215 
1216   if (!supported)
1217     return NULL;
1218 
1219   return &_procs_WGL_NV_vertex_array_range;
1220 }
1221 
1222 /*
1223  * WGL_OML_sync_control
1224  */
1225 
1226 static GdkGL_WGL_OML_sync_control _procs_WGL_OML_sync_control = {
1227   (GdkGLProc_wglGetSyncValuesOML) -1,
1228   (GdkGLProc_wglGetMscRateOML) -1,
1229   (GdkGLProc_wglSwapBuffersMscOML) -1,
1230   (GdkGLProc_wglSwapLayerBuffersMscOML) -1,
1231   (GdkGLProc_wglWaitForMscOML) -1,
1232   (GdkGLProc_wglWaitForSbcOML) -1
1233 };
1234 
1235 /* wglGetSyncValuesOML */
1236 GdkGLProc
gdk_gl_get_wglGetSyncValuesOML(void)1237 gdk_gl_get_wglGetSyncValuesOML (void)
1238 {
1239   if (wglGetCurrentContext () == NULL)
1240     return NULL;
1241 
1242   if (_procs_WGL_OML_sync_control.wglGetSyncValuesOML == (GdkGLProc_wglGetSyncValuesOML) -1)
1243     _procs_WGL_OML_sync_control.wglGetSyncValuesOML =
1244       (GdkGLProc_wglGetSyncValuesOML) gdk_gl_get_proc_address ("wglGetSyncValuesOML");
1245 
1246   GDK_GL_NOTE (MISC,
1247     g_message (" - gdk_gl_get_wglGetSyncValuesOML () - %s",
1248                (_procs_WGL_OML_sync_control.wglGetSyncValuesOML) ? "supported" : "not supported"));
1249 
1250   return (GdkGLProc) (_procs_WGL_OML_sync_control.wglGetSyncValuesOML);
1251 }
1252 
1253 /* wglGetMscRateOML */
1254 GdkGLProc
gdk_gl_get_wglGetMscRateOML(void)1255 gdk_gl_get_wglGetMscRateOML (void)
1256 {
1257   if (wglGetCurrentContext () == NULL)
1258     return NULL;
1259 
1260   if (_procs_WGL_OML_sync_control.wglGetMscRateOML == (GdkGLProc_wglGetMscRateOML) -1)
1261     _procs_WGL_OML_sync_control.wglGetMscRateOML =
1262       (GdkGLProc_wglGetMscRateOML) gdk_gl_get_proc_address ("wglGetMscRateOML");
1263 
1264   GDK_GL_NOTE (MISC,
1265     g_message (" - gdk_gl_get_wglGetMscRateOML () - %s",
1266                (_procs_WGL_OML_sync_control.wglGetMscRateOML) ? "supported" : "not supported"));
1267 
1268   return (GdkGLProc) (_procs_WGL_OML_sync_control.wglGetMscRateOML);
1269 }
1270 
1271 /* wglSwapBuffersMscOML */
1272 GdkGLProc
gdk_gl_get_wglSwapBuffersMscOML(void)1273 gdk_gl_get_wglSwapBuffersMscOML (void)
1274 {
1275   if (wglGetCurrentContext () == NULL)
1276     return NULL;
1277 
1278   if (_procs_WGL_OML_sync_control.wglSwapBuffersMscOML == (GdkGLProc_wglSwapBuffersMscOML) -1)
1279     _procs_WGL_OML_sync_control.wglSwapBuffersMscOML =
1280       (GdkGLProc_wglSwapBuffersMscOML) gdk_gl_get_proc_address ("wglSwapBuffersMscOML");
1281 
1282   GDK_GL_NOTE (MISC,
1283     g_message (" - gdk_gl_get_wglSwapBuffersMscOML () - %s",
1284                (_procs_WGL_OML_sync_control.wglSwapBuffersMscOML) ? "supported" : "not supported"));
1285 
1286   return (GdkGLProc) (_procs_WGL_OML_sync_control.wglSwapBuffersMscOML);
1287 }
1288 
1289 /* wglSwapLayerBuffersMscOML */
1290 GdkGLProc
gdk_gl_get_wglSwapLayerBuffersMscOML(void)1291 gdk_gl_get_wglSwapLayerBuffersMscOML (void)
1292 {
1293   if (wglGetCurrentContext () == NULL)
1294     return NULL;
1295 
1296   if (_procs_WGL_OML_sync_control.wglSwapLayerBuffersMscOML == (GdkGLProc_wglSwapLayerBuffersMscOML) -1)
1297     _procs_WGL_OML_sync_control.wglSwapLayerBuffersMscOML =
1298       (GdkGLProc_wglSwapLayerBuffersMscOML) gdk_gl_get_proc_address ("wglSwapLayerBuffersMscOML");
1299 
1300   GDK_GL_NOTE (MISC,
1301     g_message (" - gdk_gl_get_wglSwapLayerBuffersMscOML () - %s",
1302                (_procs_WGL_OML_sync_control.wglSwapLayerBuffersMscOML) ? "supported" : "not supported"));
1303 
1304   return (GdkGLProc) (_procs_WGL_OML_sync_control.wglSwapLayerBuffersMscOML);
1305 }
1306 
1307 /* wglWaitForMscOML */
1308 GdkGLProc
gdk_gl_get_wglWaitForMscOML(void)1309 gdk_gl_get_wglWaitForMscOML (void)
1310 {
1311   if (wglGetCurrentContext () == NULL)
1312     return NULL;
1313 
1314   if (_procs_WGL_OML_sync_control.wglWaitForMscOML == (GdkGLProc_wglWaitForMscOML) -1)
1315     _procs_WGL_OML_sync_control.wglWaitForMscOML =
1316       (GdkGLProc_wglWaitForMscOML) gdk_gl_get_proc_address ("wglWaitForMscOML");
1317 
1318   GDK_GL_NOTE (MISC,
1319     g_message (" - gdk_gl_get_wglWaitForMscOML () - %s",
1320                (_procs_WGL_OML_sync_control.wglWaitForMscOML) ? "supported" : "not supported"));
1321 
1322   return (GdkGLProc) (_procs_WGL_OML_sync_control.wglWaitForMscOML);
1323 }
1324 
1325 /* wglWaitForSbcOML */
1326 GdkGLProc
gdk_gl_get_wglWaitForSbcOML(void)1327 gdk_gl_get_wglWaitForSbcOML (void)
1328 {
1329   if (wglGetCurrentContext () == NULL)
1330     return NULL;
1331 
1332   if (_procs_WGL_OML_sync_control.wglWaitForSbcOML == (GdkGLProc_wglWaitForSbcOML) -1)
1333     _procs_WGL_OML_sync_control.wglWaitForSbcOML =
1334       (GdkGLProc_wglWaitForSbcOML) gdk_gl_get_proc_address ("wglWaitForSbcOML");
1335 
1336   GDK_GL_NOTE (MISC,
1337     g_message (" - gdk_gl_get_wglWaitForSbcOML () - %s",
1338                (_procs_WGL_OML_sync_control.wglWaitForSbcOML) ? "supported" : "not supported"));
1339 
1340   return (GdkGLProc) (_procs_WGL_OML_sync_control.wglWaitForSbcOML);
1341 }
1342 
1343 /* Get WGL_OML_sync_control functions */
1344 GdkGL_WGL_OML_sync_control *
gdk_gl_get_WGL_OML_sync_control(GdkGLConfig * glconfig)1345 gdk_gl_get_WGL_OML_sync_control (GdkGLConfig *glconfig)
1346 {
1347   static gint supported = -1;
1348 
1349   if (wglGetCurrentContext () == NULL)
1350     return NULL;
1351 
1352   if (supported == -1)
1353     {
1354       supported = gdk_win32_gl_query_wgl_extension (glconfig, "WGL_OML_sync_control");
1355 
1356       if (supported)
1357         {
1358           supported &= (gdk_gl_get_wglGetSyncValuesOML () != NULL);
1359           supported &= (gdk_gl_get_wglGetMscRateOML () != NULL);
1360           supported &= (gdk_gl_get_wglSwapBuffersMscOML () != NULL);
1361           supported &= (gdk_gl_get_wglSwapLayerBuffersMscOML () != NULL);
1362           supported &= (gdk_gl_get_wglWaitForMscOML () != NULL);
1363           supported &= (gdk_gl_get_wglWaitForSbcOML () != NULL);
1364         }
1365     }
1366 
1367   GDK_GL_NOTE (MISC,
1368     g_message (" - gdk_gl_get_WGL_OML_sync_control () - %s",
1369                (supported) ? "supported" : "not supported"));
1370 
1371   if (!supported)
1372     return NULL;
1373 
1374   return &_procs_WGL_OML_sync_control;
1375 }
1376 
1377 /*
1378  * WGL_I3D_digital_video_control
1379  */
1380 
1381 static GdkGL_WGL_I3D_digital_video_control _procs_WGL_I3D_digital_video_control = {
1382   (GdkGLProc_wglGetDigitalVideoParametersI3D) -1,
1383   (GdkGLProc_wglSetDigitalVideoParametersI3D) -1
1384 };
1385 
1386 /* wglGetDigitalVideoParametersI3D */
1387 GdkGLProc
gdk_gl_get_wglGetDigitalVideoParametersI3D(void)1388 gdk_gl_get_wglGetDigitalVideoParametersI3D (void)
1389 {
1390   if (wglGetCurrentContext () == NULL)
1391     return NULL;
1392 
1393   if (_procs_WGL_I3D_digital_video_control.wglGetDigitalVideoParametersI3D == (GdkGLProc_wglGetDigitalVideoParametersI3D) -1)
1394     _procs_WGL_I3D_digital_video_control.wglGetDigitalVideoParametersI3D =
1395       (GdkGLProc_wglGetDigitalVideoParametersI3D) gdk_gl_get_proc_address ("wglGetDigitalVideoParametersI3D");
1396 
1397   GDK_GL_NOTE (MISC,
1398     g_message (" - gdk_gl_get_wglGetDigitalVideoParametersI3D () - %s",
1399                (_procs_WGL_I3D_digital_video_control.wglGetDigitalVideoParametersI3D) ? "supported" : "not supported"));
1400 
1401   return (GdkGLProc) (_procs_WGL_I3D_digital_video_control.wglGetDigitalVideoParametersI3D);
1402 }
1403 
1404 /* wglSetDigitalVideoParametersI3D */
1405 GdkGLProc
gdk_gl_get_wglSetDigitalVideoParametersI3D(void)1406 gdk_gl_get_wglSetDigitalVideoParametersI3D (void)
1407 {
1408   if (wglGetCurrentContext () == NULL)
1409     return NULL;
1410 
1411   if (_procs_WGL_I3D_digital_video_control.wglSetDigitalVideoParametersI3D == (GdkGLProc_wglSetDigitalVideoParametersI3D) -1)
1412     _procs_WGL_I3D_digital_video_control.wglSetDigitalVideoParametersI3D =
1413       (GdkGLProc_wglSetDigitalVideoParametersI3D) gdk_gl_get_proc_address ("wglSetDigitalVideoParametersI3D");
1414 
1415   GDK_GL_NOTE (MISC,
1416     g_message (" - gdk_gl_get_wglSetDigitalVideoParametersI3D () - %s",
1417                (_procs_WGL_I3D_digital_video_control.wglSetDigitalVideoParametersI3D) ? "supported" : "not supported"));
1418 
1419   return (GdkGLProc) (_procs_WGL_I3D_digital_video_control.wglSetDigitalVideoParametersI3D);
1420 }
1421 
1422 /* Get WGL_I3D_digital_video_control functions */
1423 GdkGL_WGL_I3D_digital_video_control *
gdk_gl_get_WGL_I3D_digital_video_control(GdkGLConfig * glconfig)1424 gdk_gl_get_WGL_I3D_digital_video_control (GdkGLConfig *glconfig)
1425 {
1426   static gint supported = -1;
1427 
1428   if (wglGetCurrentContext () == NULL)
1429     return NULL;
1430 
1431   if (supported == -1)
1432     {
1433       supported = gdk_win32_gl_query_wgl_extension (glconfig, "WGL_I3D_digital_video_control");
1434 
1435       if (supported)
1436         {
1437           supported &= (gdk_gl_get_wglGetDigitalVideoParametersI3D () != NULL);
1438           supported &= (gdk_gl_get_wglSetDigitalVideoParametersI3D () != NULL);
1439         }
1440     }
1441 
1442   GDK_GL_NOTE (MISC,
1443     g_message (" - gdk_gl_get_WGL_I3D_digital_video_control () - %s",
1444                (supported) ? "supported" : "not supported"));
1445 
1446   if (!supported)
1447     return NULL;
1448 
1449   return &_procs_WGL_I3D_digital_video_control;
1450 }
1451 
1452 /*
1453  * WGL_I3D_gamma
1454  */
1455 
1456 static GdkGL_WGL_I3D_gamma _procs_WGL_I3D_gamma = {
1457   (GdkGLProc_wglGetGammaTableParametersI3D) -1,
1458   (GdkGLProc_wglSetGammaTableParametersI3D) -1,
1459   (GdkGLProc_wglGetGammaTableI3D) -1,
1460   (GdkGLProc_wglSetGammaTableI3D) -1
1461 };
1462 
1463 /* wglGetGammaTableParametersI3D */
1464 GdkGLProc
gdk_gl_get_wglGetGammaTableParametersI3D(void)1465 gdk_gl_get_wglGetGammaTableParametersI3D (void)
1466 {
1467   if (wglGetCurrentContext () == NULL)
1468     return NULL;
1469 
1470   if (_procs_WGL_I3D_gamma.wglGetGammaTableParametersI3D == (GdkGLProc_wglGetGammaTableParametersI3D) -1)
1471     _procs_WGL_I3D_gamma.wglGetGammaTableParametersI3D =
1472       (GdkGLProc_wglGetGammaTableParametersI3D) gdk_gl_get_proc_address ("wglGetGammaTableParametersI3D");
1473 
1474   GDK_GL_NOTE (MISC,
1475     g_message (" - gdk_gl_get_wglGetGammaTableParametersI3D () - %s",
1476                (_procs_WGL_I3D_gamma.wglGetGammaTableParametersI3D) ? "supported" : "not supported"));
1477 
1478   return (GdkGLProc) (_procs_WGL_I3D_gamma.wglGetGammaTableParametersI3D);
1479 }
1480 
1481 /* wglSetGammaTableParametersI3D */
1482 GdkGLProc
gdk_gl_get_wglSetGammaTableParametersI3D(void)1483 gdk_gl_get_wglSetGammaTableParametersI3D (void)
1484 {
1485   if (wglGetCurrentContext () == NULL)
1486     return NULL;
1487 
1488   if (_procs_WGL_I3D_gamma.wglSetGammaTableParametersI3D == (GdkGLProc_wglSetGammaTableParametersI3D) -1)
1489     _procs_WGL_I3D_gamma.wglSetGammaTableParametersI3D =
1490       (GdkGLProc_wglSetGammaTableParametersI3D) gdk_gl_get_proc_address ("wglSetGammaTableParametersI3D");
1491 
1492   GDK_GL_NOTE (MISC,
1493     g_message (" - gdk_gl_get_wglSetGammaTableParametersI3D () - %s",
1494                (_procs_WGL_I3D_gamma.wglSetGammaTableParametersI3D) ? "supported" : "not supported"));
1495 
1496   return (GdkGLProc) (_procs_WGL_I3D_gamma.wglSetGammaTableParametersI3D);
1497 }
1498 
1499 /* wglGetGammaTableI3D */
1500 GdkGLProc
gdk_gl_get_wglGetGammaTableI3D(void)1501 gdk_gl_get_wglGetGammaTableI3D (void)
1502 {
1503   if (wglGetCurrentContext () == NULL)
1504     return NULL;
1505 
1506   if (_procs_WGL_I3D_gamma.wglGetGammaTableI3D == (GdkGLProc_wglGetGammaTableI3D) -1)
1507     _procs_WGL_I3D_gamma.wglGetGammaTableI3D =
1508       (GdkGLProc_wglGetGammaTableI3D) gdk_gl_get_proc_address ("wglGetGammaTableI3D");
1509 
1510   GDK_GL_NOTE (MISC,
1511     g_message (" - gdk_gl_get_wglGetGammaTableI3D () - %s",
1512                (_procs_WGL_I3D_gamma.wglGetGammaTableI3D) ? "supported" : "not supported"));
1513 
1514   return (GdkGLProc) (_procs_WGL_I3D_gamma.wglGetGammaTableI3D);
1515 }
1516 
1517 /* wglSetGammaTableI3D */
1518 GdkGLProc
gdk_gl_get_wglSetGammaTableI3D(void)1519 gdk_gl_get_wglSetGammaTableI3D (void)
1520 {
1521   if (wglGetCurrentContext () == NULL)
1522     return NULL;
1523 
1524   if (_procs_WGL_I3D_gamma.wglSetGammaTableI3D == (GdkGLProc_wglSetGammaTableI3D) -1)
1525     _procs_WGL_I3D_gamma.wglSetGammaTableI3D =
1526       (GdkGLProc_wglSetGammaTableI3D) gdk_gl_get_proc_address ("wglSetGammaTableI3D");
1527 
1528   GDK_GL_NOTE (MISC,
1529     g_message (" - gdk_gl_get_wglSetGammaTableI3D () - %s",
1530                (_procs_WGL_I3D_gamma.wglSetGammaTableI3D) ? "supported" : "not supported"));
1531 
1532   return (GdkGLProc) (_procs_WGL_I3D_gamma.wglSetGammaTableI3D);
1533 }
1534 
1535 /* Get WGL_I3D_gamma functions */
1536 GdkGL_WGL_I3D_gamma *
gdk_gl_get_WGL_I3D_gamma(GdkGLConfig * glconfig)1537 gdk_gl_get_WGL_I3D_gamma (GdkGLConfig *glconfig)
1538 {
1539   static gint supported = -1;
1540 
1541   if (wglGetCurrentContext () == NULL)
1542     return NULL;
1543 
1544   if (supported == -1)
1545     {
1546       supported = gdk_win32_gl_query_wgl_extension (glconfig, "WGL_I3D_gamma");
1547 
1548       if (supported)
1549         {
1550           supported &= (gdk_gl_get_wglGetGammaTableParametersI3D () != NULL);
1551           supported &= (gdk_gl_get_wglSetGammaTableParametersI3D () != NULL);
1552           supported &= (gdk_gl_get_wglGetGammaTableI3D () != NULL);
1553           supported &= (gdk_gl_get_wglSetGammaTableI3D () != NULL);
1554         }
1555     }
1556 
1557   GDK_GL_NOTE (MISC,
1558     g_message (" - gdk_gl_get_WGL_I3D_gamma () - %s",
1559                (supported) ? "supported" : "not supported"));
1560 
1561   if (!supported)
1562     return NULL;
1563 
1564   return &_procs_WGL_I3D_gamma;
1565 }
1566 
1567 /*
1568  * WGL_I3D_genlock
1569  */
1570 
1571 static GdkGL_WGL_I3D_genlock _procs_WGL_I3D_genlock = {
1572   (GdkGLProc_wglEnableGenlockI3D) -1,
1573   (GdkGLProc_wglDisableGenlockI3D) -1,
1574   (GdkGLProc_wglIsEnabledGenlockI3D) -1,
1575   (GdkGLProc_wglGenlockSourceI3D) -1,
1576   (GdkGLProc_wglGetGenlockSourceI3D) -1,
1577   (GdkGLProc_wglGenlockSourceEdgeI3D) -1,
1578   (GdkGLProc_wglGetGenlockSourceEdgeI3D) -1,
1579   (GdkGLProc_wglGenlockSampleRateI3D) -1,
1580   (GdkGLProc_wglGetGenlockSampleRateI3D) -1,
1581   (GdkGLProc_wglGenlockSourceDelayI3D) -1,
1582   (GdkGLProc_wglGetGenlockSourceDelayI3D) -1,
1583   (GdkGLProc_wglQueryGenlockMaxSourceDelayI3D) -1
1584 };
1585 
1586 /* wglEnableGenlockI3D */
1587 GdkGLProc
gdk_gl_get_wglEnableGenlockI3D(void)1588 gdk_gl_get_wglEnableGenlockI3D (void)
1589 {
1590   if (wglGetCurrentContext () == NULL)
1591     return NULL;
1592 
1593   if (_procs_WGL_I3D_genlock.wglEnableGenlockI3D == (GdkGLProc_wglEnableGenlockI3D) -1)
1594     _procs_WGL_I3D_genlock.wglEnableGenlockI3D =
1595       (GdkGLProc_wglEnableGenlockI3D) gdk_gl_get_proc_address ("wglEnableGenlockI3D");
1596 
1597   GDK_GL_NOTE (MISC,
1598     g_message (" - gdk_gl_get_wglEnableGenlockI3D () - %s",
1599                (_procs_WGL_I3D_genlock.wglEnableGenlockI3D) ? "supported" : "not supported"));
1600 
1601   return (GdkGLProc) (_procs_WGL_I3D_genlock.wglEnableGenlockI3D);
1602 }
1603 
1604 /* wglDisableGenlockI3D */
1605 GdkGLProc
gdk_gl_get_wglDisableGenlockI3D(void)1606 gdk_gl_get_wglDisableGenlockI3D (void)
1607 {
1608   if (wglGetCurrentContext () == NULL)
1609     return NULL;
1610 
1611   if (_procs_WGL_I3D_genlock.wglDisableGenlockI3D == (GdkGLProc_wglDisableGenlockI3D) -1)
1612     _procs_WGL_I3D_genlock.wglDisableGenlockI3D =
1613       (GdkGLProc_wglDisableGenlockI3D) gdk_gl_get_proc_address ("wglDisableGenlockI3D");
1614 
1615   GDK_GL_NOTE (MISC,
1616     g_message (" - gdk_gl_get_wglDisableGenlockI3D () - %s",
1617                (_procs_WGL_I3D_genlock.wglDisableGenlockI3D) ? "supported" : "not supported"));
1618 
1619   return (GdkGLProc) (_procs_WGL_I3D_genlock.wglDisableGenlockI3D);
1620 }
1621 
1622 /* wglIsEnabledGenlockI3D */
1623 GdkGLProc
gdk_gl_get_wglIsEnabledGenlockI3D(void)1624 gdk_gl_get_wglIsEnabledGenlockI3D (void)
1625 {
1626   if (wglGetCurrentContext () == NULL)
1627     return NULL;
1628 
1629   if (_procs_WGL_I3D_genlock.wglIsEnabledGenlockI3D == (GdkGLProc_wglIsEnabledGenlockI3D) -1)
1630     _procs_WGL_I3D_genlock.wglIsEnabledGenlockI3D =
1631       (GdkGLProc_wglIsEnabledGenlockI3D) gdk_gl_get_proc_address ("wglIsEnabledGenlockI3D");
1632 
1633   GDK_GL_NOTE (MISC,
1634     g_message (" - gdk_gl_get_wglIsEnabledGenlockI3D () - %s",
1635                (_procs_WGL_I3D_genlock.wglIsEnabledGenlockI3D) ? "supported" : "not supported"));
1636 
1637   return (GdkGLProc) (_procs_WGL_I3D_genlock.wglIsEnabledGenlockI3D);
1638 }
1639 
1640 /* wglGenlockSourceI3D */
1641 GdkGLProc
gdk_gl_get_wglGenlockSourceI3D(void)1642 gdk_gl_get_wglGenlockSourceI3D (void)
1643 {
1644   if (wglGetCurrentContext () == NULL)
1645     return NULL;
1646 
1647   if (_procs_WGL_I3D_genlock.wglGenlockSourceI3D == (GdkGLProc_wglGenlockSourceI3D) -1)
1648     _procs_WGL_I3D_genlock.wglGenlockSourceI3D =
1649       (GdkGLProc_wglGenlockSourceI3D) gdk_gl_get_proc_address ("wglGenlockSourceI3D");
1650 
1651   GDK_GL_NOTE (MISC,
1652     g_message (" - gdk_gl_get_wglGenlockSourceI3D () - %s",
1653                (_procs_WGL_I3D_genlock.wglGenlockSourceI3D) ? "supported" : "not supported"));
1654 
1655   return (GdkGLProc) (_procs_WGL_I3D_genlock.wglGenlockSourceI3D);
1656 }
1657 
1658 /* wglGetGenlockSourceI3D */
1659 GdkGLProc
gdk_gl_get_wglGetGenlockSourceI3D(void)1660 gdk_gl_get_wglGetGenlockSourceI3D (void)
1661 {
1662   if (wglGetCurrentContext () == NULL)
1663     return NULL;
1664 
1665   if (_procs_WGL_I3D_genlock.wglGetGenlockSourceI3D == (GdkGLProc_wglGetGenlockSourceI3D) -1)
1666     _procs_WGL_I3D_genlock.wglGetGenlockSourceI3D =
1667       (GdkGLProc_wglGetGenlockSourceI3D) gdk_gl_get_proc_address ("wglGetGenlockSourceI3D");
1668 
1669   GDK_GL_NOTE (MISC,
1670     g_message (" - gdk_gl_get_wglGetGenlockSourceI3D () - %s",
1671                (_procs_WGL_I3D_genlock.wglGetGenlockSourceI3D) ? "supported" : "not supported"));
1672 
1673   return (GdkGLProc) (_procs_WGL_I3D_genlock.wglGetGenlockSourceI3D);
1674 }
1675 
1676 /* wglGenlockSourceEdgeI3D */
1677 GdkGLProc
gdk_gl_get_wglGenlockSourceEdgeI3D(void)1678 gdk_gl_get_wglGenlockSourceEdgeI3D (void)
1679 {
1680   if (wglGetCurrentContext () == NULL)
1681     return NULL;
1682 
1683   if (_procs_WGL_I3D_genlock.wglGenlockSourceEdgeI3D == (GdkGLProc_wglGenlockSourceEdgeI3D) -1)
1684     _procs_WGL_I3D_genlock.wglGenlockSourceEdgeI3D =
1685       (GdkGLProc_wglGenlockSourceEdgeI3D) gdk_gl_get_proc_address ("wglGenlockSourceEdgeI3D");
1686 
1687   GDK_GL_NOTE (MISC,
1688     g_message (" - gdk_gl_get_wglGenlockSourceEdgeI3D () - %s",
1689                (_procs_WGL_I3D_genlock.wglGenlockSourceEdgeI3D) ? "supported" : "not supported"));
1690 
1691   return (GdkGLProc) (_procs_WGL_I3D_genlock.wglGenlockSourceEdgeI3D);
1692 }
1693 
1694 /* wglGetGenlockSourceEdgeI3D */
1695 GdkGLProc
gdk_gl_get_wglGetGenlockSourceEdgeI3D(void)1696 gdk_gl_get_wglGetGenlockSourceEdgeI3D (void)
1697 {
1698   if (wglGetCurrentContext () == NULL)
1699     return NULL;
1700 
1701   if (_procs_WGL_I3D_genlock.wglGetGenlockSourceEdgeI3D == (GdkGLProc_wglGetGenlockSourceEdgeI3D) -1)
1702     _procs_WGL_I3D_genlock.wglGetGenlockSourceEdgeI3D =
1703       (GdkGLProc_wglGetGenlockSourceEdgeI3D) gdk_gl_get_proc_address ("wglGetGenlockSourceEdgeI3D");
1704 
1705   GDK_GL_NOTE (MISC,
1706     g_message (" - gdk_gl_get_wglGetGenlockSourceEdgeI3D () - %s",
1707                (_procs_WGL_I3D_genlock.wglGetGenlockSourceEdgeI3D) ? "supported" : "not supported"));
1708 
1709   return (GdkGLProc) (_procs_WGL_I3D_genlock.wglGetGenlockSourceEdgeI3D);
1710 }
1711 
1712 /* wglGenlockSampleRateI3D */
1713 GdkGLProc
gdk_gl_get_wglGenlockSampleRateI3D(void)1714 gdk_gl_get_wglGenlockSampleRateI3D (void)
1715 {
1716   if (wglGetCurrentContext () == NULL)
1717     return NULL;
1718 
1719   if (_procs_WGL_I3D_genlock.wglGenlockSampleRateI3D == (GdkGLProc_wglGenlockSampleRateI3D) -1)
1720     _procs_WGL_I3D_genlock.wglGenlockSampleRateI3D =
1721       (GdkGLProc_wglGenlockSampleRateI3D) gdk_gl_get_proc_address ("wglGenlockSampleRateI3D");
1722 
1723   GDK_GL_NOTE (MISC,
1724     g_message (" - gdk_gl_get_wglGenlockSampleRateI3D () - %s",
1725                (_procs_WGL_I3D_genlock.wglGenlockSampleRateI3D) ? "supported" : "not supported"));
1726 
1727   return (GdkGLProc) (_procs_WGL_I3D_genlock.wglGenlockSampleRateI3D);
1728 }
1729 
1730 /* wglGetGenlockSampleRateI3D */
1731 GdkGLProc
gdk_gl_get_wglGetGenlockSampleRateI3D(void)1732 gdk_gl_get_wglGetGenlockSampleRateI3D (void)
1733 {
1734   if (wglGetCurrentContext () == NULL)
1735     return NULL;
1736 
1737   if (_procs_WGL_I3D_genlock.wglGetGenlockSampleRateI3D == (GdkGLProc_wglGetGenlockSampleRateI3D) -1)
1738     _procs_WGL_I3D_genlock.wglGetGenlockSampleRateI3D =
1739       (GdkGLProc_wglGetGenlockSampleRateI3D) gdk_gl_get_proc_address ("wglGetGenlockSampleRateI3D");
1740 
1741   GDK_GL_NOTE (MISC,
1742     g_message (" - gdk_gl_get_wglGetGenlockSampleRateI3D () - %s",
1743                (_procs_WGL_I3D_genlock.wglGetGenlockSampleRateI3D) ? "supported" : "not supported"));
1744 
1745   return (GdkGLProc) (_procs_WGL_I3D_genlock.wglGetGenlockSampleRateI3D);
1746 }
1747 
1748 /* wglGenlockSourceDelayI3D */
1749 GdkGLProc
gdk_gl_get_wglGenlockSourceDelayI3D(void)1750 gdk_gl_get_wglGenlockSourceDelayI3D (void)
1751 {
1752   if (wglGetCurrentContext () == NULL)
1753     return NULL;
1754 
1755   if (_procs_WGL_I3D_genlock.wglGenlockSourceDelayI3D == (GdkGLProc_wglGenlockSourceDelayI3D) -1)
1756     _procs_WGL_I3D_genlock.wglGenlockSourceDelayI3D =
1757       (GdkGLProc_wglGenlockSourceDelayI3D) gdk_gl_get_proc_address ("wglGenlockSourceDelayI3D");
1758 
1759   GDK_GL_NOTE (MISC,
1760     g_message (" - gdk_gl_get_wglGenlockSourceDelayI3D () - %s",
1761                (_procs_WGL_I3D_genlock.wglGenlockSourceDelayI3D) ? "supported" : "not supported"));
1762 
1763   return (GdkGLProc) (_procs_WGL_I3D_genlock.wglGenlockSourceDelayI3D);
1764 }
1765 
1766 /* wglGetGenlockSourceDelayI3D */
1767 GdkGLProc
gdk_gl_get_wglGetGenlockSourceDelayI3D(void)1768 gdk_gl_get_wglGetGenlockSourceDelayI3D (void)
1769 {
1770   if (wglGetCurrentContext () == NULL)
1771     return NULL;
1772 
1773   if (_procs_WGL_I3D_genlock.wglGetGenlockSourceDelayI3D == (GdkGLProc_wglGetGenlockSourceDelayI3D) -1)
1774     _procs_WGL_I3D_genlock.wglGetGenlockSourceDelayI3D =
1775       (GdkGLProc_wglGetGenlockSourceDelayI3D) gdk_gl_get_proc_address ("wglGetGenlockSourceDelayI3D");
1776 
1777   GDK_GL_NOTE (MISC,
1778     g_message (" - gdk_gl_get_wglGetGenlockSourceDelayI3D () - %s",
1779                (_procs_WGL_I3D_genlock.wglGetGenlockSourceDelayI3D) ? "supported" : "not supported"));
1780 
1781   return (GdkGLProc) (_procs_WGL_I3D_genlock.wglGetGenlockSourceDelayI3D);
1782 }
1783 
1784 /* wglQueryGenlockMaxSourceDelayI3D */
1785 GdkGLProc
gdk_gl_get_wglQueryGenlockMaxSourceDelayI3D(void)1786 gdk_gl_get_wglQueryGenlockMaxSourceDelayI3D (void)
1787 {
1788   if (wglGetCurrentContext () == NULL)
1789     return NULL;
1790 
1791   if (_procs_WGL_I3D_genlock.wglQueryGenlockMaxSourceDelayI3D == (GdkGLProc_wglQueryGenlockMaxSourceDelayI3D) -1)
1792     _procs_WGL_I3D_genlock.wglQueryGenlockMaxSourceDelayI3D =
1793       (GdkGLProc_wglQueryGenlockMaxSourceDelayI3D) gdk_gl_get_proc_address ("wglQueryGenlockMaxSourceDelayI3D");
1794 
1795   GDK_GL_NOTE (MISC,
1796     g_message (" - gdk_gl_get_wglQueryGenlockMaxSourceDelayI3D () - %s",
1797                (_procs_WGL_I3D_genlock.wglQueryGenlockMaxSourceDelayI3D) ? "supported" : "not supported"));
1798 
1799   return (GdkGLProc) (_procs_WGL_I3D_genlock.wglQueryGenlockMaxSourceDelayI3D);
1800 }
1801 
1802 /* Get WGL_I3D_genlock functions */
1803 GdkGL_WGL_I3D_genlock *
gdk_gl_get_WGL_I3D_genlock(GdkGLConfig * glconfig)1804 gdk_gl_get_WGL_I3D_genlock (GdkGLConfig *glconfig)
1805 {
1806   static gint supported = -1;
1807 
1808   if (wglGetCurrentContext () == NULL)
1809     return NULL;
1810 
1811   if (supported == -1)
1812     {
1813       supported = gdk_win32_gl_query_wgl_extension (glconfig, "WGL_I3D_genlock");
1814 
1815       if (supported)
1816         {
1817           supported &= (gdk_gl_get_wglEnableGenlockI3D () != NULL);
1818           supported &= (gdk_gl_get_wglDisableGenlockI3D () != NULL);
1819           supported &= (gdk_gl_get_wglIsEnabledGenlockI3D () != NULL);
1820           supported &= (gdk_gl_get_wglGenlockSourceI3D () != NULL);
1821           supported &= (gdk_gl_get_wglGetGenlockSourceI3D () != NULL);
1822           supported &= (gdk_gl_get_wglGenlockSourceEdgeI3D () != NULL);
1823           supported &= (gdk_gl_get_wglGetGenlockSourceEdgeI3D () != NULL);
1824           supported &= (gdk_gl_get_wglGenlockSampleRateI3D () != NULL);
1825           supported &= (gdk_gl_get_wglGetGenlockSampleRateI3D () != NULL);
1826           supported &= (gdk_gl_get_wglGenlockSourceDelayI3D () != NULL);
1827           supported &= (gdk_gl_get_wglGetGenlockSourceDelayI3D () != NULL);
1828           supported &= (gdk_gl_get_wglQueryGenlockMaxSourceDelayI3D () != NULL);
1829         }
1830     }
1831 
1832   GDK_GL_NOTE (MISC,
1833     g_message (" - gdk_gl_get_WGL_I3D_genlock () - %s",
1834                (supported) ? "supported" : "not supported"));
1835 
1836   if (!supported)
1837     return NULL;
1838 
1839   return &_procs_WGL_I3D_genlock;
1840 }
1841 
1842 /*
1843  * WGL_I3D_image_buffer
1844  */
1845 
1846 static GdkGL_WGL_I3D_image_buffer _procs_WGL_I3D_image_buffer = {
1847   (GdkGLProc_wglCreateImageBufferI3D) -1,
1848   (GdkGLProc_wglDestroyImageBufferI3D) -1,
1849   (GdkGLProc_wglAssociateImageBufferEventsI3D) -1,
1850   (GdkGLProc_wglReleaseImageBufferEventsI3D) -1
1851 };
1852 
1853 /* wglCreateImageBufferI3D */
1854 GdkGLProc
gdk_gl_get_wglCreateImageBufferI3D(void)1855 gdk_gl_get_wglCreateImageBufferI3D (void)
1856 {
1857   if (wglGetCurrentContext () == NULL)
1858     return NULL;
1859 
1860   if (_procs_WGL_I3D_image_buffer.wglCreateImageBufferI3D == (GdkGLProc_wglCreateImageBufferI3D) -1)
1861     _procs_WGL_I3D_image_buffer.wglCreateImageBufferI3D =
1862       (GdkGLProc_wglCreateImageBufferI3D) gdk_gl_get_proc_address ("wglCreateImageBufferI3D");
1863 
1864   GDK_GL_NOTE (MISC,
1865     g_message (" - gdk_gl_get_wglCreateImageBufferI3D () - %s",
1866                (_procs_WGL_I3D_image_buffer.wglCreateImageBufferI3D) ? "supported" : "not supported"));
1867 
1868   return (GdkGLProc) (_procs_WGL_I3D_image_buffer.wglCreateImageBufferI3D);
1869 }
1870 
1871 /* wglDestroyImageBufferI3D */
1872 GdkGLProc
gdk_gl_get_wglDestroyImageBufferI3D(void)1873 gdk_gl_get_wglDestroyImageBufferI3D (void)
1874 {
1875   if (wglGetCurrentContext () == NULL)
1876     return NULL;
1877 
1878   if (_procs_WGL_I3D_image_buffer.wglDestroyImageBufferI3D == (GdkGLProc_wglDestroyImageBufferI3D) -1)
1879     _procs_WGL_I3D_image_buffer.wglDestroyImageBufferI3D =
1880       (GdkGLProc_wglDestroyImageBufferI3D) gdk_gl_get_proc_address ("wglDestroyImageBufferI3D");
1881 
1882   GDK_GL_NOTE (MISC,
1883     g_message (" - gdk_gl_get_wglDestroyImageBufferI3D () - %s",
1884                (_procs_WGL_I3D_image_buffer.wglDestroyImageBufferI3D) ? "supported" : "not supported"));
1885 
1886   return (GdkGLProc) (_procs_WGL_I3D_image_buffer.wglDestroyImageBufferI3D);
1887 }
1888 
1889 /* wglAssociateImageBufferEventsI3D */
1890 GdkGLProc
gdk_gl_get_wglAssociateImageBufferEventsI3D(void)1891 gdk_gl_get_wglAssociateImageBufferEventsI3D (void)
1892 {
1893   if (wglGetCurrentContext () == NULL)
1894     return NULL;
1895 
1896   if (_procs_WGL_I3D_image_buffer.wglAssociateImageBufferEventsI3D == (GdkGLProc_wglAssociateImageBufferEventsI3D) -1)
1897     _procs_WGL_I3D_image_buffer.wglAssociateImageBufferEventsI3D =
1898       (GdkGLProc_wglAssociateImageBufferEventsI3D) gdk_gl_get_proc_address ("wglAssociateImageBufferEventsI3D");
1899 
1900   GDK_GL_NOTE (MISC,
1901     g_message (" - gdk_gl_get_wglAssociateImageBufferEventsI3D () - %s",
1902                (_procs_WGL_I3D_image_buffer.wglAssociateImageBufferEventsI3D) ? "supported" : "not supported"));
1903 
1904   return (GdkGLProc) (_procs_WGL_I3D_image_buffer.wglAssociateImageBufferEventsI3D);
1905 }
1906 
1907 /* wglReleaseImageBufferEventsI3D */
1908 GdkGLProc
gdk_gl_get_wglReleaseImageBufferEventsI3D(void)1909 gdk_gl_get_wglReleaseImageBufferEventsI3D (void)
1910 {
1911   if (wglGetCurrentContext () == NULL)
1912     return NULL;
1913 
1914   if (_procs_WGL_I3D_image_buffer.wglReleaseImageBufferEventsI3D == (GdkGLProc_wglReleaseImageBufferEventsI3D) -1)
1915     _procs_WGL_I3D_image_buffer.wglReleaseImageBufferEventsI3D =
1916       (GdkGLProc_wglReleaseImageBufferEventsI3D) gdk_gl_get_proc_address ("wglReleaseImageBufferEventsI3D");
1917 
1918   GDK_GL_NOTE (MISC,
1919     g_message (" - gdk_gl_get_wglReleaseImageBufferEventsI3D () - %s",
1920                (_procs_WGL_I3D_image_buffer.wglReleaseImageBufferEventsI3D) ? "supported" : "not supported"));
1921 
1922   return (GdkGLProc) (_procs_WGL_I3D_image_buffer.wglReleaseImageBufferEventsI3D);
1923 }
1924 
1925 /* Get WGL_I3D_image_buffer functions */
1926 GdkGL_WGL_I3D_image_buffer *
gdk_gl_get_WGL_I3D_image_buffer(GdkGLConfig * glconfig)1927 gdk_gl_get_WGL_I3D_image_buffer (GdkGLConfig *glconfig)
1928 {
1929   static gint supported = -1;
1930 
1931   if (wglGetCurrentContext () == NULL)
1932     return NULL;
1933 
1934   if (supported == -1)
1935     {
1936       supported = gdk_win32_gl_query_wgl_extension (glconfig, "WGL_I3D_image_buffer");
1937 
1938       if (supported)
1939         {
1940           supported &= (gdk_gl_get_wglCreateImageBufferI3D () != NULL);
1941           supported &= (gdk_gl_get_wglDestroyImageBufferI3D () != NULL);
1942           supported &= (gdk_gl_get_wglAssociateImageBufferEventsI3D () != NULL);
1943           supported &= (gdk_gl_get_wglReleaseImageBufferEventsI3D () != NULL);
1944         }
1945     }
1946 
1947   GDK_GL_NOTE (MISC,
1948     g_message (" - gdk_gl_get_WGL_I3D_image_buffer () - %s",
1949                (supported) ? "supported" : "not supported"));
1950 
1951   if (!supported)
1952     return NULL;
1953 
1954   return &_procs_WGL_I3D_image_buffer;
1955 }
1956 
1957 /*
1958  * WGL_I3D_swap_frame_lock
1959  */
1960 
1961 static GdkGL_WGL_I3D_swap_frame_lock _procs_WGL_I3D_swap_frame_lock = {
1962   (GdkGLProc_wglEnableFrameLockI3D) -1,
1963   (GdkGLProc_wglDisableFrameLockI3D) -1,
1964   (GdkGLProc_wglIsEnabledFrameLockI3D) -1,
1965   (GdkGLProc_wglQueryFrameLockMasterI3D) -1
1966 };
1967 
1968 /* wglEnableFrameLockI3D */
1969 GdkGLProc
gdk_gl_get_wglEnableFrameLockI3D(void)1970 gdk_gl_get_wglEnableFrameLockI3D (void)
1971 {
1972   if (wglGetCurrentContext () == NULL)
1973     return NULL;
1974 
1975   if (_procs_WGL_I3D_swap_frame_lock.wglEnableFrameLockI3D == (GdkGLProc_wglEnableFrameLockI3D) -1)
1976     _procs_WGL_I3D_swap_frame_lock.wglEnableFrameLockI3D =
1977       (GdkGLProc_wglEnableFrameLockI3D) gdk_gl_get_proc_address ("wglEnableFrameLockI3D");
1978 
1979   GDK_GL_NOTE (MISC,
1980     g_message (" - gdk_gl_get_wglEnableFrameLockI3D () - %s",
1981                (_procs_WGL_I3D_swap_frame_lock.wglEnableFrameLockI3D) ? "supported" : "not supported"));
1982 
1983   return (GdkGLProc) (_procs_WGL_I3D_swap_frame_lock.wglEnableFrameLockI3D);
1984 }
1985 
1986 /* wglDisableFrameLockI3D */
1987 GdkGLProc
gdk_gl_get_wglDisableFrameLockI3D(void)1988 gdk_gl_get_wglDisableFrameLockI3D (void)
1989 {
1990   if (wglGetCurrentContext () == NULL)
1991     return NULL;
1992 
1993   if (_procs_WGL_I3D_swap_frame_lock.wglDisableFrameLockI3D == (GdkGLProc_wglDisableFrameLockI3D) -1)
1994     _procs_WGL_I3D_swap_frame_lock.wglDisableFrameLockI3D =
1995       (GdkGLProc_wglDisableFrameLockI3D) gdk_gl_get_proc_address ("wglDisableFrameLockI3D");
1996 
1997   GDK_GL_NOTE (MISC,
1998     g_message (" - gdk_gl_get_wglDisableFrameLockI3D () - %s",
1999                (_procs_WGL_I3D_swap_frame_lock.wglDisableFrameLockI3D) ? "supported" : "not supported"));
2000 
2001   return (GdkGLProc) (_procs_WGL_I3D_swap_frame_lock.wglDisableFrameLockI3D);
2002 }
2003 
2004 /* wglIsEnabledFrameLockI3D */
2005 GdkGLProc
gdk_gl_get_wglIsEnabledFrameLockI3D(void)2006 gdk_gl_get_wglIsEnabledFrameLockI3D (void)
2007 {
2008   if (wglGetCurrentContext () == NULL)
2009     return NULL;
2010 
2011   if (_procs_WGL_I3D_swap_frame_lock.wglIsEnabledFrameLockI3D == (GdkGLProc_wglIsEnabledFrameLockI3D) -1)
2012     _procs_WGL_I3D_swap_frame_lock.wglIsEnabledFrameLockI3D =
2013       (GdkGLProc_wglIsEnabledFrameLockI3D) gdk_gl_get_proc_address ("wglIsEnabledFrameLockI3D");
2014 
2015   GDK_GL_NOTE (MISC,
2016     g_message (" - gdk_gl_get_wglIsEnabledFrameLockI3D () - %s",
2017                (_procs_WGL_I3D_swap_frame_lock.wglIsEnabledFrameLockI3D) ? "supported" : "not supported"));
2018 
2019   return (GdkGLProc) (_procs_WGL_I3D_swap_frame_lock.wglIsEnabledFrameLockI3D);
2020 }
2021 
2022 /* wglQueryFrameLockMasterI3D */
2023 GdkGLProc
gdk_gl_get_wglQueryFrameLockMasterI3D(void)2024 gdk_gl_get_wglQueryFrameLockMasterI3D (void)
2025 {
2026   if (wglGetCurrentContext () == NULL)
2027     return NULL;
2028 
2029   if (_procs_WGL_I3D_swap_frame_lock.wglQueryFrameLockMasterI3D == (GdkGLProc_wglQueryFrameLockMasterI3D) -1)
2030     _procs_WGL_I3D_swap_frame_lock.wglQueryFrameLockMasterI3D =
2031       (GdkGLProc_wglQueryFrameLockMasterI3D) gdk_gl_get_proc_address ("wglQueryFrameLockMasterI3D");
2032 
2033   GDK_GL_NOTE (MISC,
2034     g_message (" - gdk_gl_get_wglQueryFrameLockMasterI3D () - %s",
2035                (_procs_WGL_I3D_swap_frame_lock.wglQueryFrameLockMasterI3D) ? "supported" : "not supported"));
2036 
2037   return (GdkGLProc) (_procs_WGL_I3D_swap_frame_lock.wglQueryFrameLockMasterI3D);
2038 }
2039 
2040 /* Get WGL_I3D_swap_frame_lock functions */
2041 GdkGL_WGL_I3D_swap_frame_lock *
gdk_gl_get_WGL_I3D_swap_frame_lock(GdkGLConfig * glconfig)2042 gdk_gl_get_WGL_I3D_swap_frame_lock (GdkGLConfig *glconfig)
2043 {
2044   static gint supported = -1;
2045 
2046   if (wglGetCurrentContext () == NULL)
2047     return NULL;
2048 
2049   if (supported == -1)
2050     {
2051       supported = gdk_win32_gl_query_wgl_extension (glconfig, "WGL_I3D_swap_frame_lock");
2052 
2053       if (supported)
2054         {
2055           supported &= (gdk_gl_get_wglEnableFrameLockI3D () != NULL);
2056           supported &= (gdk_gl_get_wglDisableFrameLockI3D () != NULL);
2057           supported &= (gdk_gl_get_wglIsEnabledFrameLockI3D () != NULL);
2058           supported &= (gdk_gl_get_wglQueryFrameLockMasterI3D () != NULL);
2059         }
2060     }
2061 
2062   GDK_GL_NOTE (MISC,
2063     g_message (" - gdk_gl_get_WGL_I3D_swap_frame_lock () - %s",
2064                (supported) ? "supported" : "not supported"));
2065 
2066   if (!supported)
2067     return NULL;
2068 
2069   return &_procs_WGL_I3D_swap_frame_lock;
2070 }
2071 
2072 /*
2073  * WGL_I3D_swap_frame_usage
2074  */
2075 
2076 static GdkGL_WGL_I3D_swap_frame_usage _procs_WGL_I3D_swap_frame_usage = {
2077   (GdkGLProc_wglGetFrameUsageI3D) -1,
2078   (GdkGLProc_wglBeginFrameTrackingI3D) -1,
2079   (GdkGLProc_wglEndFrameTrackingI3D) -1,
2080   (GdkGLProc_wglQueryFrameTrackingI3D) -1
2081 };
2082 
2083 /* wglGetFrameUsageI3D */
2084 GdkGLProc
gdk_gl_get_wglGetFrameUsageI3D(void)2085 gdk_gl_get_wglGetFrameUsageI3D (void)
2086 {
2087   if (wglGetCurrentContext () == NULL)
2088     return NULL;
2089 
2090   if (_procs_WGL_I3D_swap_frame_usage.wglGetFrameUsageI3D == (GdkGLProc_wglGetFrameUsageI3D) -1)
2091     _procs_WGL_I3D_swap_frame_usage.wglGetFrameUsageI3D =
2092       (GdkGLProc_wglGetFrameUsageI3D) gdk_gl_get_proc_address ("wglGetFrameUsageI3D");
2093 
2094   GDK_GL_NOTE (MISC,
2095     g_message (" - gdk_gl_get_wglGetFrameUsageI3D () - %s",
2096                (_procs_WGL_I3D_swap_frame_usage.wglGetFrameUsageI3D) ? "supported" : "not supported"));
2097 
2098   return (GdkGLProc) (_procs_WGL_I3D_swap_frame_usage.wglGetFrameUsageI3D);
2099 }
2100 
2101 /* wglBeginFrameTrackingI3D */
2102 GdkGLProc
gdk_gl_get_wglBeginFrameTrackingI3D(void)2103 gdk_gl_get_wglBeginFrameTrackingI3D (void)
2104 {
2105   if (wglGetCurrentContext () == NULL)
2106     return NULL;
2107 
2108   if (_procs_WGL_I3D_swap_frame_usage.wglBeginFrameTrackingI3D == (GdkGLProc_wglBeginFrameTrackingI3D) -1)
2109     _procs_WGL_I3D_swap_frame_usage.wglBeginFrameTrackingI3D =
2110       (GdkGLProc_wglBeginFrameTrackingI3D) gdk_gl_get_proc_address ("wglBeginFrameTrackingI3D");
2111 
2112   GDK_GL_NOTE (MISC,
2113     g_message (" - gdk_gl_get_wglBeginFrameTrackingI3D () - %s",
2114                (_procs_WGL_I3D_swap_frame_usage.wglBeginFrameTrackingI3D) ? "supported" : "not supported"));
2115 
2116   return (GdkGLProc) (_procs_WGL_I3D_swap_frame_usage.wglBeginFrameTrackingI3D);
2117 }
2118 
2119 /* wglEndFrameTrackingI3D */
2120 GdkGLProc
gdk_gl_get_wglEndFrameTrackingI3D(void)2121 gdk_gl_get_wglEndFrameTrackingI3D (void)
2122 {
2123   if (wglGetCurrentContext () == NULL)
2124     return NULL;
2125 
2126   if (_procs_WGL_I3D_swap_frame_usage.wglEndFrameTrackingI3D == (GdkGLProc_wglEndFrameTrackingI3D) -1)
2127     _procs_WGL_I3D_swap_frame_usage.wglEndFrameTrackingI3D =
2128       (GdkGLProc_wglEndFrameTrackingI3D) gdk_gl_get_proc_address ("wglEndFrameTrackingI3D");
2129 
2130   GDK_GL_NOTE (MISC,
2131     g_message (" - gdk_gl_get_wglEndFrameTrackingI3D () - %s",
2132                (_procs_WGL_I3D_swap_frame_usage.wglEndFrameTrackingI3D) ? "supported" : "not supported"));
2133 
2134   return (GdkGLProc) (_procs_WGL_I3D_swap_frame_usage.wglEndFrameTrackingI3D);
2135 }
2136 
2137 /* wglQueryFrameTrackingI3D */
2138 GdkGLProc
gdk_gl_get_wglQueryFrameTrackingI3D(void)2139 gdk_gl_get_wglQueryFrameTrackingI3D (void)
2140 {
2141   if (wglGetCurrentContext () == NULL)
2142     return NULL;
2143 
2144   if (_procs_WGL_I3D_swap_frame_usage.wglQueryFrameTrackingI3D == (GdkGLProc_wglQueryFrameTrackingI3D) -1)
2145     _procs_WGL_I3D_swap_frame_usage.wglQueryFrameTrackingI3D =
2146       (GdkGLProc_wglQueryFrameTrackingI3D) gdk_gl_get_proc_address ("wglQueryFrameTrackingI3D");
2147 
2148   GDK_GL_NOTE (MISC,
2149     g_message (" - gdk_gl_get_wglQueryFrameTrackingI3D () - %s",
2150                (_procs_WGL_I3D_swap_frame_usage.wglQueryFrameTrackingI3D) ? "supported" : "not supported"));
2151 
2152   return (GdkGLProc) (_procs_WGL_I3D_swap_frame_usage.wglQueryFrameTrackingI3D);
2153 }
2154 
2155 /* Get WGL_I3D_swap_frame_usage functions */
2156 GdkGL_WGL_I3D_swap_frame_usage *
gdk_gl_get_WGL_I3D_swap_frame_usage(GdkGLConfig * glconfig)2157 gdk_gl_get_WGL_I3D_swap_frame_usage (GdkGLConfig *glconfig)
2158 {
2159   static gint supported = -1;
2160 
2161   if (wglGetCurrentContext () == NULL)
2162     return NULL;
2163 
2164   if (supported == -1)
2165     {
2166       supported = gdk_win32_gl_query_wgl_extension (glconfig, "WGL_I3D_swap_frame_usage");
2167 
2168       if (supported)
2169         {
2170           supported &= (gdk_gl_get_wglGetFrameUsageI3D () != NULL);
2171           supported &= (gdk_gl_get_wglBeginFrameTrackingI3D () != NULL);
2172           supported &= (gdk_gl_get_wglEndFrameTrackingI3D () != NULL);
2173           supported &= (gdk_gl_get_wglQueryFrameTrackingI3D () != NULL);
2174         }
2175     }
2176 
2177   GDK_GL_NOTE (MISC,
2178     g_message (" - gdk_gl_get_WGL_I3D_swap_frame_usage () - %s",
2179                (supported) ? "supported" : "not supported"));
2180 
2181   if (!supported)
2182     return NULL;
2183 
2184   return &_procs_WGL_I3D_swap_frame_usage;
2185 }
2186 
2187