third_party/virtualbox/src/VBox/Devices/Graphics/DevVGA-SVGA3d-ogl.cpp
/**
 * Checks if the given OpenGL extension is supported.
 *
 * @returns true if supported, false if not.
 * @param   pState              The VMSVGA3d state.
 * @param   rsMinGLVersion      The OpenGL version that introduced this feature
 *                              into the core.
 * @param   pszWantedExtension  The name of the OpenGL extension we want padded
 *                              with one space at each end.
 * @remarks Init time only.
 */
Checks if the given OpenGL extension is supported.
@returns true if supported, false if not.
@param   pState              The VMSVGA3d state.
@param   rsMinGLVersion      The OpenGL version that introduced this feature
into the core.
@param   pszWantedExtension  The name of the OpenGL extension we want padded
with one space at each end.
@remarks Init time only.
Checks if the given OpenGL extension is supported . @returns true if supported false if not . @param pState The VMSVGA3d state . @param rsMinGLVersion The OpenGL version that introduced this feature into the core . @param pszWantedExtension The name of the OpenGL extension we want padded with one space at each end . @remarks Init time only .
static bool vmsvga3dCheckGLExtension(PVMSVGA3DSTATE pState, float rsMinGLVersion, const char *pszWantedExtension)
{
    RT_NOREF(rsMinGLVersion);
    Assert(pszWantedExtension[0] == ' ');
    Assert(pszWantedExtension[1] != ' ');
    Assert(strchr(&pszWantedExtension[1], ' ') + 1 == strchr(pszWantedExtension, '\0'));
    bool fRet = false;
    if (strstr(pState->pszExtensions, pszWantedExtension))
        fRet = true;
#ifdef RT_OS_DARWIN
    AssertMsg(   rsMinGLVersion == 0.0
              || fRet == (pState->rsGLVersion >= rsMinGLVersion)
              || VBOX_VMSVGA3D_DEFAULT_OGL_PROFILE == 2.1,
              ("%s actual:%d min:%d fRet=%d\n",
               pszWantedExtension, (int)(pState->rsGLVersion * 10), (int)(rsMinGLVersion * 10), fRet));
#else
    AssertMsg(rsMinGLVersion == 0.0 || fRet == (pState->rsGLVersion >= rsMinGLVersion),
              ("%s actual:%d min:%d fRet=%d\n",
               pszWantedExtension, (int)(pState->rsGLVersion * 10), (int)(rsMinGLVersion * 10), fRet));
#endif
    return fRet;
}
static bool vmsvga3dCheckGLExtension ( PVMSVGA3DSTATE pState , float rsMinGLVersion , const char * pszWantedExtension ) { RT_NOREF ( rsMinGLVersion ) ; Assert ( pszWantedExtension [ 0 ] == ' ' ) ; Assert ( pszWantedExtension [ 1 ] != ' ' ) ; Assert ( strchr ( & pszWantedExtension [ 1 ] , ' ' ) + 1 == strchr ( pszWantedExtension , ' \0 ' ) ) ; bool fRet = false ; if ( strstr ( pState -> pszExtensions , pszWantedExtension ) ) fRet = true ; #ifdef RT_OS_DARWIN AssertMsg ( rsMinGLVersion == 0.0 || fRet == ( pState -> rsGLVersion >= rsMinGLVersion ) || VBOX_VMSVGA3D_DEFAULT_OGL_PROFILE == 2.1 , ( " \n " , pszWantedExtension , ( int ) ( pState -> rsGLVersion * 10 ) , ( int ) ( rsMinGLVersion * 10 ) , fRet ) ) ; #else AssertMsg ( rsMinGLVersion == 0.0 || fRet == ( pState -> rsGLVersion >= rsMinGLVersion ) , ( " \n " , pszWantedExtension , ( int ) ( pState -> rsGLVersion * 10 ) , ( int ) ( rsMinGLVersion * 10 ) , fRet ) ) ; #endif return fRet ; }
Checks if the given OpenGL extension is supported.
Checks if the given OpenGL extension is supported .
/* check padding. */ /* Look it up. */ /* Temporarily.  Later start if (rsMinGLVersion != 0.0 && fActualGLVersion >= rsMinGLVersion) return true; */