VirtualBox

Ignore:
Timestamp:
May 3, 2019 9:51:02 PM (6 years ago)
Author:
vboxsync
Message:

Additions/common/crOpengl,GuestHost/OpenGL,HostServices/SharedOpenGL: Eliminate all global variables from the state tracker library (state_tracker) in preparation of the SPU DLL merging, bugref:9435

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_context.cpp

    r78263 r78375  
    6363            return -1;
    6464        }
    65         cr_server.MainContextInfo.pContext = crStateCreateContext(&cr_server.limits, visualBits, NULL);
     65        cr_server.MainContextInfo.pContext = crStateCreateContext(&cr_server.StateTracker, &cr_server.limits, visualBits, NULL);
    6666        CRASSERT(cr_server.MainContextInfo.pContext);
    6767        cr_server.firstCallCreateContext = GL_FALSE;
     
    114114        if (pContextInfo->SpuContext < 0) {
    115115            crWarning("crServerDispatchCreateContext() failed.");
    116             crStateEnableDiffOnMakeCurrent(GL_TRUE);
     116            crStateEnableDiffOnMakeCurrent(&cr_server.StateTracker, GL_TRUE);
    117117            cr_server.bUseMultipleContexts = GL_FALSE;
    118118            if (!fFirst)
     
    121121        else if (fFirst)
    122122        {
    123             crStateEnableDiffOnMakeCurrent(GL_FALSE);
     123            crStateEnableDiffOnMakeCurrent(&cr_server.StateTracker, GL_FALSE);
    124124        }
    125125    }
     
    132132     * dispatch function pointers.
    133133     */
    134     newCtx = crStateCreateContextEx(&cr_server.limits, visualBits, NULL, internalID);
     134    newCtx = crStateCreateContextEx(&cr_server.StateTracker, &cr_server.limits, visualBits, NULL, internalID);
    135135    if (newCtx) {
    136         crStateSetCurrentPointers( newCtx, &(cr_server.current) );
     136        crStateSetCurrentPointers(newCtx, &(cr_server.current) );
    137137        crStateResetCurrentPointers(&(cr_server.current));
    138138        retVal = preloadCtxID<0 ? (GLint)crHashtableAllocKeys( cr_server.contextTable, 1 ) : preloadCtxID;
     
    214214    crCtxInfo->currentMural = NULL;
    215215    crHashtableDelete(cr_server.contextTable, ctx, NULL);
    216     crStateDestroyContext( crCtx );
     216    crStateDestroyContext(&cr_server.StateTracker, crCtx);
    217217
    218218    if (crCtxInfo->CreateInfo.pszDpyName)
     
    306306     * crStateSwitchPrepare restores the FBO state to its default values before the context window switch,
    307307     * while crStateSwitchPostprocess restores it back to the original values */
    308     oldCtx = crStateGetCurrent();
     308    oldCtx = crStateGetCurrent(&cr_server.StateTracker);
    309309    if (oldMural && oldMural->fRedirected && crServerSupportRedirMuralFBO())
    310310    {
     
    335335
    336336    /* This is a hack to force updating the 'current' attribs */
    337     crStateUpdateColorBits();
     337    crStateUpdateColorBits(&cr_server.StateTracker);
    338338
    339339    if (ctx)
    340         crStateSetCurrentPointers( ctx, &(cr_server.current) );
     340        crStateSetCurrentPointers(ctx, &(cr_server.current) );
    341341
    342342    /* check if being made current for first time, update viewport */
     
    387387
    388388    /* This used to be earlier, after crStateUpdateColorBits() call */
    389     crStateMakeCurrent( ctx );
     389    crStateMakeCurrent(&cr_server.StateTracker, ctx );
    390390
    391391    if (mural && mural->fRedirected  && crServerSupportRedirMuralFBO())
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