VirtualBox

Changeset 40267 in vbox for trunk/src/VBox/Additions/common


Ignore:
Timestamp:
Feb 28, 2012 7:09:18 AM (13 years ago)
Author:
vboxsync
Message:

crOpenGL: fixe VSG Open Inventor interop issues

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  
    7575void APIENTRY DrvReleaseContext(HGLRC hglrc)
    7676{
     77     CR_DDI_PROLOGUE();
    7778    /*crDebug( "DrvReleaseContext(0x%x) called", hglrc );*/
    7879    stubMakeCurrent( NULL, NULL );
     
    8182BOOL APIENTRY DrvValidateVersion(DWORD version)
    8283{
     84    CR_DDI_PROLOGUE();
    8385    if (stubInit()) {
    8486        crDebug("DrvValidateVersion %x -> TRUE\n", version);
     
    9799    BOOL ret;
    98100
     101    CR_DDI_PROLOGUE();
     102
    99103    /*crDebug( "DrvSetContext called(0x%x, 0x%x)", hdc, hglrc );*/
    100104    (void) (callback);
     
    116120BOOL APIENTRY DrvSetPixelFormat(HDC hdc, int iPixelFormat)
    117121{
     122    CR_DDI_PROLOGUE();
    118123    crDebug( "DrvSetPixelFormat(0x%x, %i) called.", hdc, iPixelFormat );
    119124
     
    129134    char dpyName[MAX_DPY_NAME];
    130135    ContextInfo *context;
     136
     137    CR_DDI_PROLOGUE();
    131138
    132139    crDebug( "DrvCreateContext(0x%x) called.", hdc);
     
    149156HGLRC APIENTRY DrvCreateLayerContext(HDC hdc, int iLayerPlane)
    150157{
     158    CR_DDI_PROLOGUE();
    151159    crDebug( "DrvCreateLayerContext(0x%x, %i) called.", hdc, iLayerPlane);
    152160    //We don't support more than 1 layers.
     
    164172                                    LPLAYERPLANEDESCRIPTOR plpd)
    165173{
     174    CR_DDI_PROLOGUE();
    166175    crWarning( "DrvDescribeLayerPlane: unimplemented" );
    167176    CRASSERT(false);
     
    173182                                       COLORREF *pcr)
    174183{
     184    CR_DDI_PROLOGUE();
    175185    crWarning( "DrvGetLayerPaletteEntries: unsupported" );
    176186    CRASSERT(false);
     
    180190int APIENTRY DrvDescribePixelFormat(HDC hdc, int iPixelFormat, UINT nBytes, LPPIXELFORMATDESCRIPTOR pfd)
    181191{
     192    CR_DDI_PROLOGUE();
    182193    if ( !pfd ) {
    183194        return 2;
     
    198209                                PFD_SUPPORT_OPENGL |
    199210                                PFD_DOUBLEBUFFER);
     211
     212        pfd->dwFlags         |= 0x8000; /* <- Needed for VSG Open Inventor to be happy */
     213
    200214        pfd->iPixelType      = PFD_TYPE_RGBA;
    201215        pfd->cColorBits      = 32;
     
    260274BOOL APIENTRY DrvDeleteContext(HGLRC hglrc)
    261275{
     276    CR_DDI_PROLOGUE();
    262277    /*crDebug( "DrvDeleteContext(0x%x) called", hglrc );*/
    263278    stubDestroyContext( (unsigned long) hglrc );
     
    267282BOOL APIENTRY DrvCopyContext(HGLRC hglrcSrc, HGLRC hglrcDst, UINT mask)
    268283{
     284    CR_DDI_PROLOGUE();
    269285    crWarning( "DrvCopyContext: unsupported" );
    270286    return 0;
     
    273289BOOL APIENTRY DrvShareLists(HGLRC hglrc1, HGLRC hglrc2)
    274290{
     291    CR_DDI_PROLOGUE();
    275292    crWarning( "DrvShareLists: unsupported" );
    276293    return 1;
     
    281298                                       CONST COLORREF *pcr)
    282299{
     300    CR_DDI_PROLOGUE();
    283301    crWarning( "DrvSetLayerPaletteEntries: unsupported" );
    284302    return 0;
     
    288306BOOL APIENTRY DrvRealizeLayerPalette(HDC hdc, int iLayerPlane, BOOL bRealize)
    289307{
     308    CR_DDI_PROLOGUE();
    290309    crWarning( "DrvRealizeLayerPalette: unsupported" );
    291310    return 0;
     
    294313BOOL APIENTRY DrvSwapLayerBuffers(HDC hdc, UINT fuPlanes)
    295314{
     315    CR_DDI_PROLOGUE();
    296316    if (fuPlanes == 1)
    297317    {
     
    309329{
    310330    WindowInfo *window;
     331
     332    CR_DDI_PROLOGUE();
    311333    /*crDebug( "DrvSwapBuffers(0x%x) called", hdc );*/
    312334    window = stubGetWindowInfo(hdc);   
  • trunk/src/VBox/Additions/common/crOpenGL/wgl.c

    r39568 r40267  
    5656    DWORD okayFlags;
    5757
     58    CR_DDI_PROLOGUE();
     59
    5860    stubInit();
    5961
     
    7880            PFD_SWAP_EXCHANGE         |
    7981            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            |
    8187            PFD_STEREO_DONTCARE       |
    8288            PFD_DEPTH_DONTCARE        );
     
    115121    }
    116122
    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;
    119129
    120130    if ( pfd->cDepthBits > 32 ) {
     
    146156        CONST PIXELFORMATDESCRIPTOR *pdf )
    147157{
     158    CR_DDI_PROLOGUE();
     159
    148160    if ( pixelFormat != 1 ) {
    149161        crError( "wglSetPixelFormat: pixelFormat=%d?\n", pixelFormat );
     
    155167BOOL WINAPI wglDeleteContext_prox( HGLRC hglrc )
    156168{
     169    CR_DDI_PROLOGUE();
    157170    stubDestroyContext( (unsigned long) hglrc );
    158171    return 1;
     
    165178    BOOL ret;
    166179
     180    CR_DDI_PROLOGUE();
     181
    167182    crHashtableLock(stub.windowTable);
    168183    crHashtableLock(stub.contextTable);
     
    187202{
    188203    ContextInfo *context = stubGetCurrentContext();
     204    CR_DDI_PROLOGUE();
    189205    return (HGLRC) (context ? context->id : 0);
    190206}
     
    193209{
    194210    ContextInfo *context = stubGetCurrentContext();
     211    CR_DDI_PROLOGUE();
    195212    if (context && context->currentDrawable)
    196213        return (HDC) context->currentDrawable->drawable;
     
    201218int WINAPI wglGetPixelFormat_prox( HDC hdc )
    202219{
     220    CR_DDI_PROLOGUE();
    203221    /* this is what we call our generic pixelformat, regardless of the HDC */
    204222    return 1;
     
    208226        LPPIXELFORMATDESCRIPTOR pfd )
    209227{
     228    CR_DDI_PROLOGUE();
     229
    210230/*  if ( pixelFormat != 1 ) {
    211231 *      crError( "wglDescribePixelFormat: pixelFormat=%d?\n", pixelFormat );
     
    259279BOOL WINAPI wglShareLists_prox( HGLRC hglrc1, HGLRC hglrc2 )
    260280{
     281    CR_DDI_PROLOGUE();
    261282    crWarning( "wglShareLists: unsupported" );
    262283    return 0;
     
    268289    char dpyName[MAX_DPY_NAME];
    269290    ContextInfo *context;
     291
     292    CR_DDI_PROLOGUE();
    270293
    271294    stubInit();
     
    288311{
    289312    WindowInfo *window = stubGetWindowInfo(hdc);
     313    CR_DDI_PROLOGUE();
    290314    stubSwapBuffers( window, 0 );
    291315    return 1;
     
    294318BOOL WINAPI wglCopyContext_prox( HGLRC src, HGLRC dst, UINT mask )
    295319{
     320    CR_DDI_PROLOGUE();
    296321    crWarning( "wglCopyContext: unsupported" );
    297322    return 0;
     
    300325HGLRC WINAPI wglCreateLayerContext_prox( HDC hdc, int layerPlane )
    301326{
     327    CR_DDI_PROLOGUE();
    302328    stubInit();
    303329    crWarning( "wglCreateLayerContext: unsupported" );
     
    307333PROC WINAPI wglGetProcAddress_prox( LPCSTR name )
    308334{
     335    CR_DDI_PROLOGUE();
    309336    return (PROC) crGetProcAddress( name );
    310337}
     
    312339BOOL WINAPI wglUseFontBitmapsA_prox( HDC hdc, DWORD first, DWORD count, DWORD listBase )
    313340{
     341    CR_DDI_PROLOGUE();
    314342    crWarning( "wglUseFontBitmapsA: unsupported" );
    315343    return 0;
     
    318346BOOL WINAPI wglUseFontBitmapsW_prox( HDC hdc, DWORD first, DWORD count, DWORD listBase )
    319347{
     348    CR_DDI_PROLOGUE();
    320349    crWarning( "wglUseFontBitmapsW: unsupported" );
    321350    return 0;
     
    325354        UINT nBytes, LPLAYERPLANEDESCRIPTOR lpd )
    326355{
     356    CR_DDI_PROLOGUE();
    327357    crWarning( "wglDescribeLayerPlane: unimplemented" );
    328358    return 0;
     
    332362        int entries, CONST COLORREF *cr )
    333363{
     364    CR_DDI_PROLOGUE();
    334365    crWarning( "wglSetLayerPaletteEntries: unsupported" );
    335366    return 0;
     
    339370        int entries, COLORREF *cr )
    340371{
     372    CR_DDI_PROLOGUE();
    341373    crWarning( "wglGetLayerPaletteEntries: unsupported" );
    342374    return 0;
     
    345377BOOL WINAPI wglRealizeLayerPalette_prox( HDC hdc, int layerPlane, BOOL realize )
    346378{
     379    CR_DDI_PROLOGUE();
    347380    crWarning( "wglRealizeLayerPalette: unsupported" );
    348381    return 0;
     
    351384DWORD WINAPI wglSwapMultipleBuffers_prox( UINT a, CONST void *b )
    352385{
     386    CR_DDI_PROLOGUE();
    353387    crWarning( "wglSwapMultipleBuffer: unsupported" );
    354388    return 0;
     
    359393        LPGLYPHMETRICSFLOAT gmf )
    360394{
     395    CR_DDI_PROLOGUE();
    361396    crWarning( "wglUseFontOutlinesA: unsupported" );
    362397    return 0;
     
    367402        LPGLYPHMETRICSFLOAT gmf )
    368403{
     404    CR_DDI_PROLOGUE();
    369405    crWarning( "wglUseFontOutlinesW: unsupported" );
    370406    return 0;
     
    373409BOOL WINAPI wglSwapLayerBuffers_prox( HDC hdc, UINT planes )
    374410{
     411    CR_DDI_PROLOGUE();
    375412    if (planes == WGL_SWAP_MAIN_PLANE)
    376413    {
     
    389426    int *pi;
    390427    int wants_rgb = 0;
     428
     429    CR_DDI_PROLOGUE();
    391430
    392431    stubInit();
     
    427466            case WGL_STEREO_EXT:
    428467                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                }
    430477                pi++;
    431478                break;
     
    447494            case WGL_ACCUM_BLUE_BITS_EXT:
    448495                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                }
    450505                pi++;
    451506                break;
     
    454509            case WGL_SAMPLES_EXT:
    455510                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                }
    457520                pi++;
    458521                break;
     
    492555{
    493556    UINT i;
     557
     558    CR_DDI_PROLOGUE();
    494559
    495560    if (!pValues || !piAttributes) return 0;
     
    514579            case WGL_SUPPORT_OPENGL_ARB:
    515580            case WGL_DOUBLE_BUFFER_ARB:
     581                pValues[i] = 1;
     582                break;
    516583            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;
    518589                break;
    519590            case WGL_DRAW_TO_BITMAP_ARB:
     
    590661                break;
    591662            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;
    593668                break;
    594669            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;
    596678                break;
    597679            default:
     
    608690{
    609691    UINT i;
     692
     693    CR_DDI_PROLOGUE();
    610694
    611695    if (!pValues || !piAttributes) return 0;
     
    630714            case WGL_SUPPORT_OPENGL_ARB:
    631715            case WGL_DOUBLE_BUFFER_ARB:
     716                pValues[i] = 1.f;
     717                break;
    632718            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;
    634724                break;
    635725            case WGL_DRAW_TO_BITMAP_ARB:
     
    706796                break;
    707797            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;
    709803                break;
    710804            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;
    712813                break;
    713814            default:
     
    722823BOOL WINAPI wglSwapIntervalEXT_prox(int interval)
    723824{
     825    CR_DDI_PROLOGUE();
    724826    return TRUE;
    725827}
     
    727829int  WINAPI wglGetSwapIntervalEXT_prox()
    728830{
     831    CR_DDI_PROLOGUE();
    729832    return 1;
    730833}
     
    734837const GLubyte * WINAPI wglGetExtensionsStringEXT_prox()
    735838{
     839    CR_DDI_PROLOGUE();
    736840    return gsz_wgl_extensions;
    737841}
     
    739843const GLubyte * WINAPI wglGetExtensionsStringARB_prox(HDC hdc)
    740844{
     845    CR_DDI_PROLOGUE();
    741846    (void) hdc;
    742847
  • trunk/src/VBox/Additions/common/crOpenGL/windows_getprocaddress.py

    r32178 r40267  
    136136
    137137    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;
    138149
    139     crDebug("Returning GetProcAddress:NULL for %s", name);
     150    crWarning("Returning GetProcAddress:NULL for %s", name);
    140151    return NULL;
    141152}
Note: See TracChangeset for help on using the changeset viewer.

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