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