GteWGLExtensions.cpp
Go to the documentation of this file.
1 // David Eberly, Geometric Tools, Redmond WA 98052
2 // Copyright (c) 1998-2017
3 // Distributed under the Boost Software License, Version 1.0.
4 // http://www.boost.org/LICENSE_1_0.txt
5 // http://www.geometrictools.com/License/Boost/LICENSE_1_0.txt
6 // File Version: 3.0.1 (2016/07/06)
7 
10 #include <cassert>
11 
12 void* GetOpenGLFunctionPointer(char const* name)
13 {
14  return wglGetProcAddress(name);
15 }
16 
17 template <typename PWGLFunction>
18 static void GetWGLFunction(char const* name, PWGLFunction& function)
19 {
20  function = (PWGLFunction)wglGetProcAddress(name);
21 }
22 
23 
24 static PFNWGLSWAPINTERVALEXTPROC swglSwapIntervalEXT = nullptr;
25 static PFNWGLGETSWAPINTERVALEXTPROC swglGetSwapIntervalEXT = nullptr;
26 
27 int __stdcall wglSwapIntervalEXT(int interval)
28 {
29  int result;
31  {
32  result = swglSwapIntervalEXT(interval);
33  }
34  else
35  {
36  assert(false);
37  result = 0;
38  }
39  return result;
40 }
41 
42 int __stdcall wglGetSwapIntervalEXT(void)
43 {
44  int result;
46  {
47  result = swglGetSwapIntervalEXT();
48  }
49  else
50  {
51  assert(false);
52  result = 0;
53  }
54  return result;
55 }
56 
58 {
59  GetWGLFunction("wglSwapIntervalEXT", swglSwapIntervalEXT);
60  GetWGLFunction("wglGetSwapIntervalEXT", swglGetSwapIntervalEXT);
61 }
62 
static PFNWGLGETSWAPINTERVALEXTPROC swglGetSwapIntervalEXT
GLuint const GLchar * name
Definition: glcorearb.h:781
int __stdcall wglGetSwapIntervalEXT(void)
int __stdcall wglSwapIntervalEXT(int interval)
static PFNWGLSWAPINTERVALEXTPROC swglSwapIntervalEXT
void * GetOpenGLFunctionPointer(char const *name)
void InitializeWGL()
GLuint64EXT * result
Definition: glext.h:10003
static void GetWGLFunction(char const *name, PWGLFunction &function)


geometric_tools_engine
Author(s): Yijiang Huang
autogenerated on Thu Jul 18 2019 04:00:02