PlusLib  2.9.0
Software library for tracked ultrasound image acquisition, calibration, and processing.
glExtensions.cpp
Go to the documentation of this file.
1 /***************************************************************************\
2 |* *|
3 |* Copyright 2007 NVIDIA Corporation. All rights reserved. *|
4 |* *|
5 |* NOTICE TO USER: *|
6 |* *|
7 |* This source code is subject to NVIDIA ownership rights under U.S. *|
8 |* and international Copyright laws. Users and possessors of this *|
9 |* source code are hereby granted a nonexclusive, royalty-free *|
10 |* license to use this code in individual and commercial software. *|
11 |* *|
12 |* NVIDIA MAKES NO REPRESENTATION ABOUT THE SUITABILITY OF THIS SOURCE *|
13 |* CODE FOR ANY PURPOSE. IT IS PROVIDED "AS IS" WITHOUT EXPRESS OR *|
14 |* IMPLIED WARRANTY OF ANY KIND. NVIDIA DISCLAIMS ALL WARRANTIES WITH *|
15 |* REGARD TO THIS SOURCE CODE, INCLUDING ALL IMPLIED WARRANTIES OF *|
16 |* MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR *|
17 |* PURPOSE. IN NO EVENT SHALL NVIDIA BE LIABLE FOR ANY SPECIAL, *|
18 |* INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES *|
19 |* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN *|
20 |* AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING *|
21 |* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOURCE *|
22 |* CODE. *|
23 |* *|
24 |* U.S. Government End Users. This source code is a "commercial item" *|
25 |* as that term is defined at 48 C.F.R. 2.101 (OCT 1995), consisting *|
26 |* of "commercial computer software" and "commercial computer software *|
27 |* documentation" as such terms are used in 48 C.F.R. 12.212 (SEPT 1995) *|
28 |* and is provided to the U.S. Government only as a commercial end item. *|
29 |* Consistent with 48 C.F.R.12.212 and 48 C.F.R. 227.7202-1 through *|
30 |* 227.7202-4 (JUNE 1995), all U.S. Government End Users acquire the *|
31 |* source code with only those rights set forth herein. *|
32 |* *|
33 |* Any use of this source code in individual and commercial software must *|
34 |* include, in the user documentation and internal comments to the code, *|
35 |* the above Disclaimer and U.S. Government End Users Notice. *|
36 |* *|
37 |* *|
38 \***************************************************************************/
39 
40 #if WIN32
41 #include <windows.h>
42 #endif
43 
44 #include "nvConfigure.h"
45 #include <gl\glu.h>
46 #include <stdio.h>
47 
48 // GL_EXT_framebuffer_object
49 PFNGLISRENDERBUFFEREXTPROC glIsRenderbufferEXT = NULL;
50 PFNGLBINDRENDERBUFFEREXTPROC glBindRenderbufferEXT = NULL;
51 PFNGLDELETERENDERBUFFERSEXTPROC glDeleteRenderbuffersEXT = NULL;
52 PFNGLGENRENDERBUFFERSEXTPROC glGenRenderbuffersEXT = NULL;
53 PFNGLRENDERBUFFERSTORAGEEXTPROC glRenderbufferStorageEXT = NULL;
54 PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC glGetRenderbufferParameterivEXT = NULL;
55 PFNGLISFRAMEBUFFEREXTPROC glIsFramebufferEXT = NULL;
56 PFNGLBINDFRAMEBUFFEREXTPROC glBindFramebufferEXT = NULL;
57 PFNGLDELETEFRAMEBUFFERSEXTPROC glDeleteFramebuffersEXT = NULL;
58 PFNGLGENFRAMEBUFFERSEXTPROC glGenFramebuffersEXT = NULL;
59 PFNGLBLITFRAMEBUFFEREXTPROC glBlitFramebufferEXT = NULL;
60 PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC glCheckFramebufferStatusEXT = NULL;
61 PFNGLFRAMEBUFFERTEXTURE1DEXTPROC glFramebufferTexture1DEXT = NULL;
62 PFNGLFRAMEBUFFERTEXTURE2DEXTPROC glFramebufferTexture2DEXT = NULL;
63 PFNGLFRAMEBUFFERTEXTURE3DEXTPROC glFramebufferTexture3DEXT = NULL;
64 PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC glFramebufferRenderbufferEXT = NULL;
65 PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC glGetFramebufferAttachmentParameterivEXT = NULL;
66 PFNGLGENERATEMIPMAPEXTPROC glGenerateMipmapEXT = NULL;
67 
68 //GL_EXT_timer_query
69 PFNGLGENQUERIESPROC glGenQueries = NULL;
70 PFNGLDELETEQUERIESPROC glDeleteQueries = NULL;
71 PFNGLBEGINQUERYPROC glBeginQuery = NULL;
72 PFNGLENDQUERYPROC glEndQuery = NULL;
73 PFNGLGETQUERYOBJECTUI64VEXTPROC glGetQueryObjectui64vEXT = NULL;
74 PFNGLGETINTEGER64VPROC glGetInteger64v = NULL;
75 PFNGLGETQUERYOBJECTUIVPROC glGetQueryObjectuiv = NULL;
76 // WGL_gpu_affinity
77 PFNWGLENUMGPUSNVPROC wglEnumGpusNV = NULL;
78 PFNWGLENUMGPUDEVICESNVPROC wglEnumGpuDevicesNV = NULL;
79 PFNWGLCREATEAFFINITYDCNVPROC wglCreateAffinityDCNV = NULL;
80 PFNWGLDELETEDCNVPROC wglDeleteDCNV = NULL;
81 PFNWGLENUMGPUSFROMAFFINITYDCNVPROC wglEnumGpusFromAffinityDCNV = NULL;
82 
83 // WGL_Swap_Interval
84 PFNWGLSWAPINTERVALEXTPROC wglSwapIntervalEXT = NULL;
85 
86 //WGL_ARB_pixel_format
87 PFNWGLCHOOSEPIXELFORMATARBPROC wglChoosePixelFormat = NULL;
88 
89 // WGL_NV_Copy_image
90 PFNWGLCOPYIMAGESUBDATANVPROC wglCopyImageSubDataNV = NULL;
91 
92 //GL_ARB_copy_buffer
93 PFNGLCOPYBUFFERSUBDATAPROC glCopyBufferSubData = NULL;
94 
95 // GL_ARB_vertex_buffer_object
96 PFNGLBINDBUFFERARBPROC glBindBuffer = NULL;
97 PFNGLBUFFERDATAARBPROC glBufferData = NULL;
98 PFNGLBUFFERSUBDATAARBPROC glBufferSubData = NULL;
99 PFNGLDELETEBUFFERSARBPROC glDeleteBuffers = NULL;
100 PFNGLGENBUFFERSARBPROC glGenBuffers = NULL;
101 PFNGLMAPBUFFERPROC glMapBuffer = NULL;
102 PFNGLUNMAPBUFFERPROC glUnmapBuffer = NULL;
103 PFNGLMAPBUFFERRANGEPROC glMapBufferRange = NULL;
104 PFNGLGETBUFFERSUBDATAPROC glGetBufferSubData = NULL;
105 
106 //NV_present_video
107 PFNWGLENUMERATEVIDEODEVICESNVPROC wglEnumerateVideoDevicesNV = NULL;
108 PFNWGLBINDVIDEODEVICENVPROC wglBindVideoDeviceNV = NULL;
109 PFNGLPRESENTFRAMEKEYEDNVPROC glPresentFrameKeyedNV = NULL;
110 PFNGLPRESENTFRAMEDUALFILLNVPROC glPresentFrameDualFillNV = NULL;
111 PFNGLGETVIDEOIVNVPROC glGetVideoivNV = NULL;
112 PFNGLGETVIDEOUIVNVPROC glGetVideouivNV = NULL;
113 PFNGLGETVIDEOI64VNVPROC glGetVideoi64vNV = NULL;
114 PFNGLGETVIDEOUI64VNVPROC glGetVideoui64vNV = NULL;
115 
116 //NV_Video_Capture
117 PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC wglEnumerateVideoCaptureDevicesNV = NULL;
118 PFNWGLBINDVIDEOCAPTUREDEVICENVPROC wglBindVideoCaptureDeviceNV = NULL;
119 PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC wglReleaseVideoCaptureDeviceNV = NULL;
120 PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC wglLockVideoCaptureDeviceNV = NULL;
121 PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC wglQueryVideoCaptureDeviceNV = NULL;
122 PFNWGLQUERYCURRENTCONTEXTNVPROC wglQueryCurrentContextNV = NULL;
123 PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC glVideoCaptureStreamParameterivNV = NULL;
124 PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC glVideoCaptureStreamParameterfvNV = NULL;
125 PFNGLGETVIDEOCAPTURESTREAMIVNVPROC glGetVideoCaptureStreamivNV = NULL;
126 PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC glBindVideoCaptureStreamBufferNV = NULL;
127 PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC glBindVideoCaptureStreamTextureNV = NULL;
128 PFNGLBEGINVIDEOCAPTURENVPROC glBeginVideoCaptureNV = NULL;
129 PFNGLENDVIDEOCAPTURENVPROC glEndVideoCaptureNV = NULL;
130 PFNGLVIDEOCAPTURENVPROC glVideoCaptureNV = NULL;
131 
132 PFNGLSHADERSOURCEARBPROC glShaderSource = NULL;
133 PFNGLCOMPILESHADERARBPROC glCompileShader = NULL;
134 PFNGLGETSHADERIVPROC glGetShaderiv = NULL;
135 PFNGLGETSHADERINFOLOGPROC glGetShaderInfoLog = NULL;
136 PFNGLUSEPROGRAMPROC glUseProgram = NULL;
137 PFNGLCREATESHADERPROC glCreateShader = NULL;
138 PFNGLDELETESHADERPROC glDeleteShader = NULL;
139 PFNGLDELETEPROGRAMPROC glDeleteProgram = NULL;
140 PFNGLCREATEPROGRAMPROC glCreateProgram = NULL;
141 PFNGLATTACHSHADERPROC glAttachShader = NULL;
142 PFNGLDETACHSHADERPROC glDetachShader = NULL;
143 PFNGLLINKPROGRAMPROC glLinkProgram = NULL;
144 PFNGLGETPROGRAMIVPROC glGetProgramiv = NULL;
145 PFNGLGETPROGRAMINFOLOGPROC glGetProgramInfoLog = NULL;
146 PFNGLGETUNIFORMLOCATIONPROC glGetUniformLocation = NULL;
147 PFNGLUNIFORM2IVARBPROC glUniform2iv = NULL;
148 
149 PFNGLFENCESYNCPROC glFenceSync = NULL;
150 PFNGLISSYNCPROC glIsSync = NULL;
151 PFNGLDELETESYNCPROC glDeleteSync = NULL;
152 PFNGLCLIENTWAITSYNCPROC glClientWaitSync = NULL;
153 PFNGLWAITSYNCPROC glWaitSync = NULL;
154 PFNGLGETSYNCIVPROC glGetSynciv = NULL;
155 
156 //---------------------------------------------------------------------------
158 {
159  wglCopyImageSubDataNV = ( PFNWGLCOPYIMAGESUBDATANVPROC ) wglGetProcAddress( "wglCopyImageSubDataNV" );
160 
161  bool loadOK = ( wglCopyImageSubDataNV != NULL );
162  return loadOK;
163 }
164 
165 //---------------------------------------------------------------------------
167 {
168  wglEnumGpusNV = ( PFNWGLENUMGPUSNVPROC ) wglGetProcAddress( "wglEnumGpusNV" );
169  wglEnumGpuDevicesNV = ( PFNWGLENUMGPUDEVICESNVPROC ) wglGetProcAddress( "wglEnumGpuDevicesNV" );
170  wglCreateAffinityDCNV = ( PFNWGLCREATEAFFINITYDCNVPROC ) wglGetProcAddress( "wglCreateAffinityDCNV" );
171  wglDeleteDCNV = ( PFNWGLDELETEDCNVPROC ) wglGetProcAddress( "wglDeleteDCNV" );
172  wglEnumGpusFromAffinityDCNV = ( PFNWGLENUMGPUSFROMAFFINITYDCNVPROC ) wglGetProcAddress( "wglEnumGpusFromAffinityDCNV" );
173 
174  bool loadOK =
175  ( wglEnumGpusNV != NULL ) &&
176  ( wglEnumGpuDevicesNV != NULL ) &&
177  ( wglCreateAffinityDCNV != NULL ) &&
178  ( wglDeleteDCNV != NULL ) &&
179  ( wglEnumGpusFromAffinityDCNV != NULL );
180 
181  return loadOK;
182 }
183 
184 //---------------------------------------------------------------------------
186 {
187  glIsRenderbufferEXT = ( PFNGLISRENDERBUFFEREXTPROC ) wglGetProcAddress( "glIsRenderbufferEXT" );
188  glBindRenderbufferEXT = ( PFNGLBINDRENDERBUFFEREXTPROC ) wglGetProcAddress( "glBindRenderbufferEXT" );
189  glDeleteRenderbuffersEXT = ( PFNGLDELETERENDERBUFFERSEXTPROC ) wglGetProcAddress( "glDeleteRenderbuffersEXT" );
190  glGenRenderbuffersEXT = ( PFNGLGENRENDERBUFFERSEXTPROC ) wglGetProcAddress( "glGenRenderbuffersEXT" );
191  glRenderbufferStorageEXT = ( PFNGLRENDERBUFFERSTORAGEEXTPROC ) wglGetProcAddress( "glRenderbufferStorageEXT" );
192  glGetRenderbufferParameterivEXT = ( PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC ) wglGetProcAddress( "glGetRenderbufferParameterivEXT" );
193  glIsFramebufferEXT = ( PFNGLISFRAMEBUFFEREXTPROC ) wglGetProcAddress( "glIsFramebufferEXT" );
194  glBindFramebufferEXT = ( PFNGLBINDFRAMEBUFFEREXTPROC ) wglGetProcAddress( "glBindFramebufferEXT" );
195  glDeleteFramebuffersEXT = ( PFNGLDELETEFRAMEBUFFERSEXTPROC ) wglGetProcAddress( "glDeleteFramebuffersEXT" );
196  glGenFramebuffersEXT = ( PFNGLGENFRAMEBUFFERSEXTPROC ) wglGetProcAddress( "glGenFramebuffersEXT" );
197  glCheckFramebufferStatusEXT = ( PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC ) wglGetProcAddress( "glCheckFramebufferStatusEXT" );
198  glFramebufferTexture1DEXT = ( PFNGLFRAMEBUFFERTEXTURE1DEXTPROC ) wglGetProcAddress( "glFramebufferTexture1DEXT" );
199  glFramebufferTexture2DEXT = ( PFNGLFRAMEBUFFERTEXTURE2DEXTPROC ) wglGetProcAddress( "glFramebufferTexture2DEXT" );
200  glFramebufferTexture3DEXT = ( PFNGLFRAMEBUFFERTEXTURE3DEXTPROC ) wglGetProcAddress( "glFramebufferTexture3DEXT" );
201  glFramebufferRenderbufferEXT = ( PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC ) wglGetProcAddress( "glFramebufferRenderbufferEXT" );
202  glGetFramebufferAttachmentParameterivEXT = ( PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC ) wglGetProcAddress( "glGetFramebufferAttachmentParameterivEXT" );
203  glGenerateMipmapEXT = ( PFNGLGENERATEMIPMAPEXTPROC ) wglGetProcAddress( "glGenerateMipmapEXT" );
204  glBlitFramebufferEXT = ( PFNGLBLITFRAMEBUFFEREXTPROC )wglGetProcAddress( "glBlitFramebufferEXT" );
205 
206  bool loadOK =
207  ( glIsRenderbufferEXT != NULL ) &&
208  ( glBindRenderbufferEXT != NULL ) &&
209  ( glDeleteRenderbuffersEXT != NULL ) &&
210  ( glGenRenderbuffersEXT != NULL ) &&
211  ( glRenderbufferStorageEXT != NULL ) &&
212  ( glGetRenderbufferParameterivEXT != NULL ) &&
213  ( glIsFramebufferEXT != NULL ) &&
214  ( glBindFramebufferEXT != NULL ) &&
215  ( glDeleteFramebuffersEXT != NULL ) &&
216  ( glGenFramebuffersEXT != NULL ) &&
217  ( glCheckFramebufferStatusEXT != NULL ) &&
218  ( glFramebufferTexture1DEXT != NULL ) &&
219  ( glFramebufferTexture2DEXT != NULL ) &&
220  ( glFramebufferTexture3DEXT != NULL ) &&
221  ( glFramebufferRenderbufferEXT != NULL ) &&
223  ( glGenerateMipmapEXT != NULL ) &&
224  ( glBlitFramebufferEXT != NULL );
225  return loadOK;
226 }
227 
228 //---------------------------------------------------------------------------
230 {
231  glGenQueries = ( PFNGLGENQUERIESPROC ) wglGetProcAddress( "glGenQueries" );
232  glDeleteQueries = ( PFNGLDELETEQUERIESPROC ) wglGetProcAddress( "glDeleteQueries" );
233  glBeginQuery = ( PFNGLBEGINQUERYPROC ) wglGetProcAddress( "glBeginQuery" );
234  glEndQuery = ( PFNGLENDQUERYPROC ) wglGetProcAddress( "glEndQuery" );
235  glGetQueryObjectui64vEXT = ( PFNGLGETQUERYOBJECTUI64VEXTPROC ) wglGetProcAddress( "glGetQueryObjectui64vEXT" );
236  glGetInteger64v = ( PFNGLGETINTEGER64VPROC )wglGetProcAddress( "glGetInteger64v" );
237  glGetQueryObjectuiv = ( PFNGLGETQUERYOBJECTUIVPROC )wglGetProcAddress( "glGetQueryObjectuiv" );
238 
239  bool loadOK =
240  ( glGenQueries != NULL ) &&
241  ( glDeleteQueries != NULL ) &&
242  ( glBeginQuery != NULL ) &&
243  ( glEndQuery != NULL ) &&
244  ( glGetQueryObjectui64vEXT != NULL ) &&
245  ( glGetInteger64v != NULL ) && ( glGetQueryObjectuiv != NULL );
246 
247  return loadOK;
248 }
249 
250 //---------------------------------------------------------------------------
252 {
253  wglSwapIntervalEXT = ( PFNWGLSWAPINTERVALEXTPROC ) wglGetProcAddress( "wglSwapIntervalEXT" );
254 
255  bool loadOK = ( wglSwapIntervalEXT != NULL );
256  return loadOK;
257 }
258 
259 //---------------------------------------------------------------------------
261 {
262  wglChoosePixelFormat = ( PFNWGLCHOOSEPIXELFORMATARBPROC ) wglGetProcAddress( "wglChoosePixelFormatARB" );
263 
264  bool loadOK = ( wglChoosePixelFormat != NULL );
265  return loadOK;
266 }
267 
268 //---------------------------------------------------------------------------
270 {
271  glBindBuffer = ( PFNGLBINDBUFFERARBPROC ) wglGetProcAddress( "glBindBufferARB" );
272  glBufferData = ( PFNGLBUFFERDATAARBPROC ) wglGetProcAddress( "glBufferDataARB" );
273  glBufferSubData = ( PFNGLBUFFERSUBDATAARBPROC ) wglGetProcAddress( "glBufferSubDataARB" );
274  glDeleteBuffers = ( PFNGLDELETEBUFFERSARBPROC ) wglGetProcAddress( "glDeleteBuffersARB" );
275  glGenBuffers = ( PFNGLGENBUFFERSARBPROC ) wglGetProcAddress( "glGenBuffersARB" );
276  glMapBuffer = ( PFNGLMAPBUFFERPROC ) wglGetProcAddress( "glMapBufferARB" );
277  glMapBufferRange = ( PFNGLMAPBUFFERRANGEPROC ) wglGetProcAddress( "glMapBufferRange" );
278  glUnmapBuffer = ( PFNGLUNMAPBUFFERPROC ) wglGetProcAddress( "glUnmapBufferARB" );
279  glGetBufferSubData = ( PFNGLGETBUFFERSUBDATAPROC )wglGetProcAddress( "glGetBufferSubData" );
280 
281  bool loadOK =
282  ( glBindBuffer != NULL ) &&
283  ( glBufferData != NULL ) &&
284  ( glBufferSubData != NULL ) &&
285  ( glDeleteBuffers != NULL ) &&
286  ( glGenBuffers != NULL ) &&
287  ( glMapBuffer != NULL ) &&
288  ( glUnmapBuffer != NULL ) &&
289  ( glMapBufferRange != NULL ) &&
290  ( glGetBufferSubData != NULL );
291  return loadOK;
292 }
293 
294 //---------------------------------------------------------------------------
296 {
297  // Initialize video extension
298  glPresentFrameKeyedNV = ( PFNGLPRESENTFRAMEKEYEDNVPROC ) wglGetProcAddress( "glPresentFrameKeyedNV" );
299  glPresentFrameDualFillNV = ( PFNGLPRESENTFRAMEDUALFILLNVPROC ) wglGetProcAddress( "glPresentFrameDualFillNV" );
300  wglEnumerateVideoDevicesNV = ( PFNWGLENUMERATEVIDEODEVICESNVPROC ) wglGetProcAddress( "wglEnumerateVideoDevicesNV" );
301  wglBindVideoDeviceNV = ( PFNWGLBINDVIDEODEVICENVPROC ) wglGetProcAddress( "wglBindVideoDeviceNV" );
302  glGetVideoivNV = ( PFNGLGETVIDEOIVNVPROC ) wglGetProcAddress( "glGetVideoivNV" );
303  glGetVideouivNV = ( PFNGLGETVIDEOUIVNVPROC ) wglGetProcAddress( "glGetVideouivNV" );
304  glGetVideoi64vNV = ( PFNGLGETVIDEOI64VNVPROC ) wglGetProcAddress( "glGetVideoi64vNV" );
305  glGetVideoui64vNV = ( PFNGLGETVIDEOUI64VNVPROC ) wglGetProcAddress( "glGetVideoui64vNV" );
306 
307  bool loadOK = ( glPresentFrameKeyedNV != NULL ) && ( glPresentFrameDualFillNV != NULL ) &&
308  ( wglEnumerateVideoDevicesNV != NULL ) && ( wglBindVideoDeviceNV != NULL ) &&
309  ( glGetVideoivNV != NULL ) && ( glGetVideouivNV != NULL ) &&
310  ( glGetVideoi64vNV != NULL ) && ( glGetVideoui64vNV != NULL );
311  return loadOK;
312 }
313 
314 //---------------------------------------------------------------------------
316 {
317  wglEnumerateVideoCaptureDevicesNV = ( PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC )wglGetProcAddress( "wglEnumerateVideoCaptureDevicesNV" ) ;
318  wglBindVideoCaptureDeviceNV = ( PFNWGLBINDVIDEOCAPTUREDEVICENVPROC )wglGetProcAddress( "wglBindVideoCaptureDeviceNV" );
319  wglReleaseVideoCaptureDeviceNV = ( PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC )wglGetProcAddress( "wglReleaseVideoCaptureDeviceNV" );
320  wglLockVideoCaptureDeviceNV = ( PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC )wglGetProcAddress( "wglLockVideoCaptureDeviceNV" );
321  wglQueryVideoCaptureDeviceNV = ( PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC )wglGetProcAddress( "wglQueryVideoCaptureDeviceNV" );
322  wglQueryCurrentContextNV = ( PFNWGLQUERYCURRENTCONTEXTNVPROC )wglGetProcAddress( "wglQueryCurrentContextNV" );
323  glVideoCaptureStreamParameterivNV = ( PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC )wglGetProcAddress( "glVideoCaptureStreamParameterivNV" );
324  glVideoCaptureStreamParameterfvNV = ( PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC )wglGetProcAddress( "glVideoCaptureStreamParameterfvNV" );
325  glGetVideoCaptureStreamivNV = ( PFNGLGETVIDEOCAPTURESTREAMIVNVPROC )wglGetProcAddress( "glGetVideoCaptureStreamivNV" );
326  glBindVideoCaptureStreamBufferNV = ( PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC )wglGetProcAddress( "glBindVideoCaptureStreamBufferNV" );
327  glBindVideoCaptureStreamTextureNV = ( PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC )wglGetProcAddress( "glBindVideoCaptureStreamTextureNV" );
328  glBeginVideoCaptureNV = ( PFNGLBEGINVIDEOCAPTURENVPROC )wglGetProcAddress( "glBeginVideoCaptureNV" );
329  glEndVideoCaptureNV = ( PFNGLENDVIDEOCAPTURENVPROC )wglGetProcAddress( "glEndVideoCaptureNV" );
330  glVideoCaptureNV = ( PFNGLVIDEOCAPTURENVPROC )wglGetProcAddress( "glVideoCaptureNV" );
331 
332  bool loadOK( true );
338  {
339  loadOK = false;
340  }
341  return loadOK;
342 }
343 
344 //---------------------------------------------------------------------------
346 {
347  glShaderSource = ( PFNGLSHADERSOURCEARBPROC )wglGetProcAddress( "glShaderSourceARB" );
348  glCompileShader = ( PFNGLCOMPILESHADERARBPROC )wglGetProcAddress( "glCompileShaderARB" );
349  glGetShaderiv = ( PFNGLGETSHADERIVPROC )wglGetProcAddress( "glGetShaderiv" );
350  glGetShaderInfoLog = ( PFNGLGETSHADERINFOLOGPROC )wglGetProcAddress( "glGetShaderInfoLog" );
351  glUseProgram = ( PFNGLUSEPROGRAMPROC )wglGetProcAddress( "glUseProgram" );
352  glCreateShader = ( PFNGLCREATESHADERPROC )wglGetProcAddress( "glCreateShader" );
353  glDeleteShader = ( PFNGLDELETESHADERPROC )wglGetProcAddress( "glDeleteShader" );
354  glDeleteProgram = ( PFNGLDELETEPROGRAMPROC )wglGetProcAddress( "glDeleteProgram" );
355  glCreateProgram = ( PFNGLCREATEPROGRAMPROC )wglGetProcAddress( "glCreateProgram" );
356  glAttachShader = ( PFNGLATTACHSHADERPROC )wglGetProcAddress( "glAttachShader" );
357  glDetachShader = ( PFNGLDETACHSHADERPROC )wglGetProcAddress( "glDetachShader" );
358  glLinkProgram = ( PFNGLLINKPROGRAMPROC )wglGetProcAddress( "glLinkProgram" );
359  glGetProgramiv = ( PFNGLGETPROGRAMIVPROC )wglGetProcAddress( "glGetProgramiv" );
360  glGetProgramInfoLog = ( PFNGLGETPROGRAMINFOLOGPROC )wglGetProcAddress( "glGetProgramInfoLog" );
361  glGetUniformLocation = ( PFNGLGETUNIFORMLOCATIONPROC )wglGetProcAddress( "glGetUniformLocation" );
362  glUniform2iv = ( PFNGLUNIFORM2IVARBPROC )wglGetProcAddress( "glUniform2iv" );
363 
364  bool loadOK = true;
365  if ( !glShaderSource || !glCompileShader ||
370  {
371  loadOK = false;
372  }
373  return loadOK;
374 }
375 
376 //---------------------------------------------------------------------------
378 {
379  glFenceSync = ( PFNGLFENCESYNCPROC ) wglGetProcAddress( "glFenceSync" );
380  glIsSync = ( PFNGLISSYNCPROC ) wglGetProcAddress( "glIsSync" );
381  glDeleteSync = ( PFNGLDELETESYNCPROC ) wglGetProcAddress( "glDeleteSync" );
382  glClientWaitSync = ( PFNGLCLIENTWAITSYNCPROC ) wglGetProcAddress( "glClientWaitSync" );
383  glWaitSync = ( PFNGLWAITSYNCPROC ) wglGetProcAddress( "glWaitSync" );
384  glGetSynciv = ( PFNGLGETSYNCIVPROC ) wglGetProcAddress( "glGetSynciv" );
385 
386  bool loadOK =
387  ( glFenceSync != NULL ) &&
388  ( glIsSync != NULL ) &&
389  ( glDeleteSync != NULL ) &&
390  ( glClientWaitSync != NULL ) &&
391  ( glWaitSync != NULL ) &&
392  ( glGetSynciv != NULL );
393 
394  return loadOK;
395 }
396 
397 //---------------------------------------------------------------------------
399 {
400  bool fboOK, gpuAffinityOK, vboOK, timerQueryOK, swapOK, pixelFormatOK;
401 
403 
404  gpuAffinityOK = loadAffinityExtension();
405 
406  vboOK = loadBufferObjectExtension();
407 
408  timerQueryOK = loadTimerQueryExtension();
409 
410  swapOK = loadSwapIntervalExtension();
411 
412  pixelFormatOK = loadPixelFormatExtension();
413 
414  return fboOK && gpuAffinityOK && vboOK && swapOK && pixelFormatOK && timerQueryOK;
415 }
PFNWGLENUMGPUSNVPROC wglEnumGpusNV
PFNGLVIDEOCAPTURENVPROC glVideoCaptureNV
bool loadExtensionFunctions(void)
PFNGLPRESENTFRAMEDUALFILLNVPROC glPresentFrameDualFillNV
PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC glGetRenderbufferParameterivEXT
PFNGLFENCESYNCPROC glFenceSync
ext function
PFNGLBEGINVIDEOCAPTURENVPROC glBeginVideoCaptureNV
PFNGLUNMAPBUFFERPROC glUnmapBuffer
PFNGLDELETEFRAMEBUFFERSEXTPROC glDeleteFramebuffersEXT
PFNWGLCHOOSEPIXELFORMATARBPROC wglChoosePixelFormat
PFNGLVIDEOCAPTURESTREAMPARAMETERFVNVPROC glVideoCaptureStreamParameterfvNV
bool loadShaderObjectsExtension(void)
PFNGLGETINTEGER64VPROC glGetInteger64v
PFNWGLBINDVIDEODEVICENVPROC wglBindVideoDeviceNV
PFNWGLSWAPINTERVALEXTPROC wglSwapIntervalEXT
PFNGLENDVIDEOCAPTURENVPROC glEndVideoCaptureNV
PFNGLISSYNCPROC glIsSync
ext function
PFNGLCREATESHADERPROC glCreateShader
bool loadCopyImageExtension()
PFNGLGENQUERIESPROC glGenQueries
PFNGLENDQUERYPROC glEndQuery
PFNGLFRAMEBUFFERTEXTURE1DEXTPROC glFramebufferTexture1DEXT
PFNWGLENUMGPUSFROMAFFINITYDCNVPROC wglEnumGpusFromAffinityDCNV
PFNGLFRAMEBUFFERTEXTURE2DEXTPROC glFramebufferTexture2DEXT
PFNGLISRENDERBUFFEREXTPROC glIsRenderbufferEXT
bool loadSyncExtension()
PFNGLGETQUERYOBJECTUI64VEXTPROC glGetQueryObjectui64vEXT
PFNGLBINDRENDERBUFFEREXTPROC glBindRenderbufferEXT
PFNGLSHADERSOURCEARBPROC glShaderSource
Shader objects.
PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC wglLockVideoCaptureDeviceNV
PFNGLBINDVIDEOCAPTURESTREAMTEXTURENVPROC glBindVideoCaptureStreamTextureNV
PFNGLDELETESHADERPROC glDeleteShader
bool loadSwapIntervalExtension()
PFNGLBUFFERSUBDATAARBPROC glBufferSubData
PFNWGLCOPYIMAGESUBDATANVPROC wglCopyImageSubDataNV
PFNWGLDELETEDCNVPROC wglDeleteDCNV
PFNGLGETBUFFERSUBDATAPROC glGetBufferSubData
bool loadBufferObjectExtension()
bool loadFramebufferObjectExtension()
bool loadTimerQueryExtension()
PFNWGLCREATEAFFINITYDCNVPROC wglCreateAffinityDCNV
PFNGLGETSYNCIVPROC glGetSynciv
ext function
PFNGLBINDFRAMEBUFFEREXTPROC glBindFramebufferEXT
PFNGLGETSHADERIVPROC glGetShaderiv
PFNGLGETVIDEOCAPTURESTREAMIVNVPROC glGetVideoCaptureStreamivNV
PFNWGLENUMERATEVIDEODEVICESNVPROC wglEnumerateVideoDevicesNV
PFNGLGENFRAMEBUFFERSEXTPROC glGenFramebuffersEXT
PFNGLGETVIDEOUIVNVPROC glGetVideouivNV
PFNGLVIDEOCAPTURESTREAMPARAMETERIVNVPROC glVideoCaptureStreamParameterivNV
PFNGLGETSHADERINFOLOGPROC glGetShaderInfoLog
PFNGLFRAMEBUFFERTEXTURE3DEXTPROC glFramebufferTexture3DEXT
PFNGLGETVIDEOI64VNVPROC glGetVideoi64vNV
PFNGLDETACHSHADERPROC glDetachShader
PFNGLBUFFERDATAARBPROC glBufferData
PFNGLDELETEPROGRAMPROC glDeleteProgram
PFNGLGENRENDERBUFFERSEXTPROC glGenRenderbuffersEXT
PFNGLMAPBUFFERRANGEPROC glMapBufferRange
PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC wglEnumerateVideoCaptureDevicesNV
PFNGLCLIENTWAITSYNCPROC glClientWaitSync
ext function
PFNGLDELETEBUFFERSARBPROC glDeleteBuffers
PFNGLGETVIDEOUI64VNVPROC glGetVideoui64vNV
PFNGLCOMPILESHADERARBPROC glCompileShader
PFNGLCREATEPROGRAMPROC glCreateProgram
PFNGLLINKPROGRAMPROC glLinkProgram
PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC wglReleaseVideoCaptureDeviceNV
PFNGLDELETEQUERIESPROC glDeleteQueries
PFNGLUNIFORM2IVARBPROC glUniform2iv
PFNGLATTACHSHADERPROC glAttachShader
PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC wglQueryVideoCaptureDeviceNV
PFNWGLENUMGPUDEVICESNVPROC wglEnumGpuDevicesNV
PFNGLGETVIDEOIVNVPROC glGetVideoivNV
PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC glCheckFramebufferStatusEXT
PFNGLGETPROGRAMINFOLOGPROC glGetProgramInfoLog
PFNGLUSEPROGRAMPROC glUseProgram
PFNGLGETPROGRAMIVPROC glGetProgramiv
PFNGLRENDERBUFFERSTORAGEEXTPROC glRenderbufferStorageEXT
bool loadPixelFormatExtension()
bool loadCaptureVideoExtension()
PFNGLPRESENTFRAMEKEYEDNVPROC glPresentFrameKeyedNV
PFNGLBLITFRAMEBUFFEREXTPROC glBlitFramebufferEXT
bool loadAffinityExtension()
PFNGLCOPYBUFFERSUBDATAPROC glCopyBufferSubData
PFNGLWAITSYNCPROC glWaitSync
ext function
PFNGLGETUNIFORMLOCATIONPROC glGetUniformLocation
PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC glFramebufferRenderbufferEXT
PFNWGLQUERYCURRENTCONTEXTNVPROC wglQueryCurrentContextNV
PFNGLISFRAMEBUFFEREXTPROC glIsFramebufferEXT
bool loadPresentVideoExtension()
PFNGLGENERATEMIPMAPEXTPROC glGenerateMipmapEXT
PFNGLBINDVIDEOCAPTURESTREAMBUFFERNVPROC glBindVideoCaptureStreamBufferNV
PFNGLDELETERENDERBUFFERSEXTPROC glDeleteRenderbuffersEXT
PFNGLDELETESYNCPROC glDeleteSync
ext function
PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC glGetFramebufferAttachmentParameterivEXT
PFNGLBINDBUFFERARBPROC glBindBuffer
PFNGLGENBUFFERSARBPROC glGenBuffers
PFNWGLBINDVIDEOCAPTUREDEVICENVPROC wglBindVideoCaptureDeviceNV
PFNGLGETQUERYOBJECTUIVPROC glGetQueryObjectuiv
PFNGLMAPBUFFERPROC glMapBuffer
PFNGLBEGINQUERYPROC glBeginQuery