VirtualBox

Changeset 53546 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Dec 16, 2014 11:54:40 AM (10 years ago)
Author:
vboxsync
Message:

Mac OS X host: make 3D test more informative when it determines that host 3D capabilities not sufficient.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostServices/SharedOpenGL/OpenGLTest/OpenGLTestDarwin.cpp

    r52626 r53546  
    122122    CGLPixelFormatObj   pixelFormat = NULL;
    123123    GLint numPixelFormats = 0;
     124    CGLError            rcCgl;
    124125
    125126    CGLPixelFormatAttribute attribs[] = {
     
    135136    display = CGMainDisplayID();
    136137    cglDisplayMask = CGDisplayIDToOpenGLDisplayMask(display);
    137     CGLChoosePixelFormat(attribs, &pixelFormat, &numPixelFormats);
     138    rcCgl = CGLChoosePixelFormat(attribs, &pixelFormat, &numPixelFormats);
     139    if (rcCgl != kCGLNoError)
     140    {
     141        LogRel(("OpenGL Info: 3D test unable to choose pixel format (rcCgl=0x%X)\n", rcCgl));
     142        return false;
     143    }
    138144
    139145    if (pixelFormat)
    140146    {
    141147        CGLContextObj cglContext = 0;
    142         CGLCreateContext(pixelFormat, NULL, &cglContext);
     148        rcCgl = CGLCreateContext(pixelFormat, NULL, &cglContext);
    143149        CGLDestroyPixelFormat(pixelFormat);
     150
     151        if (rcCgl != kCGLNoError)
     152        {
     153            LogRel(("OpenGL Info: 3D test unable to create context (rcCgl=0x%X)\n", rcCgl));
     154            return false;
     155        }
     156
    144157        if (cglContext)
    145158        {
     
    157170                isSupported = gluCheckExtension((const GLubyte*)"GL_EXT_texture_rectangle", strExt);
    158171                if (!isSupported)
    159                     LogRel(("OpenGL Info: GL_EXT_texture_rectangle extension not supported\n"));
     172                    LogRel(("OpenGL Info: 3D test found that GL_EXT_texture_rectangle extension not supported\n"));
    160173            }
    161174            else
    162                 LogRel(("OpenGL Info: GL_EXT_framebuffer_object extension not supported\n"));
     175                LogRel(("OpenGL Info: 3D test found that GL_EXT_framebuffer_object extension not supported\n"));
    163176#endif /* VBOX_WITH_COCOA_QT */
    164177            CGLDestroyContext(cglContext);
     178            LogRel(("OpenGL Info: 3D test %spassed\n", isSupported == GL_TRUE ? "" : "not "));
    165179            return isSupported == GL_TRUE ? true : false;
    166180        }
     181        else
     182            LogRel(("OpenGL Info: 3D test unable to create context (internal error)\n"));
    167183    }
     184    else
     185        LogRel(("OpenGL Info: 3D test unable to choose pixel format (internal error)\n"));
    168186
    169187    return false;
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