VirtualBox

source: vbox/trunk/src/VBox/Additions/common/crOpenGL/wgl.c@ 37216

最後變更 在這個檔案從37216是 37216,由 vboxsync 提交於 14 年 前

wddm/3d: fix google earth rendering

  • 屬性 svn:eol-style 設為 native
  • 屬性 svn:keywords 設為 Id
檔案大小: 20.0 KB
 
1/* Copyright (c) 2001, Stanford University
2 * All rights reserved
3 *
4 * See the file LICENSE.txt for information on redistributing this software.
5 */
6
7#include "cr_error.h"
8#include "cr_spu.h"
9#include "cr_environment.h"
10#include "stub.h"
11
12/* I *know* most of the parameters are unused, dammit. */
13#pragma warning( disable: 4100 )
14
15#define WIN32_LEAN_AND_MEAN
16#include <windows.h>
17#include <stdio.h>
18
19static GLuint desiredVisual = CR_RGB_BIT;
20
21
22/**
23 * Compute a mask of CR_*_BIT flags which reflects the attributes of
24 * the pixel format of the given hdc.
25 */
26static GLuint ComputeVisBits( HDC hdc )
27{
28 PIXELFORMATDESCRIPTOR pfd;
29 int iPixelFormat;
30 GLuint b = 0;
31
32 iPixelFormat = GetPixelFormat( hdc );
33
34 DescribePixelFormat( hdc, iPixelFormat, sizeof(pfd), &pfd );
35
36 if (pfd.cDepthBits > 0)
37 b |= CR_DEPTH_BIT;
38 if (pfd.cAccumBits > 0)
39 b |= CR_ACCUM_BIT;
40 if (pfd.cColorBits > 8)
41 b |= CR_RGB_BIT;
42 if (pfd.cStencilBits > 0)
43 b |= CR_STENCIL_BIT;
44 if (pfd.cAlphaBits > 0)
45 b |= CR_ALPHA_BIT;
46 if (pfd.dwFlags & PFD_DOUBLEBUFFER)
47 b |= CR_DOUBLE_BIT;
48 if (pfd.dwFlags & PFD_STEREO)
49 b |= CR_STEREO_BIT;
50
51 return b;
52}
53
54int WINAPI wglChoosePixelFormat_prox( HDC hdc, CONST PIXELFORMATDESCRIPTOR *pfd )
55{
56 DWORD okayFlags;
57
58 stubInit();
59
60 /*
61 * NOTE!!!
62 * Here we're telling the renderspu not to use the GDI
63 * equivalent's of ChoosePixelFormat/DescribePixelFormat etc
64 * There are subtle differences in the use of these calls.
65 */
66 crSetenv("CR_WGL_DO_NOT_USE_GDI", "yes");
67
68 if ( pfd->nSize != sizeof(*pfd) || pfd->nVersion != 1 ) {
69 crError( "wglChoosePixelFormat: bad pfd\n" );
70 return 0;
71 }
72
73 okayFlags = ( PFD_DRAW_TO_WINDOW |
74 PFD_SUPPORT_GDI |
75 PFD_SUPPORT_OPENGL |
76 PFD_DOUBLEBUFFER |
77 PFD_DOUBLEBUFFER_DONTCARE |
78 PFD_SWAP_EXCHANGE |
79 PFD_SWAP_COPY |
80 PFD_STEREO |
81 PFD_STEREO_DONTCARE |
82 PFD_DEPTH_DONTCARE );
83 if ( pfd->dwFlags & ~okayFlags ) {
84 crWarning( "wglChoosePixelFormat: only support flags=0x%x, but you gave me flags=0x%x", okayFlags, pfd->dwFlags );
85 return 0;
86 }
87
88 if ( pfd->iPixelType != PFD_TYPE_RGBA ) {
89 crError( "wglChoosePixelFormat: only support RGBA\n" );
90 }
91
92 if ( pfd->cColorBits > 32 ||
93 pfd->cRedBits > 8 ||
94 pfd->cGreenBits > 8 ||
95 pfd->cBlueBits > 8 ||
96 pfd->cAlphaBits > 8 ) {
97 crWarning( "wglChoosePixelFormat: too much color precision requested\n" );
98 }
99
100 if ( pfd->dwFlags & PFD_DOUBLEBUFFER )
101 desiredVisual |= CR_DOUBLE_BIT;
102
103 if ( pfd->dwFlags & PFD_STEREO )
104 desiredVisual |= CR_STEREO_BIT;
105
106 if ( pfd->cColorBits > 8)
107 desiredVisual |= CR_RGB_BIT;
108
109 if ( pfd->cAccumBits > 0 ||
110 pfd->cAccumRedBits > 0 ||
111 pfd->cAccumGreenBits > 0 ||
112 pfd->cAccumBlueBits > 0 ||
113 pfd->cAccumAlphaBits > 0 ) {
114 crWarning( "wglChoosePixelFormat: asked for accumulation buffer, ignoring\n" );
115 }
116
117 if ( pfd->cAccumBits > 0 )
118 desiredVisual |= CR_ACCUM_BIT;
119
120 if ( pfd->cDepthBits > 32 ) {
121 crError( "wglChoosePixelFormat; asked for too many depth bits\n" );
122 }
123
124 if ( pfd->cDepthBits > 0 )
125 desiredVisual |= CR_DEPTH_BIT;
126
127 if ( pfd->cStencilBits > 8 ) {
128 crError( "wglChoosePixelFormat: asked for too many stencil bits\n" );
129 }
130
131 if ( pfd->cStencilBits > 0 )
132 desiredVisual |= CR_STENCIL_BIT;
133
134 if ( pfd->cAuxBuffers > 0 ) {
135 crError( "wglChoosePixelFormat: asked for aux buffers\n" );
136 }
137
138 if ( pfd->iLayerType != PFD_MAIN_PLANE ) {
139 crError( "wglChoosePixelFormat: asked for a strange layer\n" );
140 }
141
142 return 1;
143}
144
145BOOL WINAPI wglSetPixelFormat_prox( HDC hdc, int pixelFormat,
146 CONST PIXELFORMATDESCRIPTOR *pdf )
147{
148 if ( pixelFormat != 1 ) {
149 crError( "wglSetPixelFormat: pixelFormat=%d?\n", pixelFormat );
150 }
151
152 return 1;
153}
154
155BOOL WINAPI wglDeleteContext_prox( HGLRC hglrc )
156{
157 stubDestroyContext( (unsigned long) hglrc );
158 return 1;
159}
160
161BOOL WINAPI wglMakeCurrent_prox( HDC hdc, HGLRC hglrc )
162{
163 ContextInfo *context;
164 WindowInfo *window;
165
166 context = (ContextInfo *) crHashtableSearch(stub.contextTable, (unsigned long) hglrc);
167 window = stubGetWindowInfo(hdc);
168
169 if (hglrc!=0 && !context)
170 {
171 crWarning("wglMakeCurrent got unexpected hglrc 0x%x", hglrc);
172 }
173
174 return stubMakeCurrent( window, context );
175}
176
177HGLRC WINAPI wglGetCurrentContext_prox( void )
178{
179 return (HGLRC) (stub.currentContext ? stub.currentContext->id : 0);
180}
181
182HDC WINAPI wglGetCurrentDC_prox( void )
183{
184 if (stub.currentContext && stub.currentContext->currentDrawable)
185 return (HDC) stub.currentContext->currentDrawable->drawable;
186 else
187 return (HDC) NULL;
188}
189
190int WINAPI wglGetPixelFormat_prox( HDC hdc )
191{
192 /* this is what we call our generic pixelformat, regardless of the HDC */
193 return 1;
194}
195
196int WINAPI wglDescribePixelFormat_prox( HDC hdc, int pixelFormat, UINT nBytes,
197 LPPIXELFORMATDESCRIPTOR pfd )
198{
199/* if ( pixelFormat != 1 ) {
200 * crError( "wglDescribePixelFormat: pixelFormat=%d?\n", pixelFormat );
201 * return 0;
202 * } */
203
204 if ( !pfd ) {
205 crWarning( "wglDescribePixelFormat: pfd=NULL\n" );
206 return 1; /* There's only one, baby */
207 }
208
209 if ( nBytes != sizeof(*pfd) ) {
210 crWarning( "wglDescribePixelFormat: nBytes=%u?\n", nBytes );
211 return 1; /* There's only one, baby */
212 }
213
214 pfd->nSize = sizeof(*pfd);
215 pfd->nVersion = 1;
216 pfd->dwFlags = ( PFD_DRAW_TO_WINDOW |
217 PFD_SUPPORT_GDI |
218 PFD_SUPPORT_OPENGL |
219 PFD_DOUBLEBUFFER );
220 pfd->iPixelType = PFD_TYPE_RGBA;
221 pfd->cColorBits = 32;
222 pfd->cRedBits = 8;
223 pfd->cRedShift = 24;
224 pfd->cGreenBits = 8;
225 pfd->cGreenShift = 16;
226 pfd->cBlueBits = 8;
227 pfd->cBlueShift = 8;
228 pfd->cAlphaBits = 8;
229 pfd->cAlphaShift = 0;
230 pfd->cAccumBits = 0;
231 pfd->cAccumRedBits = 0;
232 pfd->cAccumGreenBits = 0;
233 pfd->cAccumBlueBits = 0;
234 pfd->cAccumAlphaBits = 0;
235 pfd->cDepthBits = 32;
236 pfd->cStencilBits = 8;
237 pfd->cAuxBuffers = 0;
238 pfd->iLayerType = PFD_MAIN_PLANE;
239 pfd->bReserved = 0;
240 pfd->dwLayerMask = 0;
241 pfd->dwVisibleMask = 0;
242 pfd->dwDamageMask = 0;
243
244 /* the max PFD index */
245 return 1;
246}
247
248BOOL WINAPI wglShareLists_prox( HGLRC hglrc1, HGLRC hglrc2 )
249{
250 crWarning( "wglShareLists: unsupported" );
251 return 0;
252}
253
254
255HGLRC WINAPI wglCreateContext_prox( HDC hdc )
256{
257 char dpyName[MAX_DPY_NAME];
258 ContextInfo *context;
259
260 stubInit();
261
262 CRASSERT(stub.contextTable);
263
264 sprintf(dpyName, "%d", hdc);
265 if (stub.haveNativeOpenGL)
266 desiredVisual |= ComputeVisBits( hdc );
267
268 context = stubNewContext(dpyName, desiredVisual, UNDECIDED, 0);
269 if (!context)
270 return 0;
271
272 return (HGLRC) context->id;
273}
274
275BOOL WINAPI
276wglSwapBuffers_prox( HDC hdc )
277{
278 WindowInfo *window = stubGetWindowInfo(hdc);
279 stubSwapBuffers( window, 0 );
280 return 1;
281}
282
283BOOL WINAPI wglCopyContext_prox( HGLRC src, HGLRC dst, UINT mask )
284{
285 crWarning( "wglCopyContext: unsupported" );
286 return 0;
287}
288
289HGLRC WINAPI wglCreateLayerContext_prox( HDC hdc, int layerPlane )
290{
291 stubInit();
292 crWarning( "wglCreateLayerContext: unsupported" );
293 return 0;
294}
295
296PROC WINAPI wglGetProcAddress_prox( LPCSTR name )
297{
298 return (PROC) crGetProcAddress( name );
299}
300
301BOOL WINAPI wglUseFontBitmapsA_prox( HDC hdc, DWORD first, DWORD count, DWORD listBase )
302{
303 crWarning( "wglUseFontBitmapsA: unsupported" );
304 return 0;
305}
306
307BOOL WINAPI wglUseFontBitmapsW_prox( HDC hdc, DWORD first, DWORD count, DWORD listBase )
308{
309 crWarning( "wglUseFontBitmapsW: unsupported" );
310 return 0;
311}
312
313BOOL WINAPI wglDescribeLayerPlane_prox( HDC hdc, int pixelFormat, int layerPlane,
314 UINT nBytes, LPLAYERPLANEDESCRIPTOR lpd )
315{
316 crWarning( "wglDescribeLayerPlane: unimplemented" );
317 return 0;
318}
319
320int WINAPI wglSetLayerPaletteEntries_prox( HDC hdc, int layerPlane, int start,
321 int entries, CONST COLORREF *cr )
322{
323 crWarning( "wglSetLayerPaletteEntries: unsupported" );
324 return 0;
325}
326
327int WINAPI wglGetLayerPaletteEntries_prox( HDC hdc, int layerPlane, int start,
328 int entries, COLORREF *cr )
329{
330 crWarning( "wglGetLayerPaletteEntries: unsupported" );
331 return 0;
332}
333
334BOOL WINAPI wglRealizeLayerPalette_prox( HDC hdc, int layerPlane, BOOL realize )
335{
336 crWarning( "wglRealizeLayerPalette: unsupported" );
337 return 0;
338}
339
340DWORD WINAPI wglSwapMultipleBuffers_prox( UINT a, CONST void *b )
341{
342 crWarning( "wglSwapMultipleBuffer: unsupported" );
343 return 0;
344}
345
346BOOL WINAPI wglUseFontOutlinesA_prox( HDC hdc, DWORD first, DWORD count, DWORD listBase,
347 FLOAT deviation, FLOAT extrusion, int format,
348 LPGLYPHMETRICSFLOAT gmf )
349{
350 crWarning( "wglUseFontOutlinesA: unsupported" );
351 return 0;
352}
353
354BOOL WINAPI wglUseFontOutlinesW_prox( HDC hdc, DWORD first, DWORD count, DWORD listBase,
355 FLOAT deviation, FLOAT extrusion, int format,
356 LPGLYPHMETRICSFLOAT gmf )
357{
358 crWarning( "wglUseFontOutlinesW: unsupported" );
359 return 0;
360}
361
362BOOL WINAPI wglSwapLayerBuffers_prox( HDC hdc, UINT planes )
363{
364 if (planes == WGL_SWAP_MAIN_PLANE)
365 {
366 return wglSwapBuffers_prox(hdc);
367 }
368 else
369 {
370 crWarning( "wglSwapLayerBuffers: unsupported" );
371 return 0;
372 }
373}
374
375BOOL WINAPI wglChoosePixelFormatEXT_prox
376(HDC hdc, const int *piAttributes, const FLOAT *pfAttributes, UINT nMaxFormats, int *piFormats, UINT *nNumFormats)
377{
378 int *pi;
379 int wants_rgb = 0;
380
381 stubInit();
382
383 /* TODO : Need to check pfAttributes too ! */
384
385 for ( pi = (int *)piAttributes; *pi != 0; pi++ )
386 {
387 switch ( *pi )
388 {
389 case WGL_COLOR_BITS_EXT:
390 if (pi[1] > 8)
391 wants_rgb = 1;
392 pi++;
393 break;
394
395 case WGL_RED_BITS_EXT:
396 case WGL_GREEN_BITS_EXT:
397 case WGL_BLUE_BITS_EXT:
398 if (pi[1] > 3)
399 wants_rgb = 1;
400 pi++;
401 break;
402
403 case WGL_ACCUM_ALPHA_BITS_EXT:
404 case WGL_ALPHA_BITS_EXT:
405 if (pi[1] > 0)
406 desiredVisual |= CR_ALPHA_BIT;
407 pi++;
408 break;
409
410 case WGL_DOUBLE_BUFFER_EXT:
411 if (pi[1] > 0)
412 desiredVisual |= CR_DOUBLE_BIT;
413 pi++;
414 break;
415
416 case WGL_STEREO_EXT:
417 if (pi[1] > 0)
418 desiredVisual |= CR_STEREO_BIT;
419 pi++;
420 break;
421
422 case WGL_DEPTH_BITS_EXT:
423 if (pi[1] > 0)
424 desiredVisual |= CR_DEPTH_BIT;
425 pi++;
426 break;
427
428 case WGL_STENCIL_BITS_EXT:
429 if (pi[1] > 0)
430 desiredVisual |= CR_STENCIL_BIT;
431 pi++;
432 break;
433
434 case WGL_ACCUM_RED_BITS_EXT:
435 case WGL_ACCUM_GREEN_BITS_EXT:
436 case WGL_ACCUM_BLUE_BITS_EXT:
437 if (pi[1] > 0)
438 desiredVisual |= CR_ACCUM_BIT;
439 pi++;
440 break;
441
442 case WGL_SAMPLE_BUFFERS_EXT:
443 case WGL_SAMPLES_EXT:
444 if (pi[1] > 0)
445 desiredVisual |= CR_MULTISAMPLE_BIT;
446 pi++;
447 break;
448
449 case WGL_SUPPORT_OPENGL_ARB:
450 case WGL_DRAW_TO_WINDOW_ARB:
451 case WGL_ACCELERATION_ARB:
452 pi++;
453 break;
454
455 case WGL_PIXEL_TYPE_ARB:
456 if(pi[1]!=WGL_TYPE_RGBA_ARB)
457 {
458 crWarning("WGL_PIXEL_TYPE 0x%x not supported!", pi[1]);
459 return 0;
460 }
461 pi++;
462 break;
463
464 default:
465 crWarning( "wglChoosePixelFormatEXT: bad pi=0x%x", *pi );
466 return 0;
467 }
468 }
469
470 if (nNumFormats) *nNumFormats = 1;
471 if (nMaxFormats>0 && piFormats)
472 {
473 piFormats[0] = 1;
474 }
475
476 return 1;
477}
478
479BOOL WINAPI wglGetPixelFormatAttribivEXT_prox
480(HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, int *pValues)
481{
482 UINT i;
483
484 if (!pValues || !piAttributes) return 0;
485
486 if ((nAttributes!=1) || (piAttributes && piAttributes[0]!=WGL_NUMBER_PIXEL_FORMATS_ARB))
487 {
488 if (iPixelFormat!=1)
489 {
490 crDebug("wglGetPixelFormatAttribivARB: bad pf:%i", iPixelFormat);
491 return 0;
492 }
493 }
494
495 for (i=0; i<nAttributes; ++i)
496 {
497 switch (piAttributes[i])
498 {
499 case WGL_NUMBER_PIXEL_FORMATS_ARB:
500 pValues[i] = 1;
501 break;
502 case WGL_DRAW_TO_WINDOW_ARB:
503 case WGL_SUPPORT_OPENGL_ARB:
504 case WGL_DOUBLE_BUFFER_ARB:
505 case WGL_STEREO_ARB:
506 pValues[i] = 1;
507 break;
508 case WGL_DRAW_TO_BITMAP_ARB:
509 case WGL_NEED_PALETTE_ARB:
510 case WGL_NEED_SYSTEM_PALETTE_ARB:
511 case WGL_SWAP_LAYER_BUFFERS_ARB:
512 case WGL_NUMBER_OVERLAYS_ARB:
513 case WGL_NUMBER_UNDERLAYS_ARB:
514 case WGL_TRANSPARENT_ARB:
515 case WGL_TRANSPARENT_RED_VALUE_ARB:
516 case WGL_TRANSPARENT_GREEN_VALUE_ARB:
517 case WGL_TRANSPARENT_BLUE_VALUE_ARB:
518 case WGL_TRANSPARENT_ALPHA_VALUE_ARB:
519 case WGL_TRANSPARENT_INDEX_VALUE_ARB:
520 case WGL_SHARE_DEPTH_ARB:
521 case WGL_SHARE_STENCIL_ARB:
522 case WGL_SHARE_ACCUM_ARB:
523 case WGL_SUPPORT_GDI_ARB:
524 pValues[i] = 0;
525 break;
526 case WGL_ACCELERATION_ARB:
527 pValues[i] = WGL_FULL_ACCELERATION_ARB;
528 break;
529 case WGL_SWAP_METHOD_ARB:
530 pValues[i] = WGL_SWAP_UNDEFINED_ARB;
531 break;
532 case WGL_PIXEL_TYPE_ARB:
533 pValues[i] = WGL_TYPE_RGBA_ARB;
534 break;
535 case WGL_COLOR_BITS_ARB:
536 pValues[i] = 32;
537 break;
538 case WGL_RED_BITS_ARB:
539 case WGL_GREEN_BITS_ARB:
540 case WGL_BLUE_BITS_ARB:
541 case WGL_ALPHA_BITS_ARB:
542 pValues[i] = 8;
543 break;
544 case WGL_RED_SHIFT_ARB:
545 pValues[i] = 24;
546 break;
547 case WGL_GREEN_SHIFT_ARB:
548 pValues[i] = 16;
549 break;
550 case WGL_BLUE_SHIFT_ARB:
551 pValues[i] = 8;
552 break;
553 case WGL_ALPHA_SHIFT_ARB:
554 pValues[i] = 0;
555 break;
556 case WGL_ACCUM_BITS_ARB:
557 pValues[i] = 0;
558 break;
559 case WGL_ACCUM_RED_BITS_ARB:
560 pValues[i] = 0;
561 break;
562 case WGL_ACCUM_GREEN_BITS_ARB:
563 pValues[i] = 0;
564 break;
565 case WGL_ACCUM_BLUE_BITS_ARB:
566 pValues[i] = 0;
567 break;
568 case WGL_ACCUM_ALPHA_BITS_ARB:
569 pValues[i] = 0;
570 break;
571 case WGL_DEPTH_BITS_ARB:
572 pValues[i] = 32;
573 break;
574 case WGL_STENCIL_BITS_ARB:
575 pValues[i] = 8;
576 break;
577 case WGL_AUX_BUFFERS_ARB:
578 pValues[i] = 0;
579 break;
580 case WGL_SAMPLE_BUFFERS_EXT:
581 pValues[i] = 1;
582 break;
583 case WGL_SAMPLES_EXT:
584 pValues[i] = 1;
585 break;
586 default:
587 crWarning("wglGetPixelFormatAttribivARB: bad attrib=0x%x", piAttributes[i]);
588 return 0;
589 }
590 }
591
592 return 1;
593}
594
595BOOL WINAPI wglGetPixelFormatAttribfvEXT_prox
596(HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, float *pValues)
597{
598 UINT i;
599
600 if (!pValues || !piAttributes) return 0;
601
602 if ((nAttributes!=1) || (piAttributes && piAttributes[0]!=WGL_NUMBER_PIXEL_FORMATS_ARB))
603 {
604 if (iPixelFormat!=1)
605 {
606 crDebug("wglGetPixelFormatAttribivARB: bad pf:%i", iPixelFormat);
607 return 0;
608 }
609 }
610
611 for (i=0; i<nAttributes; ++i)
612 {
613 switch (piAttributes[i])
614 {
615 case WGL_NUMBER_PIXEL_FORMATS_ARB:
616 pValues[i] = 1.f;
617 break;
618 case WGL_DRAW_TO_WINDOW_ARB:
619 case WGL_SUPPORT_OPENGL_ARB:
620 case WGL_DOUBLE_BUFFER_ARB:
621 case WGL_STEREO_ARB:
622 pValues[i] = 1.f;
623 break;
624 case WGL_DRAW_TO_BITMAP_ARB:
625 case WGL_NEED_PALETTE_ARB:
626 case WGL_NEED_SYSTEM_PALETTE_ARB:
627 case WGL_SWAP_LAYER_BUFFERS_ARB:
628 case WGL_NUMBER_OVERLAYS_ARB:
629 case WGL_NUMBER_UNDERLAYS_ARB:
630 case WGL_TRANSPARENT_ARB:
631 case WGL_TRANSPARENT_RED_VALUE_ARB:
632 case WGL_TRANSPARENT_GREEN_VALUE_ARB:
633 case WGL_TRANSPARENT_BLUE_VALUE_ARB:
634 case WGL_TRANSPARENT_ALPHA_VALUE_ARB:
635 case WGL_TRANSPARENT_INDEX_VALUE_ARB:
636 case WGL_SHARE_DEPTH_ARB:
637 case WGL_SHARE_STENCIL_ARB:
638 case WGL_SHARE_ACCUM_ARB:
639 case WGL_SUPPORT_GDI_ARB:
640 pValues[i] = 0.f;
641 break;
642 case WGL_ACCELERATION_ARB:
643 pValues[i] = WGL_FULL_ACCELERATION_ARB;
644 break;
645 case WGL_SWAP_METHOD_ARB:
646 pValues[i] = WGL_SWAP_UNDEFINED_ARB;
647 break;
648 case WGL_PIXEL_TYPE_ARB:
649 pValues[i] = WGL_TYPE_RGBA_ARB;
650 break;
651 case WGL_COLOR_BITS_ARB:
652 pValues[i] = 32.f;
653 break;
654 case WGL_RED_BITS_ARB:
655 case WGL_GREEN_BITS_ARB:
656 case WGL_BLUE_BITS_ARB:
657 case WGL_ALPHA_BITS_ARB:
658 pValues[i] = 8.f;
659 break;
660 case WGL_RED_SHIFT_ARB:
661 pValues[i] = 24.f;
662 break;
663 case WGL_GREEN_SHIFT_ARB:
664 pValues[i] = 16.f;
665 break;
666 case WGL_BLUE_SHIFT_ARB:
667 pValues[i] = 8.f;
668 break;
669 case WGL_ALPHA_SHIFT_ARB:
670 pValues[i] = 0.f;
671 break;
672 case WGL_ACCUM_BITS_ARB:
673 pValues[i] = 0.f;
674 break;
675 case WGL_ACCUM_RED_BITS_ARB:
676 pValues[i] = 0.f;
677 break;
678 case WGL_ACCUM_GREEN_BITS_ARB:
679 pValues[i] = 0.f;
680 break;
681 case WGL_ACCUM_BLUE_BITS_ARB:
682 pValues[i] = 0.f;
683 break;
684 case WGL_ACCUM_ALPHA_BITS_ARB:
685 pValues[i] = 0.f;
686 break;
687 case WGL_DEPTH_BITS_ARB:
688 pValues[i] = 32.f;
689 break;
690 case WGL_STENCIL_BITS_ARB:
691 pValues[i] = 8.f;
692 break;
693 case WGL_AUX_BUFFERS_ARB:
694 pValues[i] = 0.f;
695 break;
696 case WGL_SAMPLE_BUFFERS_EXT:
697 pValues[i] = 1.f;
698 break;
699 case WGL_SAMPLES_EXT:
700 pValues[i] = 1.f;
701 break;
702 default:
703 crWarning("wglGetPixelFormatAttribivARB: bad attrib=0x%x", piAttributes[i]);
704 return 0;
705 }
706 }
707
708 return 1;
709}
710
711BOOL WINAPI wglSwapIntervalEXT_prox(int interval)
712{
713 return TRUE;
714}
715
716int WINAPI wglGetSwapIntervalEXT_prox()
717{
718 return 1;
719}
720
721static GLubyte *gsz_wgl_extensions = "WGL_EXT_pixel_format WGL_ARB_pixel_format WGL_ARB_multisample";
722
723const GLubyte * WINAPI wglGetExtensionsStringEXT_prox()
724{
725 return gsz_wgl_extensions;
726}
727
728const GLubyte * WINAPI wglGetExtensionsStringARB_prox(HDC hdc)
729{
730 (void) hdc;
731
732 return gsz_wgl_extensions;
733}
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette