swh:1:snp:673156c31a876c5b99b2fe3e89615529de9a3c44
Revision fc41ee4c92ce703f3e4374bf493505a1d847a657 authored by Sean Harmer on 08 June 2012, 08:39:17 UTC, committed by Qt by Nokia on 20 August 2012, 09:58:16 UTC
The Khronos group makes the glext.h (Desktop OpenGL) and gl2ext.h
(OpenGL ES2) headers officially available nowadays. Most (all?)
Linux systems ship this by default. On Windows platforms the
glext.h file needs to be downloaded from

http://www.opengl.org/registry/api/glext.h

and placed alongside the system OpenGL header.

Making use of the official header reduces the maintenance
overhead for OpenGL support in Qt by removing the need to copy
and paste definitions into the Qt sources.

As the Khronos-provided headers are standardised and backwards and
forwards compatible we can utilise these for all platforms rather
than just for Windows. This means that all definitions required
by Qt will be present even if the system ships out-dated
equivalents.

Mac OS X needs special handling in that we should always use the
system-provided headers there. This is because Apple controls the
OpenGL driver and the headers that go along with it. As such there
is no possibility that the driver exposes additional functionality
compared with the system-provided OpenGL headers. Apple has also
decided to make different decisions about some OpenGL typedefs
compared to other implementations. For example, Apple typdefs
GLhandleARB to void* whereas other platforms use unsigned int.

The alternative, which is to use the system provided glext.h (or
gl2ext.h) header means that Qt code would need to check for the
availability of such definitions wherever it is not guaranteed
to be provided by core OpenGL/ES just to compile.

The proposed approach means that Qt can compile regardless of
the system's OpenGL extension support. We just need to be
rigourous in runtime checking of support for extensions but
that is already a requirement (and is missing in a few places,
see TODO's added in this commit).

The official Khronos headers are added to Qt as

qopenglext.h - Desktop OpenGL
qopengles2ext.h - OpenGL ES2

They need to be public but not part of QtGui module include, hence
the headers have been modified by adding

 #if 0
 #pragma qt_no_master_include
 #endif

to them.

This has been tested on:

Gentoo Linux with GCC 4.6.3
Windows 7 with MSVC 2010
Mac OSX 10.8 with Apple clang 4.0 (based on LLVM 3.1svn)
QNX with qcc (based on GCC 4.4)

A small change is needed to QtDeclarative when building for OpenGL
ES 2 after applying this commit. See
https://codereview.qt-project.org/#change,31794

Change-Id: I4b3d2b1680baf4c78be9a87b4d8de076d23e8f82
Reviewed-by: Gunnar Sletta <gunnar.sletta@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
1 parent 799ceeb
History
Tip revision: ed928cee1233aee003610d5fadb56bdaeffbd7b2 authored by Jake Petroules on 22 September 2016, 17:55:20 UTC
Suppress deprecated warnings for some QSysInfo members
Tip revision: ed928ce
File Mode Size
bin
config.tests
dist
doc
examples
lib
mkspecs
qmake
src
tests
tools
util
.gitattributes -rw-r--r-- 11 bytes
.gitignore -rw-r--r-- 7.5 KB
.tag -rw-r--r-- 5 bytes
INSTALL -rw-r--r-- 663 bytes
LGPL_EXCEPTION.txt -rw-r--r-- 1.2 KB
LICENSE.FDL -rw-r--r-- 22.4 KB
LICENSE.GPL -rw-r--r-- 34.3 KB
LICENSE.LGPL -rw-r--r-- 26.2 KB
LICENSE.PREVIEW.COMMERCIAL -rw-r--r-- 30.8 KB
configure -rwxr-xr-x 203.4 KB
configure.bat -rw-r--r-- 3.7 KB
header.BSD -rw-r--r-- 2.0 KB
header.FDL -rw-r--r-- 830 bytes
header.LGPL -rw-r--r-- 1.6 KB
header.LGPL-ONLY -rw-r--r-- 961 bytes
qtbase.pro -rw-r--r-- 4.1 KB
sync.profile -rw-r--r-- 7.4 KB

back to top