VirtualBox

Changeset 57136 in vbox for trunk/src/VBox/Devices/Graphics


Ignore:
Timestamp:
Jul 30, 2015 7:56:59 PM (9 years ago)
Author:
vboxsync
Message:

DevVGA-SVGA3d-ogl.cpp: X11 build fix and warning fix.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp

    r57135 r57136  
    189189#ifdef RT_OS_WINDOWS
    190190# define VMSVGA3D_SET_CURRENT_CONTEXT(pState, pContext) \
    191     if ((pState)->idActiveContext != (pContext)->id) \
    192     { \
    193         BOOL fMakeCurrentRc = wglMakeCurrent((pContext)->hdc, (pContext)->hglrc); \
    194         Assert(fMakeCurrentRc == TRUE); \
    195         LogFlowFunc(("Changing context: %#x -> %#x\n", (pState)->idActiveContext, (pContext)->id)); \
    196         (pState)->idActiveContext = (pContext)->id; \
    197     } else do { } while (0)
     191    do {  \
     192        if ((pState)->idActiveContext != (pContext)->id) \
     193        { \
     194            BOOL fMakeCurrentRc = wglMakeCurrent((pContext)->hdc, (pContext)->hglrc); \
     195            Assert(fMakeCurrentRc == TRUE); \
     196            LogFlowFunc(("Changing context: %#x -> %#x\n", (pState)->idActiveContext, (pContext)->id)); \
     197            (pState)->idActiveContext = (pContext)->id; \
     198        } \
     199    } while (0)
    198200
    199201#elif defined(RT_OS_DARWIN)
    200202# define VMSVGA3D_SET_CURRENT_CONTEXT(pState, pContext) \
    201     if ((pState)->idActiveContext != (pContext)->id) \
    202     { \
    203         vmsvga3dCocoaViewMakeCurrentContext((pContext)->cocoaView, (pContext)->cocoaContext); \
    204         LogFlowFunc(("Changing context: %#x -> %#x\n", (pState)->idActiveContext, (pContext)->id)); \
    205         (pState)->idActiveContext = (pContext)->id; \
    206     } else do { } while (0)
     203    do {  \
     204        if ((pState)->idActiveContext != (pContext)->id) \
     205        { \
     206            vmsvga3dCocoaViewMakeCurrentContext((pContext)->cocoaView, (pContext)->cocoaContext); \
     207            LogFlowFunc(("Changing context: %#x -> %#x\n", (pState)->idActiveContext, (pContext)->id)); \
     208            (pState)->idActiveContext = (pContext)->id; \
     209        } \
     210    } while (0)
    207211#else
    208212# define VMSVGA3D_SET_CURRENT_CONTEXT(pState, pContext) \
    209     if ((pState)->idActiveContext != (pContext)->id) \
    210     { \
    211         Bool fMakeCurrentRc = glXMakeCurrent((pState)->display, \
    212                                              (pContext)->window, \
    213                                              (pContext)->glxContext); \
    214         Assert(fMakeCurrentRc == True); \
    215         LogFlowFunc(("Changing context: %#x -> %#x\n", (pState)->idActiveContext, (pContext)->id)); \
    216         (pState)->idActiveContext = (pContext)->id; \
    217     } else do { } while (0)
     213    do {  \
     214        if ((pState)->idActiveContext != (pContext)->id) \
     215        { \
     216            Bool fMakeCurrentRc = glXMakeCurrent((pState)->display, \
     217                                                 (pContext)->window, \
     218                                                 (pContext)->glxContext); \
     219            Assert(fMakeCurrentRc == True); \
     220            LogFlowFunc(("Changing context: %#x -> %#x\n", (pState)->idActiveContext, (pContext)->id)); \
     221            (pState)->idActiveContext = (pContext)->id; \
     222        }
     223    } while (0)
    218224#endif
    219225
     
    47394745 * Worker for vmsvga3dChangeMode that resizes a context.
    47404746 *
    4741  * @param   pThis               The VMSVGA state.
     4747 * @param   pThis               The VGA device instance data.
     4748 * @param   pState              The VMSVGA3d state.
    47424749 * @param   pContext            The context.
    47434750 */
    4744 static void vmsvga3dChangeModeOneContext(PVGASTATE pThis, PVMSVGA3DCONTEXT pContext)
     4751static void vmsvga3dChangeModeOneContext(PVGASTATE pThis, PVMSVGA3DSTATE pState, PVMSVGA3DCONTEXT pContext)
    47454752{
    47464753#ifdef RT_OS_WINDOWS
     4754    /* Resize the window. */
    47474755    CREATESTRUCT          cs;
    4748 
    4749     memset(&cs, 0, sizeof(cs));
     4756    RT_ZERO(cs);
    47504757    cs.cx = pThis->svga.uWidth;
    47514758    cs.cy = pThis->svga.uHeight;
    4752 
    4753     /* Resize the window. */
    47544759    int rc = vmsvga3dSendThreadMessage(pState->pWindowThread, pState->WndRequestSem, WM_VMSVGA3D_RESIZEWINDOW, (WPARAM)pContext->hwnd, (LPARAM)&cs);
    47554760    AssertRC(rc);
     4761
    47564762#elif defined(RT_OS_DARWIN)
    47574763    vmsvga3dCocoaViewSetSize(pContext->cocoaView, pThis->svga.uWidth, pThis->svga.uHeight);
     4764
    47584765#elif defined(RT_OS_LINUX)
    47594766    XWindowChanges wc;
     
    47734780    /* Resize the shared context too. */
    47744781    if (pState->SharedCtx.id == VMSVGA3D_SHARED_CTX_ID)
    4775         vmsvga3dChangeModeOneContext(pThis, &pState->SharedCtx);
     4782        vmsvga3dChangeModeOneContext(pThis, pState, &pState->SharedCtx);
    47764783#endif
    47774784
     
    47814788        PVMSVGA3DCONTEXT pContext = pState->papContexts[i];
    47824789        if (pContext->id != SVGA3D_INVALID_ID)
    4783             vmsvga3dChangeModeOneContext(pThis, pContext);
     4790            vmsvga3dChangeModeOneContext(pThis, pState, pContext);
    47844791    }
    47854792
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