1 /****************************************************************************
3 ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/legal
6 ** This file is part of the QtGui module of the Qt Toolkit.
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** Commercial License Usage
10 ** Licensees holding valid commercial Qt licenses may use this file in
11 ** accordance with the commercial license agreement provided with the
12 ** Software or, alternatively, in accordance with the terms contained in
13 ** a written agreement between you and Digia. For licensing terms and
14 ** conditions see http://qt.digia.com/licensing. For further information
15 ** use the contact form at http://qt.digia.com/contact-us.
17 ** GNU Lesser General Public License Usage
18 ** Alternatively, this file may be used under the terms of the GNU Lesser
19 ** General Public License version 2.1 as published by the Free Software
20 ** Foundation and appearing in the file LICENSE.LGPL included in the
21 ** packaging of this file. Please review the following information to
22 ** ensure the GNU Lesser General Public License version 2.1 requirements
23 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
25 ** In addition, as a special exception, Digia gives you certain additional
26 ** rights. These rights are described in the Digia Qt LGPL Exception
27 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
29 ** GNU General Public License Usage
30 ** Alternatively, this file may be used under the terms of the GNU
31 ** General Public License version 3.0 as published by the Free Software
32 ** Foundation and appearing in the file LICENSE.GPL included in the
33 ** packaging of this file. Please review the following information to
34 ** ensure the GNU General Public License version 3.0 requirements will be
35 ** met: http://www.gnu.org/copyleft/gpl.html.
40 ****************************************************************************/
47 #include <QtCore/qglobal.h>
51 #if defined(QT_OPENGL_ES_2)
52 # if defined(Q_OS_MAC)
53 # include <OpenGLES/ES2/gl.h>
55 # include <GLES2/gl2.h>
59 Some GLES2 implementations (like the one on Harmattan) are missing the
60 typedef for GLchar. Work around it here by adding it. The Kkronos headers
61 specify GLChar as a typedef to char, so if an implementation already
62 provides it, then this doesn't do any harm.
66 # include "qopengles2ext.h"
68 # define GL_DOUBLE GL_FLOAT
71 typedef GLfloat GLdouble;
74 // Mac OSX is a "controlled platform" for OpenGL ABI so we use
75 // the system provided headers there. Controlled means that the
76 // headers always match the actual driver implementation so there
77 // is no possibility of drivers exposing additional functionality
78 // from the system headers. Also it means that the vendor can
79 // (and does) make different choices about some OpenGL types. For
80 // e.g. Apple uses void* for GLhandleARB whereas other platforms
83 // For the "uncontrolled" Windows and Linux platforms we use the
84 // official Khronos glext.h header. On these platforms this gives
85 // access to additional functionality the drivers may expose but
86 // which the system headers do not.
87 # if defined(Q_OS_MAC)
88 # include <OpenGL/gl.h>
89 # if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
90 # define GL_DO_NOT_WARN_IF_MULTI_GL_VERSION_HEADERS_INCLUDED
91 # include <OpenGL/gl3.h>
93 # include <OpenGL/glext.h>
95 # if defined(Q_OS_WIN)
96 # include <QtCore/qt_windows.h>
99 # include "qopenglext.h"
103 // Desktops, apart from Mac OS X prior to 10.7 can support OpenGL 3
104 #if !defined(QT_OPENGL_ES_2)
105 # if !defined(Q_OS_MAC) || (defined(Q_OS_MAC) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7)
117 #endif // QT_NO_OPENGL