VirtualBox

Changeset 23384 in vbox for trunk/src/VBox/Main/darwin


Ignore:
Timestamp:
Sep 28, 2009 2:11:08 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
52911
Message:

crOpenGL-OSX: check for the necessary OpenGL extensions on OSX

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/darwin/OpenGLTestDarwin.cpp

    r20512 r23384  
    2525#include <ApplicationServices/ApplicationServices.h>
    2626#include <OpenGL/gl.h>
     27#ifdef VBOX_WITH_COCOA_QT
     28# include <OpenGL/glu.h>
     29# include <iprt/log.h>
     30#endif /* VBOX_WITH_COCOA_QT */
    2731
    2832bool is3DAccelerationSupported()
     
    5357        if (cglContext)
    5458        {
     59            GLboolean isSupported = GL_TRUE;
     60#ifdef VBOX_WITH_COCOA_QT
     61            /* On the Cocoa port we depend on the GL_EXT_framebuffer_object &
     62             * the GL_EXT_texture_rectangle extension. If they are not
     63             * available, disable 3D support. */
     64            CGLSetCurrentContext(cglContext);
     65            const GLubyte* strExt;
     66            strExt = glGetString(GL_EXTENSIONS);
     67            isSupported = gluCheckExtension((const GLubyte*)"GL_EXT_framebuffer_object", strExt);
     68            if (isSupported)
     69            {
     70                isSupported = gluCheckExtension((const GLubyte*)"GL_EXT_texture_rectangle", strExt);
     71                if (!isSupported)
     72                    LogRel(("OpenGL Info: GL_EXT_texture_rectangle extension not supported\n"));
     73            }
     74            else
     75                LogRel(("OpenGL Info: GL_EXT_framebuffer_object extension not supported\n"));
     76#endif /* VBOX_WITH_COCOA_QT */
    5577            CGLDestroyContext(cglContext);
    56             return true;
     78            return isSupported == GL_TRUE ? true : false;
    5779        }
    5880    }
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette