QtQuick2-and-OpenGL-vs-DirectX-vs-Mesa

From Qt Wiki
Revision as of 17:26, 14 January 2015 by Maintenance script (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

QtQuick2 and OpenGL, DirectX or Software Render (Mesa)

QtQuick2 applications require OpenGL 2.0 or OpenGL ES 2.0 which is selected when compiling Qt when using Qt 5.2 and previous and at run time when using Qt 5.3

That can be a problem when deploying Windows applications to cheaper machines or VMs running under hypervisors in corporate servers.

ANGLE vs OpenGL

ANGLE library is used to translate the OpenGL ES calls to DirectX9 or DirectX11 (if available), so hardware accelaration is used on Windows with either ANGLE or OpenGL. The main difference is that Windows usually ship OpenGL 1.1 and it’s Video Card drivers which provide higher versions of OpenGL API. That’s the problem that ANGLE builds addresses, older drivers, but not lack of hardware acceleration.

Then enters DirectX11. DirectX11 has a built-in software render that is used automatically if the underlying hardware can’t provide acceleration.

DirectX11 comes installed with Windows Server 2012, so QtQuick2 with ANGLE works with it in any circunstances.

Software Render (Mesa)

QtQuick2 can run with Mesa software render under windows, as long as you use Qt built for OpenGL 2.0. The ANGLE build will not work as it won’t load Mesa library.

This option will work with cheaper or older machines as well as VMs running under hypervisors.

To use the software render, simply download opengl32.dll from one of the sources below and place it with your executable. Make sure to use Qt built for Desktop OpenGL.

Prebuilt binaries for Mesa are available from the MSYS2 project:

You can also build Mesa yourself, following these instructions [qt.io]

Categories: