third_party/virtualbox/src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp
/**
 * Initializes the VMSVGA3D state during VGA device construction.
 *
 * Failure are generally not fatal, 3D support will just be disabled.
 *
 * @returns VBox status code.
 * @param   pThis   The VGA device state where svga.p3dState will be modified.
 */
Initializes the VMSVGA3D state during VGA device construction.
Failure are generally not fatal, 3D support will just be disabled.

@returns VBox status code.
@param   pThis   The VGA device state where svga.p3dState will be modified.
Initializes the VMSVGA3D state during VGA device construction . Failure are generally not fatal 3D support will just be disabled . @returns VBox status code . @param pThis The VGA device state where svga . p3dState will be modified .
int vmsvga3dInit(PVGASTATE pThis)
{
    AssertCompile(GL_TRUE == 1);
    AssertCompile(GL_FALSE == 0);
    RTERRINFOSTATIC ErrInfo;
    int rc = ExplicitlyLoadVBoxSVGA3D(true , RTErrInfoInitStatic(&ErrInfo));
    if (RT_FAILURE(rc))
    {
        LogRel(("VMSVGA3d: Error loading VBoxSVGA3D and resolving necessary functions: %Rrc - %s\n", rc, ErrInfo.Core.pszMsg));
        return rc;
    }
#ifdef RT_OS_DARWIN
    rc = ExplicitlyLoadVBoxSVGA3DObjC(true , RTErrInfoInitStatic(&ErrInfo));
    if (RT_FAILURE(rc))
    {
        LogRel(("VMSVGA3d: Error loading VBoxSVGA3DObjC and resolving necessary functions: %Rrc - %s\n", rc, ErrInfo.Core.pszMsg));
        return rc;
    }
#endif
    pThis->svga.p3dState = (PVMSVGA3DSTATE)RTMemAllocZ(sizeof(VMSVGA3DSTATE));
    AssertReturn(pThis->svga.p3dState, VERR_NO_MEMORY);
#ifdef RT_OS_WINDOWS
    PVMSVGA3DSTATE pState = pThis->svga.p3dState;
    rc = RTSemEventCreate(&pState->WndRequestSem);
    if (RT_SUCCESS(rc))
    {
        rc = RTThreadCreate(&pState->pWindowThread, vmsvga3dWindowThread, pState->WndRequestSem, 0, RTTHREADTYPE_GUI, 0,
                            "VMSVGA3DWND");
        if (RT_SUCCESS(rc))
            return VINF_SUCCESS;
        LogRel(("VMSVGA3d: RTThreadCreate failed: %Rrc\n", rc));
        RTSemEventDestroy(pState->WndRequestSem);
    }
    else
        LogRel(("VMSVGA3d: RTSemEventCreate failed: %Rrc\n", rc));
    RTMemFree(pThis->svga.p3dState);
    pThis->svga.p3dState = NULL;
    return rc;
#else
    return VINF_SUCCESS;
#endif
}
int vmsvga3dInit ( PVGASTATE pThis ) { AssertCompile ( GL_TRUE == 1 ) ; AssertCompile ( GL_FALSE == 0 ) ; RTERRINFOSTATIC ErrInfo ; int rc = ExplicitlyLoadVBoxSVGA3D ( true , RTErrInfoInitStatic ( & ErrInfo ) ) ; if ( RT_FAILURE ( rc ) ) { LogRel ( ( " \n " , rc , ErrInfo . Core . pszMsg ) ) ; return rc ; } #ifdef RT_OS_DARWIN rc = ExplicitlyLoadVBoxSVGA3DObjC ( true , RTErrInfoInitStatic ( & ErrInfo ) ) ; if ( RT_FAILURE ( rc ) ) { LogRel ( ( " \n " , rc , ErrInfo . Core . pszMsg ) ) ; return rc ; } #endif pThis -> svga . p3dState = ( PVMSVGA3DSTATE ) RTMemAllocZ ( sizeof ( VMSVGA3DSTATE ) ) ; AssertReturn ( pThis -> svga . p3dState , VERR_NO_MEMORY ) ; #ifdef RT_OS_WINDOWS PVMSVGA3DSTATE pState = pThis -> svga . p3dState ; rc = RTSemEventCreate ( & pState -> WndRequestSem ) ; if ( RT_SUCCESS ( rc ) ) { rc = RTThreadCreate ( & pState -> pWindowThread , vmsvga3dWindowThread , pState -> WndRequestSem , 0 , RTTHREADTYPE_GUI , 0 , " " ) ; if ( RT_SUCCESS ( rc ) ) return VINF_SUCCESS ; LogRel ( ( " \n " , rc ) ) ; RTSemEventDestroy ( pState -> WndRequestSem ) ; } else LogRel ( ( " \n " , rc ) ) ; RTMemFree ( pThis -> svga . p3dState ) ; pThis -> svga . p3dState = NULL ; return rc ; #else return VINF_SUCCESS ; #endif }
Initializes the VMSVGA3D state during VGA device construction.
Initializes the VMSVGA3D state during VGA device construction .
/*
     * Load and resolve imports from the external shared libraries.
     */ /*fResolveAllImports*/ /*fResolveAllImports*/ /*
     * Allocate the state.
     */ /* Create event semaphore and async IO thread. */ /* bail out. */