Changeset 40267 in vbox for trunk/src/VBox/Additions/common
- Timestamp:
- Feb 28, 2012 7:09:18 AM (13 years ago)
- Location:
- trunk/src/VBox/Additions/common/crOpenGL
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/common/crOpenGL/icd_drv.c
r37986 r40267 75 75 void APIENTRY DrvReleaseContext(HGLRC hglrc) 76 76 { 77 CR_DDI_PROLOGUE(); 77 78 /*crDebug( "DrvReleaseContext(0x%x) called", hglrc );*/ 78 79 stubMakeCurrent( NULL, NULL ); … … 81 82 BOOL APIENTRY DrvValidateVersion(DWORD version) 82 83 { 84 CR_DDI_PROLOGUE(); 83 85 if (stubInit()) { 84 86 crDebug("DrvValidateVersion %x -> TRUE\n", version); … … 97 99 BOOL ret; 98 100 101 CR_DDI_PROLOGUE(); 102 99 103 /*crDebug( "DrvSetContext called(0x%x, 0x%x)", hdc, hglrc );*/ 100 104 (void) (callback); … … 116 120 BOOL APIENTRY DrvSetPixelFormat(HDC hdc, int iPixelFormat) 117 121 { 122 CR_DDI_PROLOGUE(); 118 123 crDebug( "DrvSetPixelFormat(0x%x, %i) called.", hdc, iPixelFormat ); 119 124 … … 129 134 char dpyName[MAX_DPY_NAME]; 130 135 ContextInfo *context; 136 137 CR_DDI_PROLOGUE(); 131 138 132 139 crDebug( "DrvCreateContext(0x%x) called.", hdc); … … 149 156 HGLRC APIENTRY DrvCreateLayerContext(HDC hdc, int iLayerPlane) 150 157 { 158 CR_DDI_PROLOGUE(); 151 159 crDebug( "DrvCreateLayerContext(0x%x, %i) called.", hdc, iLayerPlane); 152 160 //We don't support more than 1 layers. … … 164 172 LPLAYERPLANEDESCRIPTOR plpd) 165 173 { 174 CR_DDI_PROLOGUE(); 166 175 crWarning( "DrvDescribeLayerPlane: unimplemented" ); 167 176 CRASSERT(false); … … 173 182 COLORREF *pcr) 174 183 { 184 CR_DDI_PROLOGUE(); 175 185 crWarning( "DrvGetLayerPaletteEntries: unsupported" ); 176 186 CRASSERT(false); … … 180 190 int APIENTRY DrvDescribePixelFormat(HDC hdc, int iPixelFormat, UINT nBytes, LPPIXELFORMATDESCRIPTOR pfd) 181 191 { 192 CR_DDI_PROLOGUE(); 182 193 if ( !pfd ) { 183 194 return 2; … … 198 209 PFD_SUPPORT_OPENGL | 199 210 PFD_DOUBLEBUFFER); 211 212 pfd->dwFlags |= 0x8000; /* <- Needed for VSG Open Inventor to be happy */ 213 200 214 pfd->iPixelType = PFD_TYPE_RGBA; 201 215 pfd->cColorBits = 32; … … 260 274 BOOL APIENTRY DrvDeleteContext(HGLRC hglrc) 261 275 { 276 CR_DDI_PROLOGUE(); 262 277 /*crDebug( "DrvDeleteContext(0x%x) called", hglrc );*/ 263 278 stubDestroyContext( (unsigned long) hglrc ); … … 267 282 BOOL APIENTRY DrvCopyContext(HGLRC hglrcSrc, HGLRC hglrcDst, UINT mask) 268 283 { 284 CR_DDI_PROLOGUE(); 269 285 crWarning( "DrvCopyContext: unsupported" ); 270 286 return 0; … … 273 289 BOOL APIENTRY DrvShareLists(HGLRC hglrc1, HGLRC hglrc2) 274 290 { 291 CR_DDI_PROLOGUE(); 275 292 crWarning( "DrvShareLists: unsupported" ); 276 293 return 1; … … 281 298 CONST COLORREF *pcr) 282 299 { 300 CR_DDI_PROLOGUE(); 283 301 crWarning( "DrvSetLayerPaletteEntries: unsupported" ); 284 302 return 0; … … 288 306 BOOL APIENTRY DrvRealizeLayerPalette(HDC hdc, int iLayerPlane, BOOL bRealize) 289 307 { 308 CR_DDI_PROLOGUE(); 290 309 crWarning( "DrvRealizeLayerPalette: unsupported" ); 291 310 return 0; … … 294 313 BOOL APIENTRY DrvSwapLayerBuffers(HDC hdc, UINT fuPlanes) 295 314 { 315 CR_DDI_PROLOGUE(); 296 316 if (fuPlanes == 1) 297 317 { … … 309 329 { 310 330 WindowInfo *window; 331 332 CR_DDI_PROLOGUE(); 311 333 /*crDebug( "DrvSwapBuffers(0x%x) called", hdc );*/ 312 334 window = stubGetWindowInfo(hdc); -
trunk/src/VBox/Additions/common/crOpenGL/wgl.c
r39568 r40267 56 56 DWORD okayFlags; 57 57 58 CR_DDI_PROLOGUE(); 59 58 60 stubInit(); 59 61 … … 78 80 PFD_SWAP_EXCHANGE | 79 81 PFD_SWAP_COPY | 80 PFD_STEREO | 82 /* @todo: this is disabled due to VSG Open Inventor interop issues 83 * it does not make any sense actually since reporting this 84 * as well as choosing a pixel format with this cap would not do anything 85 * since ICD stuff has its own pixelformat state var */ 86 // PFD_STEREO | 81 87 PFD_STEREO_DONTCARE | 82 88 PFD_DEPTH_DONTCARE ); … … 115 121 } 116 122 117 if ( pfd->cAccumBits > 0 ) 118 desiredVisual |= CR_ACCUM_BIT; 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; 119 129 120 130 if ( pfd->cDepthBits > 32 ) { … … 146 156 CONST PIXELFORMATDESCRIPTOR *pdf ) 147 157 { 158 CR_DDI_PROLOGUE(); 159 148 160 if ( pixelFormat != 1 ) { 149 161 crError( "wglSetPixelFormat: pixelFormat=%d?\n", pixelFormat ); … … 155 167 BOOL WINAPI wglDeleteContext_prox( HGLRC hglrc ) 156 168 { 169 CR_DDI_PROLOGUE(); 157 170 stubDestroyContext( (unsigned long) hglrc ); 158 171 return 1; … … 165 178 BOOL ret; 166 179 180 CR_DDI_PROLOGUE(); 181 167 182 crHashtableLock(stub.windowTable); 168 183 crHashtableLock(stub.contextTable); … … 187 202 { 188 203 ContextInfo *context = stubGetCurrentContext(); 204 CR_DDI_PROLOGUE(); 189 205 return (HGLRC) (context ? context->id : 0); 190 206 } … … 193 209 { 194 210 ContextInfo *context = stubGetCurrentContext(); 211 CR_DDI_PROLOGUE(); 195 212 if (context && context->currentDrawable) 196 213 return (HDC) context->currentDrawable->drawable; … … 201 218 int WINAPI wglGetPixelFormat_prox( HDC hdc ) 202 219 { 220 CR_DDI_PROLOGUE(); 203 221 /* this is what we call our generic pixelformat, regardless of the HDC */ 204 222 return 1; … … 208 226 LPPIXELFORMATDESCRIPTOR pfd ) 209 227 { 228 CR_DDI_PROLOGUE(); 229 210 230 /* if ( pixelFormat != 1 ) { 211 231 * crError( "wglDescribePixelFormat: pixelFormat=%d?\n", pixelFormat ); … … 259 279 BOOL WINAPI wglShareLists_prox( HGLRC hglrc1, HGLRC hglrc2 ) 260 280 { 281 CR_DDI_PROLOGUE(); 261 282 crWarning( "wglShareLists: unsupported" ); 262 283 return 0; … … 268 289 char dpyName[MAX_DPY_NAME]; 269 290 ContextInfo *context; 291 292 CR_DDI_PROLOGUE(); 270 293 271 294 stubInit(); … … 288 311 { 289 312 WindowInfo *window = stubGetWindowInfo(hdc); 313 CR_DDI_PROLOGUE(); 290 314 stubSwapBuffers( window, 0 ); 291 315 return 1; … … 294 318 BOOL WINAPI wglCopyContext_prox( HGLRC src, HGLRC dst, UINT mask ) 295 319 { 320 CR_DDI_PROLOGUE(); 296 321 crWarning( "wglCopyContext: unsupported" ); 297 322 return 0; … … 300 325 HGLRC WINAPI wglCreateLayerContext_prox( HDC hdc, int layerPlane ) 301 326 { 327 CR_DDI_PROLOGUE(); 302 328 stubInit(); 303 329 crWarning( "wglCreateLayerContext: unsupported" ); … … 307 333 PROC WINAPI wglGetProcAddress_prox( LPCSTR name ) 308 334 { 335 CR_DDI_PROLOGUE(); 309 336 return (PROC) crGetProcAddress( name ); 310 337 } … … 312 339 BOOL WINAPI wglUseFontBitmapsA_prox( HDC hdc, DWORD first, DWORD count, DWORD listBase ) 313 340 { 341 CR_DDI_PROLOGUE(); 314 342 crWarning( "wglUseFontBitmapsA: unsupported" ); 315 343 return 0; … … 318 346 BOOL WINAPI wglUseFontBitmapsW_prox( HDC hdc, DWORD first, DWORD count, DWORD listBase ) 319 347 { 348 CR_DDI_PROLOGUE(); 320 349 crWarning( "wglUseFontBitmapsW: unsupported" ); 321 350 return 0; … … 325 354 UINT nBytes, LPLAYERPLANEDESCRIPTOR lpd ) 326 355 { 356 CR_DDI_PROLOGUE(); 327 357 crWarning( "wglDescribeLayerPlane: unimplemented" ); 328 358 return 0; … … 332 362 int entries, CONST COLORREF *cr ) 333 363 { 364 CR_DDI_PROLOGUE(); 334 365 crWarning( "wglSetLayerPaletteEntries: unsupported" ); 335 366 return 0; … … 339 370 int entries, COLORREF *cr ) 340 371 { 372 CR_DDI_PROLOGUE(); 341 373 crWarning( "wglGetLayerPaletteEntries: unsupported" ); 342 374 return 0; … … 345 377 BOOL WINAPI wglRealizeLayerPalette_prox( HDC hdc, int layerPlane, BOOL realize ) 346 378 { 379 CR_DDI_PROLOGUE(); 347 380 crWarning( "wglRealizeLayerPalette: unsupported" ); 348 381 return 0; … … 351 384 DWORD WINAPI wglSwapMultipleBuffers_prox( UINT a, CONST void *b ) 352 385 { 386 CR_DDI_PROLOGUE(); 353 387 crWarning( "wglSwapMultipleBuffer: unsupported" ); 354 388 return 0; … … 359 393 LPGLYPHMETRICSFLOAT gmf ) 360 394 { 395 CR_DDI_PROLOGUE(); 361 396 crWarning( "wglUseFontOutlinesA: unsupported" ); 362 397 return 0; … … 367 402 LPGLYPHMETRICSFLOAT gmf ) 368 403 { 404 CR_DDI_PROLOGUE(); 369 405 crWarning( "wglUseFontOutlinesW: unsupported" ); 370 406 return 0; … … 373 409 BOOL WINAPI wglSwapLayerBuffers_prox( HDC hdc, UINT planes ) 374 410 { 411 CR_DDI_PROLOGUE(); 375 412 if (planes == WGL_SWAP_MAIN_PLANE) 376 413 { … … 389 426 int *pi; 390 427 int wants_rgb = 0; 428 429 CR_DDI_PROLOGUE(); 391 430 392 431 stubInit(); … … 427 466 case WGL_STEREO_EXT: 428 467 if (pi[1] > 0) 429 desiredVisual |= CR_STEREO_BIT; 468 { 469 /* @todo: this is disabled due to VSG Open Inventor interop issues 470 * it does not make any sense actually since reporting this 471 * as well as choosing a pixel format with this cap would not do anything 472 * since ICD stuff has its own pixelformat state var */ 473 crWarning("WGL_STEREO_EXT not supporteed!"); 474 return 0; 475 // desiredVisual |= CR_STEREO_BIT; 476 } 430 477 pi++; 431 478 break; … … 447 494 case WGL_ACCUM_BLUE_BITS_EXT: 448 495 if (pi[1] > 0) 449 desiredVisual |= CR_ACCUM_BIT; 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 } 450 505 pi++; 451 506 break; … … 454 509 case WGL_SAMPLES_EXT: 455 510 if (pi[1] > 0) 456 desiredVisual |= CR_MULTISAMPLE_BIT; 511 { 512 /* @todo: this is disabled due to VSG Open Inventor interop issues 513 * it does not make any sense actually since reporting this 514 * as well as choosing a pixel format with this cap would not do anything 515 * since ICD stuff has its own pixelformat state var */ 516 crWarning("WGL_SAMPLE_BUFFERS_EXT & WGL_SAMPLES_EXT not supporteed!"); 517 return 0; 518 // desiredVisual |= CR_MULTISAMPLE_BIT; 519 } 457 520 pi++; 458 521 break; … … 492 555 { 493 556 UINT i; 557 558 CR_DDI_PROLOGUE(); 494 559 495 560 if (!pValues || !piAttributes) return 0; … … 514 579 case WGL_SUPPORT_OPENGL_ARB: 515 580 case WGL_DOUBLE_BUFFER_ARB: 581 pValues[i] = 1; 582 break; 516 583 case WGL_STEREO_ARB: 517 pValues[i] = 1; 584 /* @todo: this is disabled due to VSG Open Inventor interop issues 585 * it does not make any sense actually since reporting this 586 * as well as choosing a pixel format with this cap would not do anything 587 * since ICD stuff has its own pixelformat state var */ 588 pValues[i] = 0; 518 589 break; 519 590 case WGL_DRAW_TO_BITMAP_ARB: … … 590 661 break; 591 662 case WGL_SAMPLE_BUFFERS_EXT: 592 pValues[i] = 1; 663 /* @todo: this is disabled due to VSG Open Inventor interop issues 664 * it does not make any sense actually since reporting this 665 * as well as choosing a pixel format with this cap would not do anything 666 * since ICD stuff has its own pixelformat state var */ 667 pValues[i] = 0; 593 668 break; 594 669 case WGL_SAMPLES_EXT: 595 pValues[i] = 1; 670 /* @todo: this is disabled due to VSG Open Inventor interop issues 671 * it does not make any sense actually since reporting this 672 * as well as choosing a pixel format with this cap would not do anything 673 * since ICD stuff has its own pixelformat state var */ 674 pValues[i] = 0; 675 break; 676 case 0x202d: /* <- WGL_DRAW_TO_PBUFFER_ARB this is to make VSG Open Inventor happy */ 677 pValues[i] = 0; 596 678 break; 597 679 default: … … 608 690 { 609 691 UINT i; 692 693 CR_DDI_PROLOGUE(); 610 694 611 695 if (!pValues || !piAttributes) return 0; … … 630 714 case WGL_SUPPORT_OPENGL_ARB: 631 715 case WGL_DOUBLE_BUFFER_ARB: 716 pValues[i] = 1.f; 717 break; 632 718 case WGL_STEREO_ARB: 633 pValues[i] = 1.f; 719 /* @todo: this is disabled due to VSG Open Inventor interop issues 720 * it does not make any sense actually since reporting this 721 * as well as choosing a pixel format with this cap would not do anything 722 * since ICD stuff has its own pixelformat state var */ 723 pValues[i] = 0.f; 634 724 break; 635 725 case WGL_DRAW_TO_BITMAP_ARB: … … 706 796 break; 707 797 case WGL_SAMPLE_BUFFERS_EXT: 708 pValues[i] = 1.f; 798 /* @todo: this is disabled due to VSG Open Inventor interop issues 799 * it does not make any sense actually since reporting this 800 * as well as choosing a pixel format with this cap would not do anything 801 * since ICD stuff has its own pixelformat state var */ 802 pValues[i] = 0.f; 709 803 break; 710 804 case WGL_SAMPLES_EXT: 711 pValues[i] = 1.f; 805 /* @todo: this is disabled due to VSG Open Inventor interop issues 806 * it does not make any sense actually since reporting this 807 * as well as choosing a pixel format with this cap would not do anything 808 * since ICD stuff has its own pixelformat state var */ 809 pValues[i] = 0.f; 810 break; 811 case 0x202d: /* <- WGL_DRAW_TO_PBUFFER_ARB this is to make VSG Open Inventor happy */ 812 pValues[i] = 0.f; 712 813 break; 713 814 default: … … 722 823 BOOL WINAPI wglSwapIntervalEXT_prox(int interval) 723 824 { 825 CR_DDI_PROLOGUE(); 724 826 return TRUE; 725 827 } … … 727 829 int WINAPI wglGetSwapIntervalEXT_prox() 728 830 { 831 CR_DDI_PROLOGUE(); 729 832 return 1; 730 833 } … … 734 837 const GLubyte * WINAPI wglGetExtensionsStringEXT_prox() 735 838 { 839 CR_DDI_PROLOGUE(); 736 840 return gsz_wgl_extensions; 737 841 } … … 739 843 const GLubyte * WINAPI wglGetExtensionsStringARB_prox(HDC hdc) 740 844 { 845 CR_DDI_PROLOGUE(); 741 846 (void) hdc; 742 847 -
trunk/src/VBox/Additions/common/crOpenGL/windows_getprocaddress.py
r32178 r40267 136 136 137 137 if (!crStrcmp( name, "wglSwapIntervalEXT" )) return (CR_PROC) wglSwapIntervalEXT; 138 139 /* this is needed for VSG Open Inventor stuff. 140 * @todo: make all these auto-generated!!! */ 141 if (!crStrcmp( name, "glBeginQuery" )) return (CR_PROC) cr_glBeginQueryARB; 142 if (!crStrcmp( name, "glDeleteQueries" )) return (CR_PROC) cr_glDeleteQueriesARB; 143 if (!crStrcmp( name, "glEndQuery" )) return (CR_PROC) cr_glEndQueryARB; 144 if (!crStrcmp( name, "glGenQueries" )) return (CR_PROC) cr_glGenQueriesARB; 145 if (!crStrcmp( name, "glGetQueryObjectiv" )) return (CR_PROC) cr_glGetQueryObjectivARB; 146 if (!crStrcmp( name, "glGetQueryObjectuiv" )) return (CR_PROC) cr_glGetQueryObjectuivARB; 147 if (!crStrcmp( name, "glGetQueryiv" )) return (CR_PROC) cr_glGetQueryivARB; 148 if (!crStrcmp( name, "glIsQuery" )) return (CR_PROC) cr_glIsQueryARB; 138 149 139 cr Debug("Returning GetProcAddress:NULL for %s", name);150 crWarning("Returning GetProcAddress:NULL for %s", name); 140 151 return NULL; 141 152 }
Note:
See TracChangeset
for help on using the changeset viewer.