Blender V4.5
GHOST_ContextWGL.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2013 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
10
11#include "GHOST_ContextWGL.hh"
12
13#include <tchar.h>
14
15#include <cassert>
16#include <cstdio>
17#include <vector>
18
19HGLRC GHOST_ContextWGL::s_sharedHGLRC = nullptr;
20int GHOST_ContextWGL::s_sharedCount = 0;
21
22/* Some third-generation Intel video-cards are constantly bring problems */
24{
25 return strstr((const char *)glGetString(GL_VENDOR), "Intel") != nullptr;
26}
27
29 bool alphaBackground,
30 HWND hWnd,
31 HDC hDC,
32 int contextProfileMask,
33 int contextMajorVersion,
34 int contextMinorVersion,
35 int contextFlags,
36 int contextResetNotificationStrategy)
37 : GHOST_Context(stereoVisual),
38 m_hWnd(hWnd),
39 m_hDC(hDC),
40 m_contextProfileMask(contextProfileMask),
41 m_contextMajorVersion(contextMajorVersion),
42 m_contextMinorVersion(contextMinorVersion),
43 m_contextFlags(contextFlags),
44 m_alphaBackground(alphaBackground),
45 m_contextResetNotificationStrategy(contextResetNotificationStrategy),
46 m_hGLRC(nullptr)
47#ifndef NDEBUG
48 ,
49 m_dummyVendor(nullptr),
50 m_dummyRenderer(nullptr),
51 m_dummyVersion(nullptr)
52#endif
53{
54 assert(m_hDC != nullptr);
55}
56
58{
59 if (m_hGLRC != nullptr) {
60 if (m_hGLRC == ::wglGetCurrentContext())
61 WIN32_CHK(::wglMakeCurrent(nullptr, nullptr));
62
63 if (m_hGLRC != s_sharedHGLRC || s_sharedCount == 1) {
64 assert(s_sharedCount > 0);
65
66 s_sharedCount--;
67
68 if (s_sharedCount == 0) {
69 s_sharedHGLRC = nullptr;
70 }
71
72 WIN32_CHK(::wglDeleteContext(m_hGLRC));
73 }
74 }
75
76#ifndef NDEBUG
77 if (m_dummyRenderer) {
78 free((void *)m_dummyRenderer);
79 free((void *)m_dummyVendor);
80 free((void *)m_dummyVersion);
81 }
82#endif
83}
84
86{
87 return WIN32_CHK(::SwapBuffers(m_hDC)) ? GHOST_kSuccess : GHOST_kFailure;
88}
89
91{
92 if (epoxy_has_wgl_extension(m_hDC, "WGL_EXT_swap_control")) {
93 return WIN32_CHK(::wglSwapIntervalEXT(interval)) == TRUE ? GHOST_kSuccess : GHOST_kFailure;
94 }
95 else {
96 return GHOST_kFailure;
97 }
98}
99
101{
102 if (epoxy_has_wgl_extension(m_hDC, "WGL_EXT_swap_control")) {
103 intervalOut = ::wglGetSwapIntervalEXT();
104 return GHOST_kSuccess;
105 }
106 else {
107 return GHOST_kFailure;
108 }
109}
110
112{
113 if (WIN32_CHK(::wglMakeCurrent(m_hDC, m_hGLRC))) {
114 active_context_ = this;
115 return GHOST_kSuccess;
116 }
117 else {
118 return GHOST_kFailure;
119 }
120}
121
123{
124 /* Calling wglMakeCurrent(nullptr, nullptr) without an active context returns an error,
125 * so we always pass the device context handle. */
126 if (WIN32_CHK(::wglMakeCurrent(m_hDC, nullptr))) {
127 active_context_ = nullptr;
128 return GHOST_kSuccess;
129 }
130 else {
131 return GHOST_kFailure;
132 }
133}
134
135/* Ron Fosner's code for weighting pixel formats and forcing software.
136 * See http://www.opengl.org/resources/faq/technical/weight.cpp
137 */
138static int weight_pixel_format(PIXELFORMATDESCRIPTOR &pfd, PIXELFORMATDESCRIPTOR &preferredPFD)
139{
140 int weight = 0;
141
142 /* assume desktop color depth is 32 bits per pixel */
143
144 /* cull unusable pixel formats */
145 /* if no formats can be found, can we determine why it was rejected? */
146 if (!(pfd.dwFlags & PFD_SUPPORT_OPENGL) || !(pfd.dwFlags & PFD_DRAW_TO_WINDOW) ||
147 !(pfd.dwFlags & PFD_DOUBLEBUFFER) || /* Blender _needs_ this. */
148 !(pfd.iPixelType == PFD_TYPE_RGBA) ||
149 (pfd.cColorBits > 32) || /* 64 bit formats disable AERO. */
150 (pfd.dwFlags & PFD_GENERIC_FORMAT)) /* No software renderers. */
151 {
152 return 0;
153 }
154
155 weight = 1; /* it's usable */
156
157 weight += pfd.cColorBits - 8;
158
159 if (preferredPFD.cAlphaBits > 0 && pfd.cAlphaBits > 0) {
160 weight++;
161 }
162
163 return weight;
164}
165
166/*
167 * A modification of Ron Fosner's replacement for ChoosePixelFormat
168 * returns 0 on error, else returns the pixel format number to be used
169 */
170static int choose_pixel_format_legacy(HDC hDC, PIXELFORMATDESCRIPTOR &preferredPFD)
171{
172 int iPixelFormat = 0;
173 int weight = 0;
174
175 int iStereoPixelFormat = 0;
176 int stereoWeight = 0;
177
178 /* choose a pixel format using the useless Windows function in case we come up empty handed */
179 int iLastResortPixelFormat = ::ChoosePixelFormat(hDC, &preferredPFD);
180
181 WIN32_CHK(iLastResortPixelFormat != 0);
182
183 int lastPFD = ::DescribePixelFormat(hDC, 1, sizeof(PIXELFORMATDESCRIPTOR), nullptr);
184
185 WIN32_CHK(lastPFD != 0);
186
187 for (int i = 1; i <= lastPFD; i++) {
188 PIXELFORMATDESCRIPTOR pfd;
189 int check = ::DescribePixelFormat(hDC, i, sizeof(PIXELFORMATDESCRIPTOR), &pfd);
190
191 WIN32_CHK(check == lastPFD);
192
193 int w = weight_pixel_format(pfd, preferredPFD);
194
195 if (w > weight) {
196 weight = w;
197 iPixelFormat = i;
198 }
199
200 if (w > stereoWeight && (preferredPFD.dwFlags & pfd.dwFlags & PFD_STEREO)) {
201 stereoWeight = w;
202 iStereoPixelFormat = i;
203 }
204 }
205
206 /* choose any available stereo format over a non-stereo format */
207 if (iStereoPixelFormat != 0) {
208 iPixelFormat = iStereoPixelFormat;
209 }
210
211 if (iPixelFormat == 0) {
212 fprintf(stderr, "Warning! Using result of ChoosePixelFormat.\n");
213 iPixelFormat = iLastResortPixelFormat;
214 }
215
216 return iPixelFormat;
217}
218
224static HWND clone_window(HWND hWnd, LPVOID lpParam)
225{
226 int count;
227
228 SetLastError(NO_ERROR);
229
230 DWORD dwExStyle = GetWindowLong(hWnd, GWL_EXSTYLE);
231 WIN32_CHK(GetLastError() == NO_ERROR);
232
233 WCHAR lpClassName[100] = L"";
234 count = GetClassNameW(hWnd, lpClassName, sizeof(lpClassName));
235 WIN32_CHK(count != 0);
236
237 WCHAR lpWindowName[100] = L"";
238 count = GetWindowTextW(hWnd, lpWindowName, sizeof(lpWindowName));
239 WIN32_CHK(count != 0);
240
241 DWORD dwStyle = GetWindowLong(hWnd, GWL_STYLE);
242 WIN32_CHK(GetLastError() == NO_ERROR);
243
244 RECT rect;
245 GetWindowRect(hWnd, &rect);
246 WIN32_CHK(GetLastError() == NO_ERROR);
247
248 HWND hWndParent = (HWND)GetWindowLongPtr(hWnd, GWLP_HWNDPARENT);
249 WIN32_CHK(GetLastError() == NO_ERROR);
250
251 HMENU hMenu = GetMenu(hWnd);
252 WIN32_CHK(GetLastError() == NO_ERROR);
253
254 HINSTANCE hInstance = (HINSTANCE)GetWindowLongPtr(hWnd, GWLP_HINSTANCE);
255 WIN32_CHK(GetLastError() == NO_ERROR);
256
257 HWND hwndCloned = CreateWindowExW(dwExStyle,
258 lpClassName,
259 lpWindowName,
260 dwStyle,
261 rect.left,
262 rect.top,
263 rect.right - rect.left,
264 rect.bottom - rect.top,
265 hWndParent,
266 hMenu,
267 hInstance,
268 lpParam);
269
270 WIN32_CHK(hwndCloned != nullptr);
271
272 return hwndCloned;
273}
274
275static void makeAttribList(std::vector<int> &out, bool stereoVisual, bool needAlpha)
276{
277 out.clear();
278 out.reserve(30);
279
280 out.push_back(WGL_SUPPORT_OPENGL_ARB);
281 out.push_back(GL_TRUE);
282
283 out.push_back(WGL_DRAW_TO_WINDOW_ARB);
284 out.push_back(GL_TRUE);
285
286 out.push_back(WGL_DOUBLE_BUFFER_ARB);
287 out.push_back(GL_TRUE);
288
289 out.push_back(WGL_ACCELERATION_ARB);
290 out.push_back(WGL_FULL_ACCELERATION_ARB);
291
292 if (stereoVisual) {
293 out.push_back(WGL_STEREO_ARB);
294 out.push_back(GL_TRUE);
295 }
296
297 out.push_back(WGL_PIXEL_TYPE_ARB);
298 out.push_back(WGL_TYPE_RGBA_ARB);
299
300 out.push_back(WGL_COLOR_BITS_ARB);
301 out.push_back(24);
302
303 if (needAlpha) {
304 out.push_back(WGL_ALPHA_BITS_ARB);
305 out.push_back(8);
306 }
307
308 out.push_back(0);
309}
310
311/* Temporary context used to create the actual context. We need ARB pixel format
312 * and context extensions, which are only available within a context. */
314 HWND dummyHWND = nullptr;
315
316 HDC dummyHDC = nullptr;
317 HGLRC dummyHGLRC = nullptr;
318
319 HDC prevHDC = nullptr;
320 HGLRC prevHGLRC = nullptr;
321
323
324 PIXELFORMATDESCRIPTOR preferredPFD;
325
330
331 DummyContextWGL(HDC hDC, HWND hWnd, bool stereoVisual, bool needAlpha)
332 {
333 preferredPFD = {
334 sizeof(PIXELFORMATDESCRIPTOR), /* size */
335 1, /* version */
336 (DWORD)(PFD_SUPPORT_OPENGL | PFD_DRAW_TO_WINDOW |
337 PFD_DOUBLEBUFFER | /* support double-buffering */
338 (stereoVisual ? PFD_STEREO : 0)), /* support stereo */
339 PFD_TYPE_RGBA, /* color type */
340 (BYTE)(needAlpha ? 32 : 24), /* preferred color depth */
341 0,
342 0,
343 0,
344 0,
345 0,
346 0, /* color bits (ignored) */
347 (BYTE)(needAlpha ? 8 : 0), /* alpha buffer */
348 0, /* alpha shift (ignored) */
349 0, /* no accumulation buffer */
350 0,
351 0,
352 0,
353 0, /* Accumulation bits (ignored). */
354 0, /* depth buffer */
355 0, /* stencil buffer */
356 0, /* no auxiliary buffers */
357 PFD_MAIN_PLANE, /* main layer */
358 0, /* reserved */
359 0,
360 0,
361 0 /* layer, visible, and damage masks (ignored) */
362 };
363
364 SetLastError(NO_ERROR);
365
366 prevHDC = ::wglGetCurrentDC();
367 WIN32_CHK(GetLastError() == NO_ERROR);
368
369 prevHGLRC = ::wglGetCurrentContext();
370 WIN32_CHK(GetLastError() == NO_ERROR);
371
373
374 if (dummyPixelFormat == 0) {
375 return;
376 }
377
378 PIXELFORMATDESCRIPTOR chosenPFD;
379 if (!WIN32_CHK(::DescribePixelFormat(
380 hDC, dummyPixelFormat, sizeof(PIXELFORMATDESCRIPTOR), &chosenPFD)))
381 {
382 return;
383 }
384
385 if (hWnd) {
386 dummyHWND = clone_window(hWnd, nullptr);
387
388 if (dummyHWND == nullptr) {
389 return;
390 }
391
392 dummyHDC = GetDC(dummyHWND);
393 }
394
395 if (!WIN32_CHK(dummyHDC != nullptr)) {
396 return;
397 }
398
399 if (!WIN32_CHK(::SetPixelFormat(dummyHDC, dummyPixelFormat, &chosenPFD))) {
400 return;
401 }
402
403 dummyHGLRC = ::wglCreateContext(dummyHDC);
404
405 if (!WIN32_CHK(dummyHGLRC != nullptr)) {
406 return;
407 }
408
409 if (!WIN32_CHK(::wglMakeCurrent(dummyHDC, dummyHGLRC))) {
410 return;
411 }
412
413 has_WGL_ARB_pixel_format = epoxy_has_wgl_extension(hDC, "WGL_ARB_pixel_format");
414 has_WGL_ARB_create_context = epoxy_has_wgl_extension(hDC, "WGL_ARB_create_context");
415 has_WGL_ARB_create_context_profile = epoxy_has_wgl_extension(hDC,
416 "WGL_ARB_create_context_profile");
417 has_WGL_ARB_create_context_robustness = epoxy_has_wgl_extension(
418 hDC, "WGL_ARB_create_context_robustness");
419 }
420
422 {
423 WIN32_CHK(::wglMakeCurrent(prevHDC, prevHGLRC));
424
425 if (dummyHGLRC != nullptr)
426 WIN32_CHK(::wglDeleteContext(dummyHGLRC));
427
428 if (dummyHWND != nullptr) {
429 if (dummyHDC != nullptr)
430 WIN32_CHK(::ReleaseDC(dummyHWND, dummyHDC));
431
432 WIN32_CHK(::DestroyWindow(dummyHWND));
433 }
434 }
435};
436
437int GHOST_ContextWGL::_choose_pixel_format_arb_1(bool stereoVisual, bool needAlpha)
438{
439 std::vector<int> iAttributes;
440
441#define _MAX_PIXEL_FORMATS 32
442
443 int iPixelFormat = 0;
444 int iPixelFormats[_MAX_PIXEL_FORMATS];
445
446 makeAttribList(iAttributes, stereoVisual, needAlpha);
447
448 uint nNumFormats;
449 WIN32_CHK(wglChoosePixelFormatARB(
450 m_hDC, &(iAttributes[0]), nullptr, _MAX_PIXEL_FORMATS, iPixelFormats, &nNumFormats));
451
452 if (nNumFormats > 0) {
453 iPixelFormat = iPixelFormats[0];
454 }
455
456 // check pixel format
457 if (iPixelFormat != 0) {
458 if (needAlpha) {
459 int alphaBits, iQuery = WGL_ALPHA_BITS_ARB;
460 wglGetPixelFormatAttribivARB(m_hDC, iPixelFormat, 0, 1, &iQuery, &alphaBits);
461 if (alphaBits == 0) {
462 fprintf(stderr, "Warning! Unable to find a frame buffer with alpha channel.\n");
463 }
464 }
465 }
466 return iPixelFormat;
467}
468
469int GHOST_ContextWGL::choose_pixel_format_arb(bool stereoVisual, bool needAlpha)
470{
471 int iPixelFormat;
472
473 iPixelFormat = _choose_pixel_format_arb_1(stereoVisual, needAlpha);
474
475 if (iPixelFormat == 0 && stereoVisual) {
476 fprintf(stderr, "Warning! Unable to find a stereo pixel format.\n");
477
478 iPixelFormat = _choose_pixel_format_arb_1(false, needAlpha);
479
480 m_stereoVisual = false; // set context property to actual value
481 }
482
483 return iPixelFormat;
484}
485
486#ifndef NDEBUG
487static void reportContextString(const char *name, const char *dummy, const char *context)
488{
489 fprintf(stderr, "%s: %s\n", name, context);
490
491 if (dummy && strcmp(dummy, context) != 0)
492 fprintf(stderr, "Warning! Dummy %s: %s\n", name, dummy);
493}
494#endif
495
497{
498 SetLastError(NO_ERROR);
499
500 HGLRC prevHGLRC = ::wglGetCurrentContext();
501 WIN32_CHK(GetLastError() == NO_ERROR);
502
503 HDC prevHDC = ::wglGetCurrentDC();
504 WIN32_CHK(GetLastError() == NO_ERROR);
505
506 {
507 const bool needAlpha = m_alphaBackground;
508 DummyContextWGL dummy(m_hDC, m_hWnd, m_stereoVisual, needAlpha);
509
510 if (!dummy.has_WGL_ARB_create_context || ::GetPixelFormat(m_hDC) == 0) {
511 int iPixelFormat = 0;
512
513 if (dummy.has_WGL_ARB_pixel_format) {
514 iPixelFormat = choose_pixel_format_arb(m_stereoVisual, needAlpha);
515 }
516
517 if (iPixelFormat == 0)
518 iPixelFormat = choose_pixel_format_legacy(m_hDC, dummy.preferredPFD);
519
520 if (iPixelFormat == 0) {
521 goto error;
522 }
523
524 PIXELFORMATDESCRIPTOR chosenPFD;
525 int lastPFD = ::DescribePixelFormat(
526 m_hDC, iPixelFormat, sizeof(PIXELFORMATDESCRIPTOR), &chosenPFD);
527
528 if (!WIN32_CHK(lastPFD != 0)) {
529 goto error;
530 }
531
532 if (needAlpha && chosenPFD.cAlphaBits == 0) {
533 fprintf(stderr, "Warning! Unable to find a pixel format with an alpha channel.\n");
534 }
535
536 if (!WIN32_CHK(::SetPixelFormat(m_hDC, iPixelFormat, &chosenPFD))) {
537 goto error;
538 }
539 }
540
541 if (dummy.has_WGL_ARB_create_context) {
542 int profileBitCore = m_contextProfileMask & WGL_CONTEXT_CORE_PROFILE_BIT_ARB;
543 int profileBitCompat = m_contextProfileMask & WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB;
544
545 if (!dummy.has_WGL_ARB_create_context_profile && profileBitCore) {
546 fprintf(stderr, "Warning! OpenGL core profile not available.\n");
547 }
548
549 if (!dummy.has_WGL_ARB_create_context_profile && profileBitCompat) {
550 fprintf(stderr, "Warning! OpenGL compatibility profile not available.\n");
551 }
552
553 int profileMask = 0;
554
555 if (dummy.has_WGL_ARB_create_context_profile && profileBitCore) {
556 profileMask |= profileBitCore;
557 }
558
559 if (dummy.has_WGL_ARB_create_context_profile && profileBitCompat) {
560 profileMask |= profileBitCompat;
561 }
562
563 if (profileMask != m_contextProfileMask) {
564 fprintf(stderr, "Warning! Ignoring untested OpenGL context profile mask bits.");
565 }
566
567 std::vector<int> iAttributes;
568
569 if (profileMask) {
570 iAttributes.push_back(WGL_CONTEXT_PROFILE_MASK_ARB);
571 iAttributes.push_back(profileMask);
572 }
573
574 if (m_contextMajorVersion != 0) {
575 iAttributes.push_back(WGL_CONTEXT_MAJOR_VERSION_ARB);
576 iAttributes.push_back(m_contextMajorVersion);
577 }
578
579 if (m_contextMinorVersion != 0) {
580 iAttributes.push_back(WGL_CONTEXT_MINOR_VERSION_ARB);
581 iAttributes.push_back(m_contextMinorVersion);
582 }
583
584 if (m_contextFlags != 0) {
585 iAttributes.push_back(WGL_CONTEXT_FLAGS_ARB);
586 iAttributes.push_back(m_contextFlags);
587 }
588
589 if (m_contextResetNotificationStrategy != 0) {
591 iAttributes.push_back(WGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB);
592 iAttributes.push_back(m_contextResetNotificationStrategy);
593 }
594 else {
595 fprintf(stderr, "Warning! Cannot set the reset notification strategy.");
596 }
597 }
598
599 iAttributes.push_back(0);
600
601 m_hGLRC = ::wglCreateContextAttribsARB(m_hDC, s_sharedHGLRC, &(iAttributes[0]));
602 }
603 }
604
605 /* Silence warnings interpreted as errors by users when trying to get
606 * a context with version higher than 3.3 Core. */
607 {
608 const bool silent = m_contextMajorVersion > 3;
609 if (!WIN32_CHK_SILENT(m_hGLRC != nullptr, silent)) {
610 goto error;
611 }
612 }
613
614 s_sharedCount++;
615
616 if (s_sharedHGLRC == nullptr) {
617 s_sharedHGLRC = m_hGLRC;
618 }
619
620 if (!WIN32_CHK(::wglMakeCurrent(m_hDC, m_hGLRC))) {
621 goto error;
622 }
623
624 if (is_crappy_intel_card()) {
625 /* Some Intel cards with context 4.1 or 4.2
626 * don't have the point sprite enabled by default.
627 *
628 * However GL_POINT_SPRITE was removed in 3.2 and is now permanently ON.
629 * Then use brute force. */
630 glEnable(GL_POINT_SPRITE);
631 }
632
633 initClearGL();
634 ::SwapBuffers(m_hDC);
635
636#ifndef NDEBUG
637 {
638 const char *vendor = reinterpret_cast<const char *>(glGetString(GL_VENDOR));
639 const char *renderer = reinterpret_cast<const char *>(glGetString(GL_RENDERER));
640 const char *version = reinterpret_cast<const char *>(glGetString(GL_VERSION));
641
642 reportContextString("Vendor", m_dummyVendor, vendor);
643 reportContextString("Renderer", m_dummyRenderer, renderer);
644 reportContextString("Version", m_dummyVersion, version);
645
646 fprintf(stderr, "Context Version: %d.%d\n", m_contextMajorVersion, m_contextMinorVersion);
647 }
648#endif
649
650 active_context_ = this;
651 return GHOST_kSuccess;
652error:
653 ::wglMakeCurrent(prevHDC, prevHGLRC);
654 return GHOST_kFailure;
655}
656
658{
659 GHOST_TSuccess success = m_hGLRC != s_sharedHGLRC || s_sharedCount == 1 ? GHOST_kSuccess :
661
662 m_hWnd = nullptr;
663 m_hDC = nullptr;
664
665 return success;
666}
void BLI_kdtree_nd_ free(KDTree *tree)
unsigned int uint
static void makeAttribList(std::vector< int > &out, bool stereoVisual, bool needAlpha)
static int choose_pixel_format_legacy(HDC hDC, PIXELFORMATDESCRIPTOR &preferredPFD)
#define _MAX_PIXEL_FORMATS
static int weight_pixel_format(PIXELFORMATDESCRIPTOR &pfd, PIXELFORMATDESCRIPTOR &preferredPFD)
static void reportContextString(const char *name, const char *dummy, const char *context)
static bool is_crappy_intel_card()
static HWND clone_window(HWND hWnd, LPVOID lpParam)
GHOST_TSuccess
Definition GHOST_Types.h:80
@ GHOST_kFailure
Definition GHOST_Types.h:80
@ GHOST_kSuccess
Definition GHOST_Types.h:80
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
Definition btQuadWord.h:119
GHOST_ContextWGL(bool stereoVisual, bool alphaBackground, HWND hWnd, HDC hDC, int contextProfileMask, int contextMajorVersion, int contextMinorVersion, int contextFlags, int contextResetNotificationStrategy)
GHOST_TSuccess getSwapInterval(int &intervalOut) override
GHOST_TSuccess releaseNativeHandles() override
GHOST_TSuccess releaseDrawingContext() override
GHOST_TSuccess initializeDrawingContext() override
GHOST_TSuccess setSwapInterval(int interval) override
~GHOST_ContextWGL() override
GHOST_TSuccess activateDrawingContext() override
GHOST_TSuccess swapBuffers() override
static GHOST_Context * active_context_
GHOST_Context(bool stereoVisual)
#define assert(assertion)
#define out
int count
#define L
static void error(const char *str)
bool has_WGL_ARB_create_context_robustness
PIXELFORMATDESCRIPTOR preferredPFD
DummyContextWGL(HDC hDC, HWND hWnd, bool stereoVisual, bool needAlpha)
bool has_WGL_ARB_create_context_profile
i
Definition text_draw.cc:230