Changeset 57136 in vbox for trunk/src/VBox/Devices/Graphics
- Timestamp:
- Jul 30, 2015 7:56:59 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp
r57135 r57136 189 189 #ifdef RT_OS_WINDOWS 190 190 # 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) 198 200 199 201 #elif defined(RT_OS_DARWIN) 200 202 # 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) 207 211 #else 208 212 # 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) 218 224 #endif 219 225 … … 4739 4745 * Worker for vmsvga3dChangeMode that resizes a context. 4740 4746 * 4741 * @param pThis The VMSVGA state. 4747 * @param pThis The VGA device instance data. 4748 * @param pState The VMSVGA3d state. 4742 4749 * @param pContext The context. 4743 4750 */ 4744 static void vmsvga3dChangeModeOneContext(PVGASTATE pThis, PVMSVGA3D CONTEXT pContext)4751 static void vmsvga3dChangeModeOneContext(PVGASTATE pThis, PVMSVGA3DSTATE pState, PVMSVGA3DCONTEXT pContext) 4745 4752 { 4746 4753 #ifdef RT_OS_WINDOWS 4754 /* Resize the window. */ 4747 4755 CREATESTRUCT cs; 4748 4749 memset(&cs, 0, sizeof(cs)); 4756 RT_ZERO(cs); 4750 4757 cs.cx = pThis->svga.uWidth; 4751 4758 cs.cy = pThis->svga.uHeight; 4752 4753 /* Resize the window. */4754 4759 int rc = vmsvga3dSendThreadMessage(pState->pWindowThread, pState->WndRequestSem, WM_VMSVGA3D_RESIZEWINDOW, (WPARAM)pContext->hwnd, (LPARAM)&cs); 4755 4760 AssertRC(rc); 4761 4756 4762 #elif defined(RT_OS_DARWIN) 4757 4763 vmsvga3dCocoaViewSetSize(pContext->cocoaView, pThis->svga.uWidth, pThis->svga.uHeight); 4764 4758 4765 #elif defined(RT_OS_LINUX) 4759 4766 XWindowChanges wc; … … 4773 4780 /* Resize the shared context too. */ 4774 4781 if (pState->SharedCtx.id == VMSVGA3D_SHARED_CTX_ID) 4775 vmsvga3dChangeModeOneContext(pThis, &pState->SharedCtx);4782 vmsvga3dChangeModeOneContext(pThis, pState, &pState->SharedCtx); 4776 4783 #endif 4777 4784 … … 4781 4788 PVMSVGA3DCONTEXT pContext = pState->papContexts[i]; 4782 4789 if (pContext->id != SVGA3D_INVALID_ID) 4783 vmsvga3dChangeModeOneContext(pThis, p Context);4790 vmsvga3dChangeModeOneContext(pThis, pState, pContext); 4784 4791 } 4785 4792
Note:
See TracChangeset
for help on using the changeset viewer.