Changeset 41971 in vbox for trunk/src/VBox/Additions/common
- Timestamp:
- Jun 29, 2012 12:31:04 PM (13 years ago)
- Location:
- trunk/src/VBox/Additions/common/crOpenGL
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/crOpenGL/icd_drv.c
r40267 r41971 39 39 } }; 40 40 41 /* Currently host part will misbehave re-creating context with proper visual bits 42 * if contexts with alternative visual bits is requested. 43 * For now we just report a superset of all visual bits to avoid that. 44 * Better to it on the host side as well? 45 * We could also implement properly multiple pixel formats, 46 * which should be done by implementing offscreen rendering or multiple host contexts. 47 * */ 48 #define VBOX_CROGL_USE_VBITS_SUPERSET 49 50 #ifdef VBOX_CROGL_USE_VBITS_SUPERSET 51 static GLuint desiredVisual = CR_RGB_BIT | CR_ALPHA_BIT | CR_DEPTH_BIT | CR_STENCIL_BIT | CR_ACCUM_BIT | CR_DOUBLE_BIT; 52 #else 41 53 static GLuint desiredVisual = CR_RGB_BIT; 42 54 #endif 55 56 #ifndef VBOX_CROGL_USE_VBITS_SUPERSET 43 57 /** 44 58 * Compute a mask of CR_*_BIT flags which reflects the attributes of … … 72 86 return b; 73 87 } 88 #endif 74 89 75 90 void APIENTRY DrvReleaseContext(HGLRC hglrc) … … 144 159 145 160 sprintf(dpyName, "%d", hdc); 161 #ifndef VBOX_CROGL_USE_VBITS_SUPERSET 146 162 if (stub.haveNativeOpenGL) 147 163 desiredVisual |= ComputeVisBits( hdc ); 164 #endif 148 165 149 166 context = stubNewContext(dpyName, desiredVisual, UNDECIDED, 0); -
trunk/src/VBox/Additions/common/crOpenGL/wgl.c
r40267 r41971 17 17 #include <stdio.h> 18 18 19 /* Currently host part will misbehave re-creating context with proper visual bits 20 * if contexts with alternative visual bits is requested. 21 * For now we just report a superset of all visual bits to avoid that. 22 * Better to it on the host side as well? 23 * We could also implement properly multiple pixel formats, 24 * which should be done by implementing offscreen rendering or multiple host contexts. 25 * */ 26 #define VBOX_CROGL_USE_VBITS_SUPERSET 27 28 #ifdef VBOX_CROGL_USE_VBITS_SUPERSET 29 static GLuint desiredVisual = CR_RGB_BIT | CR_ALPHA_BIT | CR_DEPTH_BIT | CR_STENCIL_BIT | CR_ACCUM_BIT | CR_DOUBLE_BIT; 30 #else 19 31 static GLuint desiredVisual = CR_RGB_BIT; 20 21 32 #endif 33 34 #ifndef VBOX_CROGL_USE_VBITS_SUPERSET 22 35 /** 23 36 * Compute a mask of CR_*_BIT flags which reflects the attributes of … … 51 64 return b; 52 65 } 66 #endif 53 67 54 68 int WINAPI wglChoosePixelFormat_prox( HDC hdc, CONST PIXELFORMATDESCRIPTOR *pfd ) … … 121 135 } 122 136 123 /* @todo: although this is not needed by VSG Open Inventor interop, 124 * still it does not make any sense actually since reporting this 125 * as well as choosing a pixel format with this cap would not do anything 126 * since ICD stuff has its own pixelformat state var */ 127 // if ( pfd->cAccumBits > 0 ) 128 // desiredVisual |= CR_ACCUM_BIT; 137 if ( pfd->cAccumBits > 0 ) 138 desiredVisual |= CR_ACCUM_BIT; 129 139 130 140 if ( pfd->cDepthBits > 32 ) { … … 297 307 298 308 sprintf(dpyName, "%d", hdc); 309 #ifndef VBOX_CROGL_USE_VBITS_SUPERSET 299 310 if (stub.haveNativeOpenGL) 300 311 desiredVisual |= ComputeVisBits( hdc ); 312 #endif 301 313 302 314 context = stubNewContext(dpyName, desiredVisual, UNDECIDED, 0); … … 494 506 case WGL_ACCUM_BLUE_BITS_EXT: 495 507 if (pi[1] > 0) 496 { 497 /* @todo: although this is not needed by VSG Open Inventor interop, 498 * still it does not make any sense actually since reporting this 499 * as well as choosing a pixel format with this cap would not do anything 500 * since ICD stuff has its own pixelformat state var */ 501 crWarning("WGL_ACCUM_XXX not supporteed!"); 502 return 0; 503 // desiredVisual |= CR_ACCUM_BIT; 504 } 508 desiredVisual |= CR_ACCUM_BIT; 505 509 pi++; 506 510 break;
Note:
See TracChangeset
for help on using the changeset viewer.