wgl_context.c
Go to the documentation of this file.
1 //========================================================================
2 // GLFW 3.3 WGL - www.glfw.org
3 //------------------------------------------------------------------------
4 // Copyright (c) 2002-2006 Marcus Geelnard
5 // Copyright (c) 2006-2016 Camilla Löwy <elmindreda@glfw.org>
6 //
7 // This software is provided 'as-is', without any express or implied
8 // warranty. In no event will the authors be held liable for any damages
9 // arising from the use of this software.
10 //
11 // Permission is granted to anyone to use this software for any purpose,
12 // including commercial applications, and to alter it and redistribute it
13 // freely, subject to the following restrictions:
14 //
15 // 1. The origin of this software must not be misrepresented; you must not
16 // claim that you wrote the original software. If you use this software
17 // in a product, an acknowledgment in the product documentation would
18 // be appreciated but is not required.
19 //
20 // 2. Altered source versions must be plainly marked as such, and must not
21 // be misrepresented as being the original software.
22 //
23 // 3. This notice may not be removed or altered from any source
24 // distribution.
25 //
26 //========================================================================
27 
28 #include "internal.h"
29 
30 #include <stdlib.h>
31 #include <malloc.h>
32 #include <assert.h>
33 
34 
35 // Returns the specified attribute of the specified pixel format
36 //
37 static int getPixelFormatAttrib(_GLFWwindow* window, int pixelFormat, int attrib)
38 {
39  int value = 0;
40 
41  assert(_glfw.wgl.ARB_pixel_format);
42 
43  if (!_glfw.wgl.GetPixelFormatAttribivARB(window->context.wgl.dc,
44  pixelFormat,
45  0, 1, &attrib, &value))
46  {
48  "WGL: Failed to retrieve pixel format attribute");
49  return 0;
50  }
51 
52  return value;
53 }
54 
55 // Return a list of available and usable framebuffer configs
56 //
58  const _GLFWctxconfig* ctxconfig,
59  const _GLFWfbconfig* fbconfig)
60 {
61  _GLFWfbconfig* usableConfigs;
62  const _GLFWfbconfig* closest;
63  int i, pixelFormat, nativeCount, usableCount;
64 
65  if (_glfw.wgl.ARB_pixel_format)
66  {
67  nativeCount = getPixelFormatAttrib(window,
68  1,
70  }
71  else
72  {
73  nativeCount = DescribePixelFormat(window->context.wgl.dc,
74  1,
75  sizeof(PIXELFORMATDESCRIPTOR),
76  NULL);
77  }
78 
79  usableConfigs = calloc(nativeCount, sizeof(_GLFWfbconfig));
80  usableCount = 0;
81 
82  for (i = 0; i < nativeCount; i++)
83  {
84  const int n = i + 1;
85  _GLFWfbconfig* u = usableConfigs + usableCount;
86 
87  if (_glfw.wgl.ARB_pixel_format)
88  {
89  // Get pixel format attributes through "modern" extension
90 
93  {
94  continue;
95  }
96 
97  if (getPixelFormatAttrib(window, n, WGL_PIXEL_TYPE_ARB) !=
99  {
100  continue;
101  }
102 
103  if (getPixelFormatAttrib(window, n, WGL_ACCELERATION_ARB) ==
105  {
106  continue;
107  }
108 
113 
116 
121 
123 
124  if (getPixelFormatAttrib(window, n, WGL_STEREO_ARB))
125  u->stereo = GLFW_TRUE;
127  u->doublebuffer = GLFW_TRUE;
128 
129  if (_glfw.wgl.ARB_multisample)
131 
132  if (ctxconfig->client == GLFW_OPENGL_API)
133  {
134  if (_glfw.wgl.ARB_framebuffer_sRGB ||
135  _glfw.wgl.EXT_framebuffer_sRGB)
136  {
138  u->sRGB = GLFW_TRUE;
139  }
140  }
141  else
142  {
143  if (_glfw.wgl.EXT_colorspace)
144  {
145  if (getPixelFormatAttrib(window, n, WGL_COLORSPACE_EXT) ==
147  {
148  u->sRGB = GLFW_TRUE;
149  }
150  }
151  }
152  }
153  else
154  {
155  // Get pixel format attributes through legacy PFDs
156 
157  PIXELFORMATDESCRIPTOR pfd;
158 
159  if (!DescribePixelFormat(window->context.wgl.dc,
160  n,
161  sizeof(PIXELFORMATDESCRIPTOR),
162  &pfd))
163  {
164  continue;
165  }
166 
167  if (!(pfd.dwFlags & PFD_DRAW_TO_WINDOW) ||
168  !(pfd.dwFlags & PFD_SUPPORT_OPENGL))
169  {
170  continue;
171  }
172 
173  if (!(pfd.dwFlags & PFD_GENERIC_ACCELERATED) &&
174  (pfd.dwFlags & PFD_GENERIC_FORMAT))
175  {
176  continue;
177  }
178 
179  if (pfd.iPixelType != PFD_TYPE_RGBA)
180  continue;
181 
182  u->redBits = pfd.cRedBits;
183  u->greenBits = pfd.cGreenBits;
184  u->blueBits = pfd.cBlueBits;
185  u->alphaBits = pfd.cAlphaBits;
186 
187  u->depthBits = pfd.cDepthBits;
188  u->stencilBits = pfd.cStencilBits;
189 
190  u->accumRedBits = pfd.cAccumRedBits;
191  u->accumGreenBits = pfd.cAccumGreenBits;
192  u->accumBlueBits = pfd.cAccumBlueBits;
193  u->accumAlphaBits = pfd.cAccumAlphaBits;
194 
195  u->auxBuffers = pfd.cAuxBuffers;
196 
197  if (pfd.dwFlags & PFD_STEREO)
198  u->stereo = GLFW_TRUE;
199  if (pfd.dwFlags & PFD_DOUBLEBUFFER)
200  u->doublebuffer = GLFW_TRUE;
201  }
202 
203  u->handle = n;
204  usableCount++;
205  }
206 
207  if (!usableCount)
208  {
210  "WGL: The driver does not appear to support OpenGL");
211 
212  free(usableConfigs);
213  return 0;
214  }
215 
216  closest = _glfwChooseFBConfig(fbconfig, usableConfigs, usableCount);
217  if (!closest)
218  {
220  "WGL: Failed to find a suitable pixel format");
221 
222  free(usableConfigs);
223  return 0;
224  }
225 
226  pixelFormat = (int) closest->handle;
227  free(usableConfigs);
228 
229  return pixelFormat;
230 }
231 
233 {
234  if (window)
235  {
236  if (wglMakeCurrent(window->context.wgl.dc, window->context.wgl.handle))
238  else
239  {
241  "WGL: Failed to make context current");
243  }
244  }
245  else
246  {
247  if (!wglMakeCurrent(NULL, NULL))
248  {
250  "WGL: Failed to clear current context");
251  }
252 
254  }
255 }
256 
258 {
259  if (!window->monitor)
260  {
262  {
263  BOOL enabled;
264 
265  // HACK: Use DwmFlush when desktop composition is enabled
266  if (SUCCEEDED(DwmIsCompositionEnabled(&enabled)) && enabled)
267  {
268  int count = abs(window->context.wgl.interval);
269  while (count--)
270  DwmFlush();
271  }
272  }
273  }
274 
275  SwapBuffers(window->context.wgl.dc);
276 }
277 
278 static void swapIntervalWGL(int interval)
279 {
281 
282  window->context.wgl.interval = interval;
283 
284  if (!window->monitor)
285  {
287  {
288  BOOL enabled;
289 
290  // HACK: Disable WGL swap interval when desktop composition is enabled to
291  // avoid interfering with DWM vsync
292  if (SUCCEEDED(DwmIsCompositionEnabled(&enabled)) && enabled)
293  interval = 0;
294  }
295  }
296 
297  if (_glfw.wgl.EXT_swap_control)
298  _glfw.wgl.SwapIntervalEXT(interval);
299 }
300 
301 static int extensionSupportedWGL(const char* extension)
302 {
303  const char* extensions = NULL;
304 
305  if (_glfw.wgl.GetExtensionsStringARB)
306  extensions = _glfw.wgl.GetExtensionsStringARB(wglGetCurrentDC());
307  else if (_glfw.wgl.GetExtensionsStringEXT)
308  extensions = _glfw.wgl.GetExtensionsStringEXT();
309 
310  if (!extensions)
311  return GLFW_FALSE;
312 
313  return _glfwStringInExtensionString(extension, extensions);
314 }
315 
316 static GLFWglproc getProcAddressWGL(const char* procname)
317 {
318  const GLFWglproc proc = (GLFWglproc) wglGetProcAddress(procname);
319  if (proc)
320  return proc;
321 
322  return (GLFWglproc) GetProcAddress(_glfw.wgl.instance, procname);
323 }
324 
325 // Destroy the OpenGL context
326 //
328 {
329  if (window->context.wgl.handle)
330  {
331  wglDeleteContext(window->context.wgl.handle);
332  window->context.wgl.handle = NULL;
333  }
334 }
335 
336 
340 
341 // Initialize WGL
342 //
344 {
345  PIXELFORMATDESCRIPTOR pfd;
346  HGLRC prc, rc;
347  HDC pdc, dc;
348 
349  if (_glfw.wgl.instance)
350  return GLFW_TRUE;
351 
352  _glfw.wgl.instance = LoadLibraryA("opengl32.dll");
353  if (!_glfw.wgl.instance)
354  {
356  "WGL: Failed to load opengl32.dll");
357  return GLFW_FALSE;
358  }
359 
360  _glfw.wgl.CreateContext = (PFN_wglCreateContext)
361  GetProcAddress(_glfw.wgl.instance, "wglCreateContext");
362  _glfw.wgl.DeleteContext = (PFN_wglDeleteContext)
363  GetProcAddress(_glfw.wgl.instance, "wglDeleteContext");
364  _glfw.wgl.GetProcAddress = (PFN_wglGetProcAddress)
365  GetProcAddress(_glfw.wgl.instance, "wglGetProcAddress");
366  _glfw.wgl.GetCurrentDC = (PFN_wglGetCurrentDC)
367  GetProcAddress(_glfw.wgl.instance, "wglGetCurrentDC");
368  _glfw.wgl.GetCurrentContext = (PFN_wglGetCurrentContext)
369  GetProcAddress(_glfw.wgl.instance, "wglGetCurrentContext");
370  _glfw.wgl.MakeCurrent = (PFN_wglMakeCurrent)
371  GetProcAddress(_glfw.wgl.instance, "wglMakeCurrent");
372  _glfw.wgl.ShareLists = (PFN_wglShareLists)
373  GetProcAddress(_glfw.wgl.instance, "wglShareLists");
374 
375  // NOTE: A dummy context has to be created for opengl32.dll to load the
376  // OpenGL ICD, from which we can then query WGL extensions
377  // NOTE: This code will accept the Microsoft GDI ICD; accelerated context
378  // creation failure occurs during manual pixel format enumeration
379 
380  dc = GetDC(_glfw.win32.helperWindowHandle);;
381 
382  ZeroMemory(&pfd, sizeof(pfd));
383  pfd.nSize = sizeof(pfd);
384  pfd.nVersion = 1;
385  pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_DOUBLEBUFFER;
386  pfd.iPixelType = PFD_TYPE_RGBA;
387  pfd.cColorBits = 24;
388 
389  if (!SetPixelFormat(dc, ChoosePixelFormat(dc, &pfd), &pfd))
390  {
392  "WGL: Failed to set pixel format for dummy context");
393  return GLFW_FALSE;
394  }
395 
396  rc = wglCreateContext(dc);
397  if (!rc)
398  {
400  "WGL: Failed to create dummy context");
401  return GLFW_FALSE;
402  }
403 
404  pdc = wglGetCurrentDC();
405  prc = wglGetCurrentContext();
406 
407  if (!wglMakeCurrent(dc, rc))
408  {
410  "WGL: Failed to make dummy context current");
411  wglMakeCurrent(pdc, prc);
412  wglDeleteContext(rc);
413  return GLFW_FALSE;
414  }
415 
416  // NOTE: Functions must be loaded first as they're needed to retrieve the
417  // extension string that tells us whether the functions are supported
418  _glfw.wgl.GetExtensionsStringEXT = (PFNWGLGETEXTENSIONSSTRINGEXTPROC)
419  wglGetProcAddress("wglGetExtensionsStringEXT");
420  _glfw.wgl.GetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)
421  wglGetProcAddress("wglGetExtensionsStringARB");
422  _glfw.wgl.CreateContextAttribsARB = (PFNWGLCREATECONTEXTATTRIBSARBPROC)
423  wglGetProcAddress("wglCreateContextAttribsARB");
424  _glfw.wgl.SwapIntervalEXT = (PFNWGLSWAPINTERVALEXTPROC)
425  wglGetProcAddress("wglSwapIntervalEXT");
426  _glfw.wgl.GetPixelFormatAttribivARB = (PFNWGLGETPIXELFORMATATTRIBIVARBPROC)
427  wglGetProcAddress("wglGetPixelFormatAttribivARB");
428 
429  // NOTE: WGL_ARB_extensions_string and WGL_EXT_extensions_string are not
430  // checked below as we are already using them
431  _glfw.wgl.ARB_multisample =
432  extensionSupportedWGL("WGL_ARB_multisample");
433  _glfw.wgl.ARB_framebuffer_sRGB =
434  extensionSupportedWGL("WGL_ARB_framebuffer_sRGB");
435  _glfw.wgl.EXT_framebuffer_sRGB =
436  extensionSupportedWGL("WGL_EXT_framebuffer_sRGB");
437  _glfw.wgl.ARB_create_context =
438  extensionSupportedWGL("WGL_ARB_create_context");
439  _glfw.wgl.ARB_create_context_profile =
440  extensionSupportedWGL("WGL_ARB_create_context_profile");
441  _glfw.wgl.EXT_create_context_es2_profile =
442  extensionSupportedWGL("WGL_EXT_create_context_es2_profile");
443  _glfw.wgl.ARB_create_context_robustness =
444  extensionSupportedWGL("WGL_ARB_create_context_robustness");
445  _glfw.wgl.ARB_create_context_no_error =
446  extensionSupportedWGL("WGL_ARB_create_context_no_error");
447  _glfw.wgl.EXT_swap_control =
448  extensionSupportedWGL("WGL_EXT_swap_control");
449  _glfw.wgl.EXT_colorspace =
450  extensionSupportedWGL("WGL_EXT_colorspace");
451  _glfw.wgl.ARB_pixel_format =
452  extensionSupportedWGL("WGL_ARB_pixel_format");
453  _glfw.wgl.ARB_context_flush_control =
454  extensionSupportedWGL("WGL_ARB_context_flush_control");
455 
456  wglMakeCurrent(pdc, prc);
457  wglDeleteContext(rc);
458  return GLFW_TRUE;
459 }
460 
461 // Terminate WGL
462 //
464 {
465  if (_glfw.wgl.instance)
466  FreeLibrary(_glfw.wgl.instance);
467 }
468 
469 #define setAttrib(a, v) \
470 { \
471  assert((size_t) (index + 1) < sizeof(attribs) / sizeof(attribs[0])); \
472  attribs[index++] = a; \
473  attribs[index++] = v; \
474 }
475 
476 // Create the OpenGL or OpenGL ES context
477 //
479  const _GLFWctxconfig* ctxconfig,
480  const _GLFWfbconfig* fbconfig)
481 {
482  int attribs[40];
483  int pixelFormat;
484  PIXELFORMATDESCRIPTOR pfd;
485  HGLRC share = NULL;
486 
487  if (ctxconfig->share)
488  share = ctxconfig->share->context.wgl.handle;
489 
490  window->context.wgl.dc = GetDC(window->win32.handle);
491  if (!window->context.wgl.dc)
492  {
494  "WGL: Failed to retrieve DC for window");
495  return GLFW_FALSE;
496  }
497 
498  pixelFormat = choosePixelFormat(window, ctxconfig, fbconfig);
499  if (!pixelFormat)
500  return GLFW_FALSE;
501 
502  if (!DescribePixelFormat(window->context.wgl.dc,
503  pixelFormat, sizeof(pfd), &pfd))
504  {
506  "WGL: Failed to retrieve PFD for selected pixel format");
507  return GLFW_FALSE;
508  }
509 
510  if (!SetPixelFormat(window->context.wgl.dc, pixelFormat, &pfd))
511  {
513  "WGL: Failed to set selected pixel format");
514  return GLFW_FALSE;
515  }
516 
517  if (ctxconfig->client == GLFW_OPENGL_API)
518  {
519  if (ctxconfig->forward)
520  {
521  if (!_glfw.wgl.ARB_create_context)
522  {
524  "WGL: A forward compatible OpenGL context requested but WGL_ARB_create_context is unavailable");
525  return GLFW_FALSE;
526  }
527  }
528 
529  if (ctxconfig->profile)
530  {
531  if (!_glfw.wgl.ARB_create_context_profile)
532  {
534  "WGL: OpenGL profile requested but WGL_ARB_create_context_profile is unavailable");
535  return GLFW_FALSE;
536  }
537  }
538  }
539  else
540  {
541  if (!_glfw.wgl.ARB_create_context ||
542  !_glfw.wgl.ARB_create_context_profile ||
543  !_glfw.wgl.EXT_create_context_es2_profile)
544  {
546  "WGL: OpenGL ES requested but WGL_ARB_create_context_es2_profile is unavailable");
547  return GLFW_FALSE;
548  }
549  }
550 
551  if (_glfw.wgl.ARB_create_context)
552  {
553  int index = 0, mask = 0, flags = 0;
554 
555  if (ctxconfig->client == GLFW_OPENGL_API)
556  {
557  if (ctxconfig->forward)
559 
560  if (ctxconfig->profile == GLFW_OPENGL_CORE_PROFILE)
562  else if (ctxconfig->profile == GLFW_OPENGL_COMPAT_PROFILE)
564  }
565  else
567 
568  if (ctxconfig->debug)
570 
571  if (ctxconfig->robustness)
572  {
573  if (_glfw.wgl.ARB_create_context_robustness)
574  {
575  if (ctxconfig->robustness == GLFW_NO_RESET_NOTIFICATION)
576  {
579  }
580  else if (ctxconfig->robustness == GLFW_LOSE_CONTEXT_ON_RESET)
581  {
584  }
585 
587  }
588  }
589 
590  if (ctxconfig->release)
591  {
592  if (_glfw.wgl.ARB_context_flush_control)
593  {
594  if (ctxconfig->release == GLFW_RELEASE_BEHAVIOR_NONE)
595  {
598  }
599  else if (ctxconfig->release == GLFW_RELEASE_BEHAVIOR_FLUSH)
600  {
603  }
604  }
605  }
606 
607  if (ctxconfig->noerror)
608  {
609  if (_glfw.wgl.ARB_create_context_no_error)
611  }
612 
613  // NOTE: Only request an explicitly versioned context when necessary, as
614  // explicitly requesting version 1.0 does not always return the
615  // highest version supported by the driver
616  if (ctxconfig->major != 1 || ctxconfig->minor != 0)
617  {
620  }
621 
622  if (flags)
624 
625  if (mask)
627 
628  setAttrib(0, 0);
629 
630  window->context.wgl.handle =
631  _glfw.wgl.CreateContextAttribsARB(window->context.wgl.dc,
632  share, attribs);
633  if (!window->context.wgl.handle)
634  {
635  const DWORD error = GetLastError();
636 
637  if (error == (0xc0070000 | ERROR_INVALID_VERSION_ARB))
638  {
639  if (ctxconfig->client == GLFW_OPENGL_API)
640  {
642  "WGL: Driver does not support OpenGL version %i.%i",
643  ctxconfig->major,
644  ctxconfig->minor);
645  }
646  else
647  {
649  "WGL: Driver does not support OpenGL ES version %i.%i",
650  ctxconfig->major,
651  ctxconfig->minor);
652  }
653  }
654  else if (error == (0xc0070000 | ERROR_INVALID_PROFILE_ARB))
655  {
657  "WGL: Driver does not support the requested OpenGL profile");
658  }
659  else if (error == (0xc0070000 | ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB))
660  {
662  "WGL: The share context is not compatible with the requested context");
663  }
664  else
665  {
666  if (ctxconfig->client == GLFW_OPENGL_API)
667  {
669  "WGL: Failed to create OpenGL context");
670  }
671  else
672  {
674  "WGL: Failed to create OpenGL ES context");
675  }
676  }
677 
678  return GLFW_FALSE;
679  }
680  }
681  else
682  {
683  window->context.wgl.handle = wglCreateContext(window->context.wgl.dc);
684  if (!window->context.wgl.handle)
685  {
687  "WGL: Failed to create OpenGL context");
688  return GLFW_FALSE;
689  }
690 
691  if (share)
692  {
693  if (!wglShareLists(share, window->context.wgl.handle))
694  {
696  "WGL: Failed to enable sharing with specified OpenGL context");
697  return GLFW_FALSE;
698  }
699  }
700  }
701 
708 
709  return GLFW_TRUE;
710 }
711 
712 #undef setAttrib
713 
714 
718 
720 {
721  _GLFWwindow* window = (_GLFWwindow*) handle;
723 
724  if (window->context.client == GLFW_NO_API)
725  {
727  return NULL;
728  }
729 
730  return window->context.wgl.handle;
731 }
732 
_GLFWswapbuffersfun swapBuffers
Definition: internal.h:349
#define ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB
Definition: wgl_context.h:77
#define wglGetCurrentDC
Definition: wgl_context.h:97
#define ERROR_INVALID_VERSION_ARB
Definition: wgl_context.h:75
_GLFWwindow * share
Definition: internal.h:297
static int extensionSupportedWGL(const char *extension)
Definition: wgl_context.c:301
_GLFWgetprocaddressfun getProcAddress
Definition: internal.h:352
#define GLFWAPI
Definition: glfw3.h:240
#define WGL_ACCELERATION_ARB
Definition: wgl_context.h:33
#define WGL_BLUE_BITS_ARB
Definition: wgl_context.h:39
#define GLFW_OPENGL_COMPAT_PROFILE
Definition: glfw3.h:999
#define WGL_AUX_BUFFERS_ARB
Definition: wgl_context.h:50
_GLFWtls contextSlot
Definition: internal.h:536
const GLint * attribs
Definition: glext.h:11230
#define WGL_NO_ACCELERATION_ARB
Definition: wgl_context.h:34
GLFWbool sRGB
Definition: internal.h:326
uintptr_t handle
Definition: internal.h:329
#define DwmFlush
GLuint64 GLenum void * handle
Definition: glext.h:7785
HGLRC(WINAPI * PFNWGLCREATECONTEXTATTRIBSARBPROC)(HDC, HGLRC, const int *)
Definition: wgl_context.h:83
BOOL(WINAPI * PFN_wglDeleteContext)(HGLRC)
Definition: wgl_context.h:86
_GLFWdestroycontextfun destroy
Definition: internal.h:353
GLfloat value
GLint GLuint mask
int accumGreenBits
Definition: internal.h:320
#define WGL_NUMBER_PIXEL_FORMATS_ARB
Definition: wgl_context.h:28
static void makeContextCurrentWGL(_GLFWwindow *window)
Definition: wgl_context.c:232
GLFWAPI HGLRC glfwGetWGLContext(GLFWwindow *handle)
Definition: wgl_context.c:719
BOOL(WINAPI * PFN_wglMakeCurrent)(HDC, HGLRC)
Definition: wgl_context.h:90
#define GLFW_FALSE
Zero.
Definition: glfw3.h:287
#define GLFW_NO_WINDOW_CONTEXT
The specified window does not have an OpenGL or OpenGL ES context.
Definition: glfw3.h:753
#define WGL_ACCUM_GREEN_BITS_ARB
Definition: wgl_context.h:45
GLFWbool forward
Definition: internal.h:291
#define GLFW_LOSE_CONTEXT_ON_RESET
Definition: glfw3.h:995
#define GLFW_OPENGL_API
Definition: glfw3.h:990
#define GLFW_API_UNAVAILABLE
GLFW could not find support for the requested API on the system.
Definition: glfw3.h:698
GLFWbool _glfwCreateContextWGL(_GLFWwindow *window, const _GLFWctxconfig *ctxconfig, const _GLFWfbconfig *fbconfig)
Definition: wgl_context.c:478
#define WGL_COLORSPACE_EXT
Definition: wgl_context.h:72
#define GLFW_FORMAT_UNAVAILABLE
The requested format is not supported or available.
Definition: glfw3.h:745
#define WGL_CONTEXT_RELEASE_BEHAVIOR_ARB
Definition: wgl_context.h:68
int stencilBits
Definition: internal.h:318
GLdouble n
Definition: glext.h:1966
#define GLFW_RELEASE_BEHAVIOR_NONE
Definition: glfw3.h:1012
_GLFWcontext context
Definition: internal.h:394
int GLFWbool
Definition: internal.h:61
HGLRC(WINAPI * PFN_wglGetCurrentContext)(void)
Definition: wgl_context.h:89
GLuint index
void(* GLFWglproc)(void)
BOOL(WINAPI * PFNWGLSWAPINTERVALEXTPROC)(int)
Definition: wgl_context.h:79
#define _GLFW_REQUIRE_INIT_OR_RETURN(x)
Definition: internal.h:210
const _GLFWfbconfig * _glfwChooseFBConfig(const _GLFWfbconfig *desired, const _GLFWfbconfig *alternatives, unsigned int count)
Definition: context.c:176
#define WGL_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB
Definition: wgl_context.h:69
#define GLFW_PLATFORM_ERROR
A platform-specific error occurred that does not match any of the more specific categories.
Definition: glfw3.h:726
#define WGL_CONTEXT_DEBUG_BIT_ARB
Definition: wgl_context.h:55
#define WGL_CONTEXT_ES2_PROFILE_BIT_EXT
Definition: wgl_context.h:63
_GLFWlibrary _glfw
Definition: init.c:44
#define WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB
Definition: wgl_context.h:59
HGLRC(WINAPI * PFN_wglCreateContext)(HDC)
Definition: wgl_context.h:85
#define WGL_CONTEXT_PROFILE_MASK_ARB
Definition: wgl_context.h:57
#define WGL_STENCIL_BITS_ARB
Definition: wgl_context.h:49
GLFWbool _glfwStringInExtensionString(const char *string, const char *extensions)
Definition: context.c:580
#define WGL_CONTEXT_ROBUST_ACCESS_BIT_ARB
Definition: wgl_context.h:64
#define WGL_LOSE_CONTEXT_ON_RESET_ARB
Definition: wgl_context.h:65
void _glfwInputErrorWin32(int error, const char *description)
Definition: win32_init.c:440
#define WGL_DRAW_TO_WINDOW_ARB
Definition: wgl_context.h:30
int accumBlueBits
Definition: internal.h:321
GLFWbool noerror
Definition: internal.h:293
GLbitfield flags
_GLFWmakecontextcurrentfun makeCurrent
Definition: internal.h:348
GLenum GLenum GLsizei const GLuint GLboolean enabled
#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB
Definition: wgl_context.h:56
const char *(WINAPI * PFNWGLGETEXTENSIONSSTRINGARBPROC)(HDC)
Definition: wgl_context.h:82
int auxBuffers
Definition: internal.h:323
BOOL(WINAPI * PFN_wglShareLists)(HGLRC, HGLRC)
Definition: wgl_context.h:91
#define wglCreateContext
Definition: wgl_context.h:94
void _glfwInputError(int code, const char *format,...)
Definition: init.c:129
#define WGL_CONTEXT_CORE_PROFILE_BIT_ARB
Definition: wgl_context.h:58
_GLFWextensionsupportedfun extensionSupported
Definition: internal.h:351
GLFWbool debug
Definition: internal.h:292
#define GLFW_RELEASE_BEHAVIOR_FLUSH
Definition: glfw3.h:1011
#define WGL_ALPHA_BITS_ARB
Definition: wgl_context.h:41
#define wglDeleteContext
Definition: wgl_context.h:95
#define IsWindowsVistaOrGreater()
static void swapBuffersWGL(_GLFWwindow *window)
Definition: wgl_context.c:257
#define WGL_TYPE_RGBA_ARB
Definition: wgl_context.h:32
#define GLFW_VERSION_UNAVAILABLE
The requested OpenGL or OpenGL ES version is not available.
Definition: glfw3.h:715
#define wglGetProcAddress
Definition: wgl_context.h:96
_GLFWswapintervalfun swapInterval
Definition: internal.h:350
HDC(WINAPI * PFN_wglGetCurrentDC)(void)
Definition: wgl_context.h:88
#define wglMakeCurrent
Definition: wgl_context.h:99
#define GLFW_TRUE
One.
Definition: glfw3.h:279
#define wglGetCurrentContext
Definition: wgl_context.h:98
static void destroyContextWGL(_GLFWwindow *window)
Definition: wgl_context.c:327
#define GLFW_INVALID_VALUE
One of the arguments to the function was an invalid value.
Definition: glfw3.h:674
#define wglShareLists
Definition: wgl_context.h:100
void _glfwPlatformSetTls(_GLFWtls *tls, void *value)
Definition: posix_thread.c:66
#define WGL_ACCUM_BLUE_BITS_ARB
Definition: wgl_context.h:46
#define WGL_NO_RESET_NOTIFICATION_ARB
Definition: wgl_context.h:67
#define WGL_GREEN_BITS_ARB
Definition: wgl_context.h:37
#define WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB
Definition: wgl_context.h:54
#define setAttrib(a, v)
Definition: wgl_context.c:469
GLFWbool stereo
Definition: internal.h:324
void _glfwTerminateWGL(void)
Definition: wgl_context.c:463
static GLFWglproc getProcAddressWGL(const char *procname)
Definition: wgl_context.c:316
static int choosePixelFormat(_GLFWwindow *window, const _GLFWctxconfig *ctxconfig, const _GLFWfbconfig *fbconfig)
Definition: wgl_context.c:57
#define WGL_ACCUM_ALPHA_BITS_ARB
Definition: wgl_context.h:47
#define GLFW_OPENGL_CORE_PROFILE
Definition: glfw3.h:998
#define WGL_SAMPLES_ARB
Definition: wgl_context.h:53
static int getPixelFormatAttrib(_GLFWwindow *window, int pixelFormat, int attrib)
Definition: wgl_context.c:37
GLint GLsizei count
#define WGL_CONTEXT_FLAGS_ARB
Definition: wgl_context.h:62
#define WGL_CONTEXT_OPENGL_NO_ERROR_ARB
Definition: wgl_context.h:71
GLFWbool _glfwInitWGL(void)
Definition: wgl_context.c:343
#define WGL_ACCUM_RED_BITS_ARB
Definition: wgl_context.h:44
static void swapIntervalWGL(int interval)
Definition: wgl_context.c:278
void * _glfwPlatformGetTls(_GLFWtls *tls)
Definition: posix_thread.c:60
#define DwmIsCompositionEnabled
#define WGL_DEPTH_BITS_ARB
Definition: wgl_context.h:48
int accumAlphaBits
Definition: internal.h:322
#define WGL_RED_BITS_ARB
Definition: wgl_context.h:35
GLFWbool doublebuffer
Definition: internal.h:327
PROC(WINAPI * PFN_wglGetProcAddress)(LPCSTR)
Definition: wgl_context.h:87
#define NULL
Definition: tinycthread.c:47
int i
#define WGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB
Definition: wgl_context.h:66
#define WGL_STEREO_ARB
Definition: wgl_context.h:51
#define WGL_SUPPORT_OPENGL_ARB
Definition: wgl_context.h:29
#define WGL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB
Definition: wgl_context.h:70
const char *(WINAPI * PFNWGLGETEXTENSIONSSTRINGEXTPROC)(void)
Definition: wgl_context.h:81
#define WGL_CONTEXT_MAJOR_VERSION_ARB
Definition: wgl_context.h:60
#define ERROR_INVALID_PROFILE_ARB
Definition: wgl_context.h:76
#define WGL_DOUBLE_BUFFER_ARB
Definition: wgl_context.h:52
_GLFWmonitor * monitor
Definition: internal.h:378
#define WGL_PIXEL_TYPE_ARB
Definition: wgl_context.h:31
#define GLFW_NO_RESET_NOTIFICATION
Definition: glfw3.h:994
BOOL(WINAPI * PFNWGLGETPIXELFORMATATTRIBIVARBPROC)(HDC, int, int, UINT, const int *, int *)
Definition: wgl_context.h:80
struct GLFWwindow GLFWwindow
int accumRedBits
Definition: internal.h:319
#define WGL_CONTEXT_MINOR_VERSION_ARB
Definition: wgl_context.h:61
#define WGL_COLORSPACE_SRGB_EXT
Definition: wgl_context.h:73
#define GLFW_NO_API
Definition: glfw3.h:989


librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:50:23