[vbox-dev] Adding GLX_ARB_get_proc_address extension for VirtualBox

Feng, Haitao haitao.feng at intel.com
Fri Aug 27 02:55:46 GMT 2010


Hi,

Recently I am working on running MeeGo Handset UX inside VirtualBox with 3D
acceleration. With 3D acceleration on, Qt applications such as qtdemo and
mcompositor (window manager) could not start inside VirtualBox. After some 
digging, I have found out that "GLX_ARB_get_proc_address" extension is missing.
After adding it, qtdemo and mcompositor runs well inside VirtualBox.

Here is the Qt logic, in Qt src/opengl/qgl_x11.cpp/QGLContext::getProcAddress,

"
    if (!glXGetProcAddressARB) {
        QGLExtensionMatcher extensions(glXGetClientString(QX11Info::display(),
GLX_EXTENSIONS));
        if (extensions.match("GLX_ARB_get_proc_address")) {
#if defined(Q_OS_LINUX) || defined(Q_OS_BSD4)
            void *handle = dlopen(NULL, RTLD_LAZY);
            if (handle) {
                glXGetProcAddressARB = (qt_glXGetProcAddressARB) dlsym(handle,
"glXGetProcAddressARB");
                dlclose(handle);
            }
            if (!glXGetProcAddressARB)
#endif
            {
#if !defined(QT_NO_LIBRARY)
                extern const QString qt_gl_library_name();
                QLibrary lib(qt_gl_library_name());
                glXGetProcAddressARB = (qt_glXGetProcAddressARB)
lib.resolve("glXGetProcAddressARB");
#endif
            }
        }
        resolved = true;
    }
    if (!glXGetProcAddressARB)
        return 0;
"

So without this extension, the glXGetProcAddressARB is null and the qt
applications which use OpenGL will fail inside VirtualBox with 3D acceleration
on.

Currently I have not found any issue after enabling this extension.

The code patch is attached and I follow the MIT license.

Thanks
-Haitao
-------------- next part --------------
A non-text attachment was scrubbed...
Name: glx.c.patch
Type: text/x-diff
Size: 591 bytes
Desc: not available
URL: <http://www.virtualbox.org/pipermail/vbox-dev/attachments/20100827/a8228cb7/attachment.bin>


More information about the vbox-dev mailing list