wgl_context.c
Go to the documentation of this file.
1 //========================================================================
2 // GLFW 3.1 WGL - www.glfw.org
3 //------------------------------------------------------------------------
4 // Copyright (c) 2002-2006 Marcus Geelnard
5 // Copyright (c) 2006-2010 Camilla Berglund <elmindreda@elmindreda.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 // Initialize WGL-specific extensions
36 //
37 static void initWGLExtensions(_GLFWwindow* window)
38 {
39  // Functions for WGL_EXT_extension_string
40  // NOTE: These are needed by _glfwPlatformExtensionSupported
41  window->wgl.GetExtensionsStringEXT = (PFNWGLGETEXTENSIONSSTRINGEXTPROC)
42  _glfw_wglGetProcAddress("wglGetExtensionsStringEXT");
43  window->wgl.GetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)
44  _glfw_wglGetProcAddress("wglGetExtensionsStringARB");
45 
46  // Functions for WGL_ARB_create_context
47  window->wgl.CreateContextAttribsARB = (PFNWGLCREATECONTEXTATTRIBSARBPROC)
48  _glfw_wglGetProcAddress("wglCreateContextAttribsARB");
49 
50  // Functions for WGL_EXT_swap_control
51  window->wgl.SwapIntervalEXT = (PFNWGLSWAPINTERVALEXTPROC)
52  _glfw_wglGetProcAddress("wglSwapIntervalEXT");
53 
54  // Functions for WGL_ARB_pixel_format
55  window->wgl.GetPixelFormatAttribivARB = (PFNWGLGETPIXELFORMATATTRIBIVARBPROC)
56  _glfw_wglGetProcAddress("wglGetPixelFormatAttribivARB");
57 
58  // This needs to include every extension used below except for
59  // WGL_ARB_extensions_string and WGL_EXT_extensions_string
60  window->wgl.ARB_multisample =
61  _glfwPlatformExtensionSupported("WGL_ARB_multisample");
62  window->wgl.ARB_framebuffer_sRGB =
63  _glfwPlatformExtensionSupported("WGL_ARB_framebuffer_sRGB");
64  window->wgl.EXT_framebuffer_sRGB =
65  _glfwPlatformExtensionSupported("WGL_EXT_framebuffer_sRGB");
66  window->wgl.ARB_create_context =
67  _glfwPlatformExtensionSupported("WGL_ARB_create_context");
68  window->wgl.ARB_create_context_profile =
69  _glfwPlatformExtensionSupported("WGL_ARB_create_context_profile");
70  window->wgl.EXT_create_context_es2_profile =
71  _glfwPlatformExtensionSupported("WGL_EXT_create_context_es2_profile");
72  window->wgl.ARB_create_context_robustness =
73  _glfwPlatformExtensionSupported("WGL_ARB_create_context_robustness");
74  window->wgl.EXT_swap_control =
75  _glfwPlatformExtensionSupported("WGL_EXT_swap_control");
76  window->wgl.ARB_pixel_format =
77  _glfwPlatformExtensionSupported("WGL_ARB_pixel_format");
78  window->wgl.ARB_context_flush_control =
79  _glfwPlatformExtensionSupported("WGL_ARB_context_flush_control");
80 }
81 
82 // Returns the specified attribute of the specified pixel format
83 //
84 static int getPixelFormatAttrib(_GLFWwindow* window, int pixelFormat, int attrib)
85 {
86  int value = 0;
87 
88  assert(window->wgl.ARB_pixel_format);
89 
90  if (!window->wgl.GetPixelFormatAttribivARB(window->wgl.dc,
91  pixelFormat,
92  0, 1, &attrib, &value))
93  {
95  "WGL: Failed to retrieve pixel format attribute %i",
96  attrib);
97  return 0;
98  }
99 
100  return value;
101 }
102 
103 // Return a list of available and usable framebuffer configs
104 //
106  const _GLFWfbconfig* desired,
107  int* result)
108 {
109  _GLFWfbconfig* usableConfigs;
110  const _GLFWfbconfig* closest;
111  int i, nativeCount, usableCount;
112 
113  if (window->wgl.ARB_pixel_format)
114  {
115  nativeCount = getPixelFormatAttrib(window,
116  1,
118  }
119  else
120  {
121  nativeCount = DescribePixelFormat(window->wgl.dc,
122  1,
123  sizeof(PIXELFORMATDESCRIPTOR),
124  NULL);
125  }
126 
127  usableConfigs = calloc(nativeCount, sizeof(_GLFWfbconfig));
128  usableCount = 0;
129 
130  for (i = 0; i < nativeCount; i++)
131  {
132  const int n = i + 1;
133  _GLFWfbconfig* u = usableConfigs + usableCount;
134 
135  if (window->wgl.ARB_pixel_format)
136  {
137  // Get pixel format attributes through "modern" extension
138 
139  if (!getPixelFormatAttrib(window, n, WGL_SUPPORT_OPENGL_ARB) ||
141  {
142  continue;
143  }
144 
145  if (getPixelFormatAttrib(window, n, WGL_PIXEL_TYPE_ARB) !=
147  {
148  continue;
149  }
150 
151  if (getPixelFormatAttrib(window, n, WGL_ACCELERATION_ARB) ==
153  {
154  continue;
155  }
156 
161 
164 
169 
171 
172  if (getPixelFormatAttrib(window, n, WGL_STEREO_ARB))
173  u->stereo = GL_TRUE;
175  u->doublebuffer = GL_TRUE;
176 
177  if (window->wgl.ARB_multisample)
179 
180  if (window->wgl.ARB_framebuffer_sRGB ||
181  window->wgl.EXT_framebuffer_sRGB)
182  {
184  u->sRGB = GL_TRUE;
185  }
186  }
187  else
188  {
189  PIXELFORMATDESCRIPTOR pfd;
190 
191  // Get pixel format attributes through legacy PFDs
192 
193  if (!DescribePixelFormat(window->wgl.dc,
194  n,
195  sizeof(PIXELFORMATDESCRIPTOR),
196  &pfd))
197  {
198  continue;
199  }
200 
201  if (!(pfd.dwFlags & PFD_DRAW_TO_WINDOW) ||
202  !(pfd.dwFlags & PFD_SUPPORT_OPENGL))
203  {
204  continue;
205  }
206 
207  if (!(pfd.dwFlags & PFD_GENERIC_ACCELERATED) &&
208  (pfd.dwFlags & PFD_GENERIC_FORMAT))
209  {
210  continue;
211  }
212 
213  if (pfd.iPixelType != PFD_TYPE_RGBA)
214  continue;
215 
216  u->redBits = pfd.cRedBits;
217  u->greenBits = pfd.cGreenBits;
218  u->blueBits = pfd.cBlueBits;
219  u->alphaBits = pfd.cAlphaBits;
220 
221  u->depthBits = pfd.cDepthBits;
222  u->stencilBits = pfd.cStencilBits;
223 
224  u->accumRedBits = pfd.cAccumRedBits;
225  u->accumGreenBits = pfd.cAccumGreenBits;
226  u->accumBlueBits = pfd.cAccumBlueBits;
227  u->accumAlphaBits = pfd.cAccumAlphaBits;
228 
229  u->auxBuffers = pfd.cAuxBuffers;
230 
231  if (pfd.dwFlags & PFD_STEREO)
232  u->stereo = GL_TRUE;
233  if (pfd.dwFlags & PFD_DOUBLEBUFFER)
234  u->doublebuffer = GL_TRUE;
235  }
236 
237  u->wgl = n;
238  usableCount++;
239  }
240 
241  if (!usableCount)
242  {
244  "WGL: The driver does not appear to support OpenGL");
245 
246  free(usableConfigs);
247  return GL_FALSE;
248  }
249 
250  closest = _glfwChooseFBConfig(desired, usableConfigs, usableCount);
251  if (!closest)
252  {
254  "WGL: Failed to find a suitable pixel format");
255 
256  free(usableConfigs);
257  return GL_FALSE;
258  }
259 
260  *result = closest->wgl;
261  free(usableConfigs);
262 
263  return GL_TRUE;
264 }
265 
266 
270 
271 // Initialize WGL
272 //
274 {
275  if (!_glfwCreateContextTLS())
276  return GL_FALSE;
277 
278  _glfw.wgl.opengl32.instance = LoadLibraryW(L"opengl32.dll");
279  if (!_glfw.wgl.opengl32.instance)
280  {
281  _glfwInputError(GLFW_PLATFORM_ERROR, "WGL: Failed to load opengl32.dll");
282  return GL_FALSE;
283  }
284 
285  _glfw.wgl.opengl32.CreateContext = (WGLCREATECONTEXT_T)
286  GetProcAddress(_glfw.wgl.opengl32.instance, "wglCreateContext");
287  _glfw.wgl.opengl32.DeleteContext = (WGLDELETECONTEXT_T)
288  GetProcAddress(_glfw.wgl.opengl32.instance, "wglDeleteContext");
289  _glfw.wgl.opengl32.GetProcAddress = (WGLGETPROCADDRESS_T)
290  GetProcAddress(_glfw.wgl.opengl32.instance, "wglGetProcAddress");
291  _glfw.wgl.opengl32.MakeCurrent = (WGLMAKECURRENT_T)
292  GetProcAddress(_glfw.wgl.opengl32.instance, "wglMakeCurrent");
293  _glfw.wgl.opengl32.ShareLists = (WGLSHARELISTS_T)
294  GetProcAddress(_glfw.wgl.opengl32.instance, "wglShareLists");
295 
296  if (!_glfw.wgl.opengl32.CreateContext ||
297  !_glfw.wgl.opengl32.DeleteContext ||
298  !_glfw.wgl.opengl32.GetProcAddress ||
299  !_glfw.wgl.opengl32.MakeCurrent ||
300  !_glfw.wgl.opengl32.ShareLists)
301  {
303  "WGL: Failed to load opengl32 functions");
304  return GL_FALSE;
305  }
306 
307  return GL_TRUE;
308 }
309 
310 // Terminate WGL
311 //
313 {
314  if (_glfw.wgl.opengl32.instance)
315  FreeLibrary(_glfw.wgl.opengl32.instance);
316 
318 }
319 
320 #define setWGLattrib(attribName, attribValue) \
321 { \
322  attribs[index++] = attribName; \
323  attribs[index++] = attribValue; \
324  assert((size_t) index < sizeof(attribs) / sizeof(attribs[0])); \
325 }
326 
327 // Create the OpenGL or OpenGL ES context
328 //
330  const _GLFWctxconfig* ctxconfig,
331  const _GLFWfbconfig* fbconfig)
332 {
333  int attribs[40];
334  int pixelFormat = 0;
335  PIXELFORMATDESCRIPTOR pfd;
336  HGLRC share = NULL;
337 
338  if (ctxconfig->share)
339  share = ctxconfig->share->wgl.context;
340 
341  window->wgl.dc = GetDC(window->win32.handle);
342  if (!window->wgl.dc)
343  {
345  "WGL: Failed to retrieve DC for window");
346  return GL_FALSE;
347  }
348 
349  if (!choosePixelFormat(window, fbconfig, &pixelFormat))
350  return GL_FALSE;
351 
352  if (!DescribePixelFormat(window->wgl.dc, pixelFormat, sizeof(pfd), &pfd))
353  {
355  "WGL: Failed to retrieve PFD for selected pixel format");
356  return GL_FALSE;
357  }
358 
359  if (!SetPixelFormat(window->wgl.dc, pixelFormat, &pfd))
360  {
362  "WGL: Failed to set selected pixel format");
363  return GL_FALSE;
364  }
365 
366  if (window->wgl.ARB_create_context)
367  {
368  int index = 0, mask = 0, flags = 0;
369 
370  if (ctxconfig->api == GLFW_OPENGL_API)
371  {
372  if (ctxconfig->forward)
374 
375  if (ctxconfig->profile == GLFW_OPENGL_CORE_PROFILE)
377  else if (ctxconfig->profile == GLFW_OPENGL_COMPAT_PROFILE)
379  }
380  else
382 
383  if (ctxconfig->debug)
385 
386  if (ctxconfig->robustness)
387  {
388  if (window->wgl.ARB_create_context_robustness)
389  {
390  if (ctxconfig->robustness == GLFW_NO_RESET_NOTIFICATION)
391  {
394  }
395  else if (ctxconfig->robustness == GLFW_LOSE_CONTEXT_ON_RESET)
396  {
399  }
400 
402  }
403  }
404 
405  if (ctxconfig->release)
406  {
407  if (window->wgl.ARB_context_flush_control)
408  {
409  if (ctxconfig->release == GLFW_RELEASE_BEHAVIOR_NONE)
410  {
413  }
414  else if (ctxconfig->release == GLFW_RELEASE_BEHAVIOR_FLUSH)
415  {
418  }
419  }
420  }
421 
422  // NOTE: Only request an explicitly versioned context when necessary, as
423  // explicitly requesting version 1.0 does not always return the
424  // highest version supported by the driver
425  if (ctxconfig->major != 1 || ctxconfig->minor != 0)
426  {
429  }
430 
431  if (flags)
433 
434  if (mask)
436 
437  setWGLattrib(0, 0);
438 
439  window->wgl.context = window->wgl.CreateContextAttribsARB(window->wgl.dc,
440  share,
441  attribs);
442  if (!window->wgl.context)
443  {
445  "WGL: Failed to create OpenGL context");
446  return GL_FALSE;
447  }
448  }
449  else
450  {
451  window->wgl.context = _glfw_wglCreateContext(window->wgl.dc);
452  if (!window->wgl.context)
453  {
455  "WGL: Failed to create OpenGL context");
456  return GL_FALSE;
457  }
458 
459  if (share)
460  {
461  if (!_glfw_wglShareLists(share, window->wgl.context))
462  {
464  "WGL: Failed to enable sharing with specified OpenGL context");
465  return GL_FALSE;
466  }
467  }
468  }
469 
471  initWGLExtensions(window);
472 
473  return GL_TRUE;
474 }
475 
476 #undef setWGLattrib
477 
478 // Destroy the OpenGL context
479 //
481 {
482  if (window->wgl.context)
483  {
484  _glfw_wglDeleteContext(window->wgl.context);
485  window->wgl.context = NULL;
486  }
487 
488  if (window->wgl.dc)
489  {
490  ReleaseDC(window->win32.handle, window->wgl.dc);
491  window->wgl.dc = NULL;
492  }
493 }
494 
495 // Analyzes the specified context for possible recreation
496 //
498  const _GLFWctxconfig* ctxconfig,
499  const _GLFWfbconfig* fbconfig)
500 {
501  GLboolean required = GL_FALSE;
502 
503  if (ctxconfig->api == GLFW_OPENGL_API)
504  {
505  if (ctxconfig->forward)
506  {
507  if (!window->wgl.ARB_create_context)
508  {
510  "WGL: A forward compatible OpenGL context requested but WGL_ARB_create_context is unavailable");
512  }
513 
514  required = GL_TRUE;
515  }
516 
517  if (ctxconfig->profile)
518  {
519  if (!window->wgl.ARB_create_context_profile)
520  {
522  "WGL: OpenGL profile requested but WGL_ARB_create_context_profile is unavailable");
524  }
525 
526  required = GL_TRUE;
527  }
528 
529  if (ctxconfig->release)
530  {
531  if (window->wgl.ARB_context_flush_control)
532  required = GL_TRUE;
533  }
534  }
535  else
536  {
537  if (!window->wgl.ARB_create_context ||
538  !window->wgl.ARB_create_context_profile ||
539  !window->wgl.EXT_create_context_es2_profile)
540  {
542  "WGL: OpenGL ES requested but WGL_ARB_create_context_es2_profile is unavailable");
544  }
545 
546  required = GL_TRUE;
547  }
548 
549  if (ctxconfig->major != 1 || ctxconfig->minor != 0)
550  {
551  if (window->wgl.ARB_create_context)
552  required = GL_TRUE;
553  }
554 
555  if (ctxconfig->debug)
556  {
557  if (window->wgl.ARB_create_context)
558  required = GL_TRUE;
559  }
560 
561  if (fbconfig->samples > 0)
562  {
563  // MSAA is not a hard constraint, so do nothing if it's not supported
564  if (window->wgl.ARB_multisample && window->wgl.ARB_pixel_format)
565  required = GL_TRUE;
566  }
567 
568  if (fbconfig->sRGB)
569  {
570  // sRGB is not a hard constraint, so do nothing if it's not supported
571  if ((window->wgl.ARB_framebuffer_sRGB ||
572  window->wgl.EXT_framebuffer_sRGB) &&
573  window->wgl.ARB_pixel_format)
574  {
575  required = GL_TRUE;
576  }
577  }
578 
579  if (required)
581 
583 }
584 
585 
589 
591 {
592  if (window)
593  _glfw_wglMakeCurrent(window->wgl.dc, window->wgl.context);
594  else
595  _glfw_wglMakeCurrent(NULL, NULL);
596 
597  _glfwSetContextTLS(window);
598 }
599 
601 {
602  // HACK: Use DwmFlush when desktop composition is enabled
603  if (_glfwIsCompositionEnabled() && !window->monitor)
604  {
605  int count = abs(window->wgl.interval);
606  while (count--)
607  _glfw_DwmFlush();
608  }
609 
610  SwapBuffers(window->wgl.dc);
611 }
612 
613 void _glfwPlatformSwapInterval(int interval)
614 {
616 
617  window->wgl.interval = interval;
618 
619  // HACK: Disable WGL swap interval when desktop composition is enabled to
620  // avoid interfering with DWM vsync
621  if (_glfwIsCompositionEnabled() && !window->monitor)
622  interval = 0;
623 
624  if (window->wgl.EXT_swap_control)
625  window->wgl.SwapIntervalEXT(interval);
626 }
627 
628 int _glfwPlatformExtensionSupported(const char* extension)
629 {
630  const char* extensions;
631 
633 
634  if (window->wgl.GetExtensionsStringEXT != NULL)
635  {
636  extensions = window->wgl.GetExtensionsStringEXT();
637  if (extensions)
638  {
639  if (_glfwStringInExtensionString(extension, extensions))
640  return GL_TRUE;
641  }
642  }
643 
644  if (window->wgl.GetExtensionsStringARB != NULL)
645  {
646  extensions = window->wgl.GetExtensionsStringARB(window->wgl.dc);
647  if (extensions)
648  {
649  if (_glfwStringInExtensionString(extension, extensions))
650  return GL_TRUE;
651  }
652  }
653 
654  return GL_FALSE;
655 }
656 
658 {
659  const GLFWglproc proc = (GLFWglproc) _glfw_wglGetProcAddress(procname);
660  if (proc)
661  return proc;
662 
663  return (GLFWglproc) GetProcAddress(_glfw.wgl.opengl32.instance, procname);
664 }
665 
666 
670 
672 {
673  _GLFWwindow* window = (_GLFWwindow*) handle;
675  return window->wgl.context;
676 }
677 
#define WGL_NO_RESET_NOTIFICATION_ARB
Definition: wglext.h:108
#define WGL_CONTEXT_DEBUG_BIT_ARB
Definition: wglext.h:82
GLboolean debug
Definition: internal.h:191
#define WGL_SUPPORT_OPENGL_ARB
Definition: wglext.h:189
_GLFWwindow * share
Definition: internal.h:195
#define WGL_ALPHA_BITS_ARB
Definition: wglext.h:200
void _glfwPlatformSwapBuffers(_GLFWwindow *window)
Swaps the front and back buffers of the specified window.
Definition: wgl_context.c:600
_GLFWwindow * _glfwPlatformGetCurrentContext(void)
Returns the window whose context is current on the calling thread.
Definition: win32_tls.c:65
int _glfwStringInExtensionString(const char *string, const char *extensions)
Searches an extension string for the specified extension.
Definition: context.c:500
#define GLFWAPI
Definition: glfw3.h:185
int _glfwAnalyzeContext(const _GLFWwindow *window, const _GLFWctxconfig *ctxconfig, const _GLFWfbconfig *fbconfig)
Definition: wgl_context.c:497
#define GLFW_OPENGL_COMPAT_PROFILE
Definition: glfw3.h:636
#define WGL_DRAW_TO_WINDOW_ARB
Definition: wglext.h:170
#define WGL_CONTEXT_PROFILE_MASK_ARB
Definition: wglext.h:97
const GLint * attribs
Definition: glext.h:10137
#define WGL_CONTEXT_FLAGS_ARB
Definition: wglext.h:87
BOOL(WINAPI * WGLMAKECURRENT_T)(HDC, HGLRC)
Definition: wgl_context.h:40
#define WGL_CONTEXT_MAJOR_VERSION_ARB
Definition: wglext.h:84
#define _glfw_DwmFlush
#define WGL_ACCUM_BLUE_BITS_ARB
Definition: wglext.h:205
const _GLFWfbconfig * _glfwChooseFBConfig(const _GLFWfbconfig *desired, const _GLFWfbconfig *alternatives, unsigned int count)
Chooses the framebuffer config that best matches the desired one.
Definition: context.c:191
int accumGreenBits
Definition: internal.h:216
#define setWGLattrib(attribName, attribValue)
Definition: wgl_context.c:320
GLFWglproc _glfwPlatformGetProcAddress(const char *procname)
Returns the address of the specified function for the current context.
Definition: wgl_context.c:657
GLFWAPI HGLRC glfwGetWGLContext(GLFWwindow *handle)
Definition: wgl_context.c:671
void _glfwSetContextTLS(_GLFWwindow *context)
Definition: win32_tls.c:55
GLenum GLint GLuint mask
Definition: glext.h:652
void _glfwTerminateContextAPI(void)
Definition: wgl_context.c:312
#define WGL_NO_ACCELERATION_ARB
Definition: wglext.h:210
int _glfwPlatformExtensionSupported(const char *extension)
Returns whether the specified extension is available.
Definition: wgl_context.c:628
#define GLFW_LOSE_CONTEXT_ON_RESET
Definition: glfw3.h:632
typedef HGLRC(WINAPI *PFNWGLCREATECONTEXTATTRIBSARBPROC)(HDC hDC
#define GLFW_OPENGL_API
Definition: glfw3.h:627
#define GLFW_API_UNAVAILABLE
GLFW could not find support for the requested client API on the system.
Definition: glfw3.h:539
#define _GLFW_RECREATION_NOT_NEEDED
#define GLFW_FORMAT_UNAVAILABLE
The requested format is not supported or available.
Definition: glfw3.h:589
GLbitfield flags
Definition: glext.h:1478
#define WGL_STENCIL_BITS_ARB
Definition: wglext.h:208
#define WGL_BLUE_BITS_ARB
Definition: wglext.h:198
int stencilBits
Definition: internal.h:214
GLdouble n
Definition: glext.h:1950
#define GLFW_RELEASE_BEHAVIOR_NONE
Definition: glfw3.h:648
_GLFWlibrary _glfw
All global data protected by _glfwInitialized. This should only be touched after a call to glfwInit t...
#define WGL_RED_BITS_ARB
Definition: wglext.h:194
struct GLFWwindow GLFWwindow
Opaque window object.
Definition: glfw3.h:722
void _glfwDestroyContext(_GLFWwindow *window)
Definition: wgl_context.c:480
#define _GLFW_REQUIRE_INIT_OR_RETURN(x)
Definition: internal.h:137
#define WGL_LOSE_CONTEXT_ON_RESET_ARB
Definition: wglext.h:106
#define _glfw_wglMakeCurrent
Definition: wgl_context.h:45
#define WGL_PIXEL_TYPE_ARB
Definition: wglext.h:192
typedef GLboolean(APIENTRYP PFNGLISQUERYPROC)(GLuint id)
#define WGL_DEPTH_BITS_ARB
Definition: wglext.h:207
#define GLFW_PLATFORM_ERROR
A platform-specific error occurred that does not match any of the more specific categories.
Definition: glfw3.h:569
GLuint index
Definition: glext.h:655
GLuint GLuint GLsizei count
Definition: glext.h:111
GLboolean forward
Definition: internal.h:190
#define _glfw_wglGetProcAddress
Definition: wgl_context.h:44
#define WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB
Definition: wglext.h:99
#define WGL_CONTEXT_ROBUST_ACCESS_BIT_ARB
Definition: wglext.h:105
#define _glfw_wglShareLists
Definition: wgl_context.h:46
#define _GLFW_RECREATION_REQUIRED
int accumBlueBits
Definition: internal.h:217
BOOL(WINAPI * WGLSHARELISTS_T)(HGLRC, HGLRC)
Definition: wgl_context.h:41
void _glfwPlatformSwapInterval(int interval)
Sets the swap interval for the current context.
Definition: wgl_context.c:613
struct _GLFWwindow::@0 context
#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB
Definition: wglext.h:83
int auxBuffers
Definition: internal.h:219
#define WGL_ACCUM_ALPHA_BITS_ARB
Definition: wglext.h:206
GLsizei const GLfloat * value
Definition: glext.h:693
#define GLFW_RELEASE_BEHAVIOR_FLUSH
Definition: glfw3.h:647
int _glfwCreateContext(_GLFWwindow *window, const _GLFWctxconfig *ctxconfig, const _GLFWfbconfig *fbconfig)
Definition: wgl_context.c:329
#define WGL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB
Definition: wglext.h:77
#define GLFW_VERSION_UNAVAILABLE
The requested OpenGL or OpenGL ES version is not available.
Definition: glfw3.h:557
static void initWGLExtensions(_GLFWwindow *window)
Definition: wgl_context.c:37
#define WGL_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB
Definition: wglext.h:76
static GLboolean choosePixelFormat(_GLFWwindow *window, const _GLFWfbconfig *desired, int *result)
Definition: wgl_context.c:105
#define WGL_CONTEXT_ES2_PROFILE_BIT_EXT
Definition: wglext.h:346
HGLRC(WINAPI * WGLCREATECONTEXT_T)(HDC)
Definition: wgl_context.h:37
#define WGL_ACCUM_GREEN_BITS_ARB
Definition: wglext.h:204
#define WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB
Definition: wglext.h:121
void _glfwPlatformMakeContextCurrent(_GLFWwindow *window)
Makes the context of the specified window current for the calling thread.
Definition: wgl_context.c:590
#define _glfw_wglCreateContext
Definition: wgl_context.h:42
#define WGL_ACCELERATION_ARB
Definition: wglext.h:172
#define WGL_CONTEXT_CORE_PROFILE_BIT_ARB
Definition: wglext.h:98
#define _glfw_wglDeleteContext
Definition: wgl_context.h:43
#define WGL_ACCUM_RED_BITS_ARB
Definition: wglext.h:203
#define GLFW_OPENGL_CORE_PROFILE
Definition: glfw3.h:635
static int getPixelFormatAttrib(_GLFWwindow *window, int pixelFormat, int attrib)
Definition: wgl_context.c:84
PROC(WINAPI * WGLGETPROCADDRESS_T)(LPCSTR)
Definition: wgl_context.h:39
#define WGL_AUX_BUFFERS_ARB
Definition: wglext.h:209
BOOL(WINAPI * WGLDELETECONTEXT_T)(HGLRC)
Definition: wgl_context.h:38
#define _GLFW_RECREATION_IMPOSSIBLE
void _glfwInputError(int error, const char *format,...)
Notifies shared code of an error.
#define WGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB
Definition: wglext.h:107
int accumAlphaBits
Definition: internal.h:218
int _glfwCreateContextTLS(void)
Definition: win32_tls.c:35
#define WGL_TYPE_RGBA_ARB
Definition: wglext.h:216
const char *WINAPI * PFNWGLGETEXTENSIONSSTRINGEXTPROC(void)
Definition: wglext.h:375
#define WGL_CONTEXT_MINOR_VERSION_ARB
Definition: wglext.h:85
#define WGL_NUMBER_PIXEL_FORMATS_ARB
Definition: wglext.h:169
#define WGL_GREEN_BITS_ARB
Definition: wglext.h:196
Context configuration.
Definition: internal.h:185
Window and context structure.
Definition: internal.h:232
Framebuffer configuration.
Definition: internal.h:207
BOOL _glfwIsCompositionEnabled(void)
Definition: win32_init.c:262
const char *WINAPI * PFNWGLGETEXTENSIONSSTRINGARBPROC(HDC hdc)
Definition: wglext.h:113
#define WGL_CONTEXT_RELEASE_BEHAVIOR_ARB
Definition: wglext.h:75
_GLFWmonitor * monitor
Definition: internal.h:244
GLuint64EXT * result
Definition: glext.h:9881
#define WGL_DOUBLE_BUFFER_ARB
Definition: wglext.h:190
#define GLFW_NO_RESET_NOTIFICATION
Definition: glfw3.h:631
#define WGL_SAMPLES_ARB
Definition: wglext.h:139
int accumRedBits
Definition: internal.h:215
void(* GLFWglproc)(void)
Client API function pointer type.
Definition: glfw3.h:706
int _glfwInitContextAPI(void)
Definition: wgl_context.c:273
void _glfwDestroyContextTLS(void)
Definition: win32_tls.c:49
#define WGL_STEREO_ARB
Definition: wglext.h:191
int doublebuffer
Definition: internal.h:223


librealsense
Author(s): Sergey Dorodnicov , Mark Horn , Reagan Lopez
autogenerated on Fri Mar 13 2020 03:16:18