VirtualBox

Changeset 59198 in vbox for trunk


Ignore:
Timestamp:
Dec 21, 2015 2:18:24 PM (9 years ago)
Author:
vboxsync
Message:

SharedOpenGL: bugref:6538: require OpenGL 2.1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/SharedOpenGL/crserverlib/server_config.c

    r54905 r59198  
    5959
    6060/* Check if host reports minimal OpenGL capabilities.
     61 *
     62 * Require OpenGL 2.1 or later.
     63 *
    6164 * For example, on Windows host this may happen if host has no graphics
    6265 * card drivers installed or drivers were not properly signed or VBox
     
    6770static bool crServerHasInsufficientCaps()
    6871{
    69     const char *sRealRender;
    70     const char *sRealVersion;
     72    const char *pszRealVersion;
     73    int rc;
     74    uint32_t u32VerMajor = 0;
     75    uint32_t u32VerMinor = 0;
     76    char *pszNext = NULL;
    7177
    7278    if (!cr_server.head_spu)
    7379        return true;
    7480
    75     sRealRender  = (const char *)cr_server.head_spu->dispatch_table.GetString(GL_REAL_RENDERER);
    76     sRealVersion = (const char *)cr_server.head_spu->dispatch_table.GetString(GL_REAL_VERSION);
    77 
    78     if (sRealRender && RTStrCmp(sRealRender, "GDI Generic") == 0)
    79         if (sRealVersion && RTStrCmp(sRealVersion, "1.1.0") == 0)
    80             return true;
    81     return false;
     81    pszRealVersion = (const char *)cr_server.head_spu->dispatch_table.GetString(GL_REAL_VERSION);
     82    if (!pszRealVersion)
     83        return true; /* No version == insufficient. */
     84
     85    rc = RTStrToUInt32Ex(pszRealVersion, &pszNext, 10, &u32VerMajor);
     86    if (   RT_SUCCESS(rc)
     87        && *pszNext == '.')
     88            RTStrToUInt32Ex(pszNext + 1, NULL, 10, &u32VerMinor);
     89
     90    crInfo("Host supports version %d.%d [%s]", u32VerMajor, u32VerMinor, pszRealVersion);
     91
     92    if (   u32VerMajor > 2
     93        || (u32VerMajor == 2 && u32VerMinor >= 1))
     94        return false; /* >= 2.1, i.e. good enough. */
     95
     96    return true; /* Insufficient. */
    8297}
    8398
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