summaryrefslogtreecommitdiffstats
path: root/Include/moduleobject.h
blob: 34a382f855be1d89c123d7922bc1da1259546927 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/***********************************************************
Copyright 1991 by Stichting Mathematisch Centrum, Amsterdam, The
Netherlands.

                        All Rights Reserved

Permission to use, copy, modify, and distribute this software and its 
documentation for any purpose and without fee is hereby granted, 
provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in 
supporting documentation, and that the names of Stichting Mathematisch
Centrum or CWI not be used in advertising or publicity pertaining to
distribution of the software without specific, written prior permission.

STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO
THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE
FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

******************************************************************/

/* Module object interface */

extern typeobject Moduletype;

#define is_moduleobject(op) ((op)->ob_type == &Moduletype)

extern object *newmoduleobject PROTO((char *));
extern object *getmoduledict PROTO((object *));
extern char *getmodulename PROTO((object *));
2" ] ) && [ "$CFG_EGL" != "yes" ]; then + if ( [ "$CFG_OPENGL" = "es1" ] || [ "$CFG_OPENGL" = "es2" ] ) && [ "$CFG_EGL" != "yes" ]; then echo "The EGL functionality test failed!" echo " EGL is required for OpenGL ES to manage contexts & surfaces." echo " You might need to modify the include and library search paths by editing" @@ -5072,7 +5072,7 @@ if [ "$PLATFORM_X11" = "yes" ]; then exit 1 fi - # auto-detect OpenGL support (es1 = OpenGL ES 1.x Common, es1cl = ES 1.x common lite, es2 = OpenGL ES 2.x) + # auto-detect OpenGL support (es1 = OpenGL ES 1.x Common, es2 = OpenGL ES 2.x) if [ "$CFG_OPENGL" = "auto" ] || [ "$CFG_OPENGL" = "yes" ]; then if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/x11/opengl "OpenGL" $L_FLAGS $I_FLAGS $l_FLAGS $X11TESTS_FLAGS; then CFG_OPENGL=desktop @@ -5080,8 +5080,6 @@ if [ "$PLATFORM_X11" = "yes" ]; then CFG_OPENGL=es2 elif "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles1 "OpenGL ES 1.x" $L_FLAGS $I_FLAGS $l_FLAGS; then CFG_OPENGL=es1 - elif "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles1cl "OpenGL ES 1.x Lite" $L_FLAGS $I_FLAGS $l_FLAGS; then - CFG_OPENGL=es1cl else if [ "$CFG_OPENGL" = "yes" ]; then echo "All the OpenGL functionality tests failed!" @@ -5105,16 +5103,6 @@ if [ "$PLATFORM_X11" = "yes" ]; then *) ;; esac - elif [ "$CFG_OPENGL" = "es1cl" ]; then - # OpenGL ES 1.x common lite - "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles1cl "OpenGL ES 1.x Lite" $L_FLAGS $I_FLAGS $l_FLAGS - if [ $? != "0" ]; then - echo "The OpenGL ES 1.x Common Lite Profile functionality test failed!" - echo " You might need to modify the include and library search paths by editing" - echo " QMAKE_INCDIR_OPENGL_ES1CL, QMAKE_LIBDIR_OPENGL_ES1CL and QMAKE_LIBS_OPENGL_ES1CL in" - echo " ${XQMAKESPEC}." - exit 1 - fi elif [ "$CFG_OPENGL" = "es1" ]; then # OpenGL ES 1.x "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles1 "OpenGL ES 1.x" $L_FLAGS $I_FLAGS $l_FLAGS @@ -5424,14 +5412,12 @@ fi # QWS if [ "$PLATFORM_QWS" = "yes" ]; then - # auto-detect OpenGL support (es1 = OpenGL ES 1.x Common, es1cl = ES 1.x common lite, es2 = OpenGL ES 2.x) + # auto-detect OpenGL support (es1 = OpenGL ES 1.x Common, es2 = OpenGL ES 2.x) if [ "$CFG_OPENGL" = "yes" ]; then if "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles2 "OpenGL ES 2.x" $L_FLAGS $I_FLAGS $l_FLAGS; then CFG_OPENGL=es2 elif "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles1 "OpenGL ES 1.x" $L_FLAGS $I_FLAGS $l_FLAGS; then CFG_OPENGL=es1 - elif "$unixtests/compile.test" "$XQMAKESPEC" "$QMAKE_CONFIG" $OPT_VERBOSE "$relpath" "$outpath" config.tests/unix/opengles1cl "OpenGL ES 1.x Lite" $L_FLAGS $I_FLAGS $l_FLAGS; then - CFG_OPENGL=es1cl else echo "All the OpenGL ES functionality tests failed!" echo " You might need to modify the include and library search paths by editing" @@ -6072,7 +6058,7 @@ else QT_CONFIG="$QT_CONFIG opengl" fi -if [ "$CFG_OPENGL" = "es1" ] || [ "$CFG_OPENGL" = "es1cl" ] || [ "$CFG_OPENGL" = "es2" ]; then +if [ "$CFG_OPENGL" = "es1" ] || [ "$CFG_OPENGL" = "es2" ]; then if [ "$PLATFORM_QWS" = "yes" ]; then QCONFIG_FLAGS="$QCONFIG_FLAGS Q_BACKINGSTORE_SUBSURFACES" QCONFIG_FLAGS="$QCONFIG_FLAGS Q_USE_EGLWINDOWSURFACE" @@ -6085,11 +6071,6 @@ if [ "$CFG_OPENGL" = "es1" ]; then QT_CONFIG="$QT_CONFIG opengles1" fi -if [ "$CFG_OPENGL" = "es1cl" ]; then - QCONFIG_FLAGS="$QCONFIG_FLAGS QT_OPENGL_ES_1_CL" - QT_CONFIG="$QT_CONFIG opengles1cl" -fi - if [ "$CFG_OPENGL" = "es2" ]; then QCONFIG_FLAGS="$QCONFIG_FLAGS QT_OPENGL_ES_2" QT_CONFIG="$QT_CONFIG opengles2" @@ -7513,8 +7494,6 @@ if [ "$CFG_OPENGL" = "desktop" ]; then echo "OpenGL support ...... yes (Desktop OpenGL)" elif [ "$CFG_OPENGL" = "es1" ]; then echo "OpenGL support ...... yes (OpenGL ES 1.x Common profile)" -elif [ "$CFG_OPENGL" = "es1cl" ]; then - echo "OpenGL support ...... yes (OpenGL ES 1.x Common Lite profile)" elif [ "$CFG_OPENGL" = "es2" ]; then echo "OpenGL support ...... yes (OpenGL ES 2.x)" else diff --git a/demos/demos.pro b/demos/demos.pro index 5a9b6db..08dd8af 100644 --- a/demos/demos.pro +++ b/demos/demos.pro @@ -38,7 +38,7 @@ wince*: SUBDIRS = \ demos_undo \ demos_sub-attaq -contains(QT_CONFIG, opengl):!contains(QT_CONFIG, opengles1):!contains(QT_CONFIG, opengles1cl):!contains(QT_CONFIG, opengles2):{ +contains(QT_CONFIG, opengl):!contains(QT_CONFIG, opengles1):!contains(QT_CONFIG, opengles2):{ SUBDIRS += demos_boxes } diff --git a/doc/src/development/qmake-manual.qdoc b/doc/src/development/qmake-manual.qdoc index 3d5c792..8fc4058 100644 --- a/doc/src/development/qmake-manual.qdoc +++ b/doc/src/development/qmake-manual.qdoc @@ -2252,11 +2252,11 @@ For example: If the OpenGL implementation uses EGL (most OpenGL/ES systems), then QMAKE_INCDIR_EGL may also need to be set. - \section1 QMAKE_INCDIR_OPENGL_ES1, QMAKE_INCDIR_OPENGL_ES1CL, QMAKE_INCDIR_OPENGL_ES2 + \section1 QMAKE_INCDIR_OPENGL_ES1, QMAKE_INCDIR_OPENGL_ES2 These variables contain the location of OpenGL headers files to be added - to INCLUDEPATH when building an application with OpenGL ES 1, OpenGL ES 1 Common - Lite or OpenGL ES 2 support respectively. + to INCLUDEPATH when building an application with OpenGL ES 1 + or OpenGL ES 2 support respectively. The value of this variable is typically handled by \c qmake or \l{#QMAKESPEC}{qmake.conf} and rarely needs to be modified. @@ -2510,10 +2510,10 @@ For example: variable is typically handled by \c qmake or \l{#QMAKESPEC}{qmake.conf} and rarely needs to be modified. - \section1 QMAKE_LIBS_OPENGL_ES1, QMAKE_LIBS_OPENGL_ES1CL, QMAKE_LIBS_OPENGL_ES2 + \section1 QMAKE_LIBS_OPENGL_ES1, QMAKE_LIBS_OPENGL_ES2 - These variables contain all the OpenGL libraries for OpenGL ES 1, - OpenGL ES 1 Common Lite profile and OpenGL ES 2. + These variables contain all the OpenGL libraries for OpenGL ES 1 + and OpenGL ES 2. The value of these variables is typically handled by \c qmake or \l{#QMAKESPEC}{qmake.conf} and rarely needs to be modified. diff --git a/doc/src/platforms/wince-opengl.qdoc b/doc/src/platforms/wince-opengl.qdoc index afc1c0b..c1be4bc 100644 --- a/doc/src/platforms/wince-opengl.qdoc +++ b/doc/src/platforms/wince-opengl.qdoc @@ -53,7 +53,7 @@ Windows CE window manager. \section2 Configure -To configure Qt for Windows Mobile 5.0 and OpenGL ES Common Lite support +To configure Qt for Windows Mobile 5.0 and OpenGL ES Common support you can run \c{configure} like this: \snippet doc/src/snippets/code/doc_src_wince-opengl.qdoc 0 @@ -61,17 +61,12 @@ you can run \c{configure} like this: OpenGL ES includes profiles for floating-point and fixed-point arithmetic. The floating point profile is called OpenGL ES CM (Common) and the fixed-point profile is called OpenGL ES CL (Common Lite). +The fixed-point profile is no longer supported since Qt 4.7. You can run \c{configure} with the \c{-opengl-es-cm} option for the Common -profile or \c{-opengl-es-cl} for the Common Lite profile. In both cases, -ensure that the \c{lib} and \c{includes} paths include the OpenGL ES +profile. Ensure that the \c{lib} and \c{includes} paths include the OpenGL ES headers and libararies from your SDK. The OpenGL ES lib should be called -either \c{libGLES_CM.lib} for the Common profile or \c{libGLES_CL.lib} for -the Common Lite profile. - -The distinction between the Common and Common Lite profiles is important, -because the Common Lite profile has less functionality and only supports a -fixed-point vertex format. +either \c{libGLES_CM.lib} for the Common profile. To start programming with Qt and OpenGL ES on Windows CE, you can start with the \l{Hello GL ES Example}. This example shows how to use QGLWidget diff --git a/doc/src/snippets/code/doc_src_wince-opengl.qdoc b/doc/src/snippets/code/doc_src_wince-opengl.qdoc index eef1540..601b00a 100644 --- a/doc/src/snippets/code/doc_src_wince-opengl.qdoc +++ b/doc/src/snippets/code/doc_src_wince-opengl.qdoc @@ -40,5 +40,5 @@ ****************************************************************************/ //! [0] -configure -platform win32-msvc2005 -xplatform wincewm50pocket-msvc2005 -opengl-es-cl +configure -platform win32-msvc2005 -xplatform wincewm50pocket-msvc2005 -opengl-es-cm //! [0] diff --git a/examples/opengl/hellogl_es/cl_helper.h b/examples/opengl/hellogl_es/cl_helper.h deleted file mode 100644 index 4f4c2bd..0000000 --- a/examples/opengl/hellogl_es/cl_helper.h +++ /dev/null @@ -1,133 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. -** Contact: Nokia Corporation (qt-info@nokia.com) -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifdef QT_OPENGL_ES_1_CL - -//! [0] -#define FLOAT2X(f) ((int) ( (f) * (65536))) -#define X2FLOAT(x) ((float)(x) / 65536.0f) - -#define f2vt(f) FLOAT2X(f) -#define vt2f(x) X2FLOAT(x) - -#define q_vertexType GLfixed -#define q_vertexTypeEnum GL_FIXED - -#define q_glFog glFogx -#define q_glFogv glFogxv -//! [0] - -#define q_glLight glLightx -#define q_glLightv glLightxv -#define q_glLightModel glLightModelx -#define q_glLightModelv glLightModelxv - -#define q_glAlphaFunc glAlphaFuncx - -#define q_glMaterial glMaterialx -#define q_glMaterialv glMaterialxv -#define q_glColor4 glColor4x - -#define q_glTexParameter glTexParameterx -#define q_glTexEnv glTexEnvx - -#define q_glOrtho glOrthox -#define q_glFrustum glFrustumx - -#define q_glTranslate glTranslatex -#define q_glScale glScalex -#define q_glRotate glRotatex -#define q_glLoadMatrix glLoadMatrixx - -#define q_glClearColor glClearColorx - -#define q_glMultMatrix glMultMatrixx - -#define q_glNormal3 glNormal3x - -#define q_glPolygonOffset glPolygonOffsetx -#define q_glPointSize glPointSizex - -//! [1] -#else - -#define f2vt(f) (f) -#define vt2f(x) (x) - -#define q_vertexType GLfloat -#define q_vertexTypeEnum GL_FLOAT - -#define q_glFog glFogf -#define q_glFogv glFogfv -//! [1] - -#define q_glLight glLightf -#define q_glLightv glLightfv -#define q_glLightModel glLightModelf -#define q_glLightModelv glLightModelfv - -#define q_glAlphaFunc glAlphaFuncf - -#define q_glMaterial glMaterialf -#define q_glMaterialv glMaterialfv -#define q_glColor4 glColor4f - -#define q_glTexParameter glTexParameterf -#define q_glTexEnv glTexEnvf - -#define q_glOrtho glOrthof -#define q_glFrustum glFrustumf - -#define q_glTranslate glTranslatef -#define q_glScale glScalef -#define q_glRotate glRotatef -#define q_glLoadMatrix glLoadMatrixf - -#define q_glClearColor glClearColor - -#define q_glMultMatrix glMultMatrixf - -#define q_glNormal3 glNormal3f - -#define q_glPolygonOffset glPolygonOffsetf -#define q_glPointSize glPointSizef - -#endif diff --git a/examples/opengl/hellogl_es/glwidget.cpp b/examples/opengl/hellogl_es/glwidget.cpp index 9a45a11..8a6543d 100644 --- a/examples/opengl/hellogl_es/glwidget.cpp +++ b/examples/opengl/hellogl_es/glwidget.cpp @@ -44,7 +44,6 @@ #include #include "bubble.h" -#include "cl_helper.h" const int bubbleNum = 8; @@ -114,9 +113,9 @@ void GLWidget::paintQtLogo() { glDisable(GL_TEXTURE_2D); glEnableClientState(GL_VERTEX_ARRAY); - glVertexPointer(3,q_vertexTypeEnum,0, createdVertices); + glVertexPointer(3,GL_FLOAT,0, createdVertices); glEnableClientState(GL_NORMAL_ARRAY); - glNormalPointer(q_vertexTypeEnum,0,createdNormals); + glNormalPointer(GL_FLOAT,0,createdNormals); glDrawArrays(GL_TRIANGLES, 0, m_vertexNumber / 3); } //! [2] @@ -125,83 +124,83 @@ void GLWidget::paintTexturedCube() { glEnable(GL_TEXTURE_2D); glBindTexture(GL_TEXTURE_2D, m_uiTexture); - q_vertexType afVertices[] = { - f2vt(-0.5), f2vt(0.5), f2vt(0.5), f2vt(0.5),f2vt(-0.5),f2vt(0.5),f2vt(-0.5),f2vt(-0.5),f2vt(0.5), - f2vt(0.5), f2vt(-0.5), f2vt(0.5), f2vt(-0.5),f2vt(0.5),f2vt(0.5),f2vt(0.5),f2vt(0.5),f2vt(0.5), - f2vt(-0.5), f2vt(-0.5), f2vt(-0.5), f2vt(0.5),f2vt(-0.5),f2vt(-0.5),f2vt(-0.5),f2vt(0.5),f2vt(-0.5), - f2vt(0.5), f2vt(0.5), f2vt(-0.5), f2vt(-0.5),f2vt(0.5),f2vt(-0.5),f2vt(0.5),f2vt(-0.5),f2vt(-0.5), - - f2vt(0.5), f2vt(-0.5), f2vt(-0.5), f2vt(0.5),f2vt(-0.5),f2vt(0.5),f2vt(0.5),f2vt(0.5),f2vt(-0.5), - f2vt(0.5), f2vt(0.5), f2vt(0.5), f2vt(0.5),f2vt(0.5),f2vt(-0.5),f2vt(0.5),f2vt(-0.5),f2vt(0.5), - f2vt(-0.5), f2vt(0.5), f2vt(-0.5), f2vt(-0.5),f2vt(-0.5),f2vt(0.5),f2vt(-0.5),f2vt(-0.5),f2vt(-0.5), - f2vt(-0.5), f2vt(-0.5), f2vt(0.5), f2vt(-0.5),f2vt(0.5),f2vt(-0.5),f2vt(-0.5),f2vt(0.5),f2vt(0.5), - - f2vt(0.5), f2vt(0.5), f2vt(-0.5), f2vt(-0.5), f2vt(0.5), f2vt(0.5), f2vt(-0.5), f2vt(0.5), f2vt(-0.5), - f2vt(-0.5), f2vt(0.5), f2vt(0.5), f2vt(0.5), f2vt(0.5), f2vt(-0.5), f2vt(0.5), f2vt(0.5), f2vt(0.5), - f2vt(-0.5), f2vt(-0.5), f2vt(-0.5), f2vt(-0.5), f2vt(-0.5), f2vt(0.5), f2vt(0.5), f2vt(-0.5), f2vt(-0.5), - f2vt(0.5), f2vt(-0.5), f2vt(0.5), f2vt(0.5), f2vt(-0.5), f2vt(-0.5), f2vt(-0.5), f2vt(-0.5), f2vt(0.5) + GLfloat afVertices[] = { + -0.5, 0.5, 0.5, 0.5,-0.5,0.5,-0.5,-0.5,0.5, + 0.5, -0.5, 0.5, -0.5,0.5,0.5,0.5,0.5,0.5, + -0.5, -0.5, -0.5, 0.5,-0.5,-0.5,-0.5,0.5,-0.5, + 0.5, 0.5, -0.5, -0.5,0.5,-0.5,0.5,-0.5,-0.5, + + 0.5, -0.5, -0.5, 0.5,-0.5,0.5,0.5,0.5,-0.5, + 0.5, 0.5, 0.5, 0.5,0.5,-0.5,0.5,-0.5,0.5, + -0.5, 0.5, -0.5, -0.5,-0.5,0.5,-0.5,-0.5,-0.5, + -0.5, -0.5, 0.5, -0.5,0.5,-0.5,-0.5,0.5,0.5, + + 0.5, 0.5, -0.5, -0.5, 0.5, 0.5, -0.5, 0.5, -0.5, + -0.5, 0.5, 0.5, 0.5, 0.5, -0.5, 0.5, 0.5, 0.5, + -0.5, -0.5, -0.5, -0.5, -0.5, 0.5, 0.5, -0.5, -0.5, + 0.5, -0.5, 0.5, 0.5, -0.5, -0.5, -0.5, -0.5, 0.5 }; glEnableClientState(GL_VERTEX_ARRAY); - glVertexPointer(3,q_vertexTypeEnum,0,afVertices); - - q_vertexType afTexCoord[] = { - f2vt(0.0f),f2vt(0.0f), f2vt(1.0f),f2vt(1.0f), f2vt(1.0f),f2vt(0.0f), - f2vt(1.0f),f2vt(1.0f), f2vt(0.0f),f2vt(0.0f), f2vt(0.0f),f2vt(1.0f), - f2vt(1.0f),f2vt(1.0f), f2vt(1.0f),f2vt(0.0f), f2vt(0.0f),f2vt(1.0f), - f2vt(0.0f),f2vt(0.0f), f2vt(0.0f),f2vt(1.0f), f2vt(1.0f),f2vt(0.0f), - - f2vt(1.0f),f2vt(1.0f), f2vt(1.0f),f2vt(0.0f), f2vt(0.0f),f2vt(1.0f), - f2vt(0.0f),f2vt(0.0f), f2vt(0.0f),f2vt(1.0f), f2vt(1.0f),f2vt(0.0f), - f2vt(0.0f),f2vt(0.0f), f2vt(1.0f),f2vt(1.0f), f2vt(1.0f),f2vt(0.0f), - f2vt(1.0f),f2vt(1.0f), f2vt(0.0f),f2vt(0.0f), f2vt(0.0f),f2vt(1.0f), - - f2vt(0.0f),f2vt(1.0f), f2vt(1.0f),f2vt(0.0f), f2vt(1.0f),f2vt(1.0f), - f2vt(1.0f),f2vt(0.0f), f2vt(0.0f),f2vt(1.0f), f2vt(0.0f),f2vt(0.0f), - f2vt(1.0f),f2vt(0.0f), f2vt(1.0f),f2vt(1.0f), f2vt(0.0f),f2vt(0.0f), - f2vt(0.0f),f2vt(1.0f), f2vt(0.0f),f2vt(0.0f), f2vt(1.0f),f2vt(1.0f) + glVertexPointer(3,GL_FLOAT,0,afVertices); + + GLfloat afTexCoord[] = { + 0.0f,0.0f, 1.0f,1.0f, 1.0f,0.0f, + 1.0f,1.0f, 0.0f,0.0f, 0.0f,1.0f, + 1.0f,1.0f, 1.0f,0.0f, 0.0f,1.0f, + 0.0f,0.0f, 0.0f,1.0f, 1.0f,0.0f, + + 1.0f,1.0f, 1.0f,0.0f, 0.0f,1.0f, + 0.0f,0.0f, 0.0f,1.0f, 1.0f,0.0f, + 0.0f,0.0f, 1.0f,1.0f, 1.0f,0.0f, + 1.0f,1.0f, 0.0f,0.0f, 0.0f,1.0f, + + 0.0f,1.0f, 1.0f,0.0f, 1.0f,1.0f, + 1.0f,0.0f, 0.0f,1.0f, 0.0f,0.0f, + 1.0f,0.0f, 1.0f,1.0f, 0.0f,0.0f, + 0.0f,1.0f, 0.0f,0.0f, 1.0f,1.0f }; glEnableClientState(GL_TEXTURE_COORD_ARRAY); - glTexCoordPointer(2,q_vertexTypeEnum,0,afTexCoord); + glTexCoordPointer(2,GL_FLOAT,0,afTexCoord); - q_vertexType afNormals[] = { + GLfloat afNormals[] = { - f2vt(0),f2vt(0),f2vt(-1), f2vt(0),f2vt(0),f2vt(-1), f2vt(0),f2vt(0),f2vt(-1), - f2vt(0),f2vt(0),f2vt(-1), f2vt(0),f2vt(0),f2vt(-1), f2vt(0),f2vt(0),f2vt(-1), - f2vt(0),f2vt(0),f2vt(1), f2vt(0),f2vt(0),f2vt(1), f2vt(0),f2vt(0),f2vt(1), - f2vt(0),f2vt(0),f2vt(1), f2vt(0),f2vt(0),f2vt(1), f2vt(0),f2vt(0),f2vt(1), + 0,0,-1, 0,0,-1, 0,0,-1, + 0,0,-1, 0,0,-1, 0,0,-1, + 0,0,1, 0,0,1, 0,0,1, + 0,0,1, 0,0,1, 0,0,1, - f2vt(-1),f2vt(0),f2vt(0), f2vt(-1),f2vt(0),f2vt(0), f2vt(-1),f2vt(0),f2vt(0), - f2vt(-1),f2vt(0),f2vt(0), f2vt(-1),f2vt(0),f2vt(0), f2vt(-1),f2vt(0),f2vt(0), - f2vt(1),f2vt(0),f2vt(0), f2vt(1),f2vt(0),f2vt(0), f2vt(1),f2vt(0),f2vt(0), - f2vt(1),f2vt(0),f2vt(0), f2vt(1),f2vt(0),f2vt(0), f2vt(1),f2vt(0),f2vt(0), + -1,0,0, -1,0,0, -1,0,0, + -1,0,0, -1,0,0, -1,0,0, + 1,0,0, 1,0,0, 1,0,0, + 1,0,0, 1,0,0, 1,0,0, - f2vt(0),f2vt(-1),f2vt(0), f2vt(0),f2vt(-1),f2vt(0), f2vt(0),f2vt(-1),f2vt(0), - f2vt(0),f2vt(-1),f2vt(0), f2vt(0),f2vt(-1),f2vt(0), f2vt(0),f2vt(-1),f2vt(0), - f2vt(0),f2vt(1),f2vt(0), f2vt(0),f2vt(1),f2vt(0), f2vt(0),f2vt(1),f2vt(0), - f2vt(0),f2vt(1),f2vt(0), f2vt(0),f2vt(1),f2vt(0), f2vt(0),f2vt(1),f2vt(0) + 0,-1,0, 0,-1,0, 0,-1,0, + 0,-1,0, 0,-1,0, 0,-1,0, + 0,1,0, 0,1,0, 0,1,0, + 0,1,0, 0,1,0, 0,1,0 }; glEnableClientState(GL_NORMAL_ARRAY); - glNormalPointer(q_vertexTypeEnum,0,afNormals); + glNormalPointer(GL_FLOAT,0,afNormals); glDrawArrays(GL_TRIANGLES, 0, 36); } void GLWidget::initializeGL () { - q_glClearColor(f2vt(0.1f), f2vt(0.1f), f2vt(0.2f), f2vt(1.0f)); + glClearColor(0.1f, 0.1f, 0.2f, 1.0f); glEnable(GL_TEXTURE_2D); glGenTextures(1, &m_uiTexture); m_uiTexture = bindTexture(QImage(":/qt.png")); - q_glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR ); - q_glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR ); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR ); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR ); glEnable(GL_LIGHTING); glEnable(GL_LIGHT0); - q_vertexType aLightPosition[] = {f2vt(0.0f),f2vt(0.3f),f2vt(1.0f),f2vt(0.0f)}; + GLfloat aLightPosition[] = {0.0f,0.3f,1.0f,0.0f}; - q_glLightv(GL_LIGHT0, GL_SPOT_DIRECTION, aLightPosition); + glLightfv(GL_LIGHT0, GL_SPOT_DIRECTION, aLightPosition); m_fAngle = 0; m_fScale = 1; createGeometry(); @@ -230,12 +229,12 @@ void GLWidget::paintGL() //Since OpenGL ES does not support glPush/PopAttrib(GL_ALL_ATTRIB_BITS) //we have to take care of the states ourselves - q_glClearColor(f2vt(0.1f), f2vt(0.1f), f2vt(0.2f), f2vt(1.0f)); + glClearColor(0.1f, 0.1f, 0.2f, 1.0f); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glEnable(GL_TEXTURE_2D); - q_glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR ); - q_glTexParameter(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR ); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR ); + glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR ); glEnable(GL_LIGHTING); glEnable(GL_LIGHT0); @@ -248,14 +247,14 @@ void GLWidget::paintGL() glMatrixMode(GL_MODELVIEW); glLoadIdentity(); - q_glRotate(f2vt(m_fAngle), f2vt(0.0), f2vt(1.0), f2vt(0.0)); - q_glRotate(f2vt(m_fAngle), f2vt(1.0), f2vt(0.0), f2vt(0.0)); - q_glRotate(f2vt(m_fAngle), f2vt(0.0), f2vt(0.0), f2vt(1.0)); - q_glScale(f2vt(m_fScale), f2vt(m_fScale),f2vt(m_fScale)); - q_glTranslate(f2vt(0),f2vt(-0.2),f2vt(0)); + glRotatef(m_fAngle, 0.0f, 1.0f, 0.0f); + glRotatef(m_fAngle, 1.0f, 0.0f, 0.0f); + glRotatef(m_fAngle, 0.0f, 0.0f, 1.0f); + glScalef(m_fScale, m_fScale,m_fScale); + glTranslatef(0.0f,-0.2f,0.0f); - q_vertexType matDiff[] = {f2vt(0.40), f2vt(1.0), f2vt(0.0), f2vt(1.0)}; - q_glMaterialv(GL_FRONT_AND_BACK, GL_DIFFUSE, matDiff); + GLfloat matDiff[] = {0.40f, 1.0f, 0.0f, 1.0f}; + glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, matDiff); if (qtLogo) paintQtLogo(); @@ -376,11 +375,11 @@ void GLWidget::createGeometry() //! [1] m_vertexNumber = vertices.size(); - createdVertices = new q_vertexType[m_vertexNumber]; - createdNormals = new q_vertexType[m_vertexNumber]; + createdVertices = new GLfloat[m_vertexNumber]; + createdNormals = new GLfloat[m_vertexNumber]; for (int i = 0;i < m_vertexNumber;i++) { - createdVertices[i] = f2vt(vertices.at(i) * 2); - createdNormals[i] = f2vt(normals.at(i)); + createdVertices[i] = vertices.at(i) * 2; + createdNormals[i] = normals.at(i); } vertices.clear(); normals.clear(); diff --git a/examples/opengl/hellogl_es/glwidget.h b/examples/opengl/hellogl_es/glwidget.h index 7a8df53..3b2b5d4 100644 --- a/examples/opengl/hellogl_es/glwidget.h +++ b/examples/opengl/hellogl_es/glwidget.h @@ -45,7 +45,6 @@ #include #include -#include "cl_helper.h" class Bubble; @@ -76,8 +75,8 @@ private: void extrude(qreal x1, qreal y1, qreal x2, qreal y2); QList vertices; QList normals; - q_vertexType *createdVertices; - q_vertexType *createdNormals; + GLfloat *createdVertices; + GLfloat *createdNormals; int m_vertexNumber; bool qtLogo; QList bubbles; diff --git a/examples/opengl/opengl.pro b/examples/opengl/opengl.pro index eaac9b8..c3fbc77 100644 --- a/examples/opengl/opengl.pro +++ b/examples/opengl/opengl.pro @@ -1,14 +1,12 @@ TEMPLATE = subdirs -contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles1cl)|contains(QT_CONFIG, opengles2){ +contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2){ contains(QT_CONFIG, opengles2) { SUBDIRS = hellogl_es2 } else { SUBDIRS = hellogl_es } - !contains(QT_CONFIG, opengles1cl) { - SUBDIRS += textures - } + SUBDIRS += textures contains(QT_CONFIG, opengles1) { SUBDIRS += hellogl } diff --git a/mkspecs/common/linux.conf b/mkspecs/common/linux.conf index 1ae5608..4fbe2dc 100644 --- a/mkspecs/common/linux.conf +++ b/mkspecs/common/linux.conf @@ -15,8 +15,6 @@ QMAKE_INCDIR_OPENGL = /usr/X11R6/include QMAKE_LIBDIR_OPENGL = /usr/X11R6/lib QMAKE_INCDIR_OPENGL_ES1 = $$QMAKE_INCDIR_OPENGL QMAKE_LIBDIR_OPENGL_ES1 = $$QMAKE_LIBDIR_OPENGL -QMAKE_INCDIR_OPENGL_ES1CL = $$QMAKE_INCDIR_OPENGL -QMAKE_LIBDIR_OPENGL_ES1CL = $$QMAKE_LIBDIR_OPENGL QMAKE_INCDIR_OPENGL_ES2 = $$QMAKE_INCDIR_OPENGL QMAKE_LIBDIR_OPENGL_ES2 = $$QMAKE_LIBDIR_OPENGL QMAKE_INCDIR_EGL = @@ -33,7 +31,6 @@ QMAKE_LIBS_EGL = -lEGL QMAKE_LIBS_OPENGL = -lGLU -lGL QMAKE_LIBS_OPENGL_QT = -lGL QMAKE_LIBS_OPENGL_ES1 = -lGLES_CM -QMAKE_LIBS_OPENGL_ES1CL = -lGLES_CL QMAKE_LIBS_OPENGL_ES2 = -lGLESv2 QMAKE_LIBS_OPENVG = -lOpenVG QMAKE_LIBS_THREAD = -lpthread diff --git a/mkspecs/common/wince/qmake.conf b/mkspecs/common/wince/qmake.conf index ff99f1b..705cdc3 100644 --- a/mkspecs/common/wince/qmake.conf +++ b/mkspecs/common/wince/qmake.conf @@ -66,7 +66,6 @@ QMAKE_LIBS_COMPAT = QMAKE_LIBS_EGL = libEGL.lib QMAKE_LIBS_OPENGL_ES1 = libGLES_CM.lib -QMAKE_LIBS_OPENGL_ES1CL = libGLES_CL.lib QMAKE_LIBS_OPENGL_ES2 = libGLESv2.lib QMAKE_LIBS_QT_ENTRY = -lqtmain diff --git a/mkspecs/features/egl.prf b/mkspecs/features/egl.prf index 00f70d3..7e7d098 100644 --- a/mkspecs/features/egl.prf +++ b/mkspecs/features/egl.prf @@ -11,14 +11,6 @@ wince*:contains(QT_CONFIG, opengles1) { exists($$p):LIBS_PRIVATE += -L$$p } DEFINES += QT_GLES_EGL -} else:wince*:contains(QT_CONFIG, opengles1cl) { - INCLUDEPATH += $$QMAKE_INCDIR_OPENGL_ES1CL - LIBS_PRIVATE += $$QMAKE_LIBS_OPENGL_ES1CL - LIBS += $$QMAKE_LFLAGS_EGL - for(p, QMAKE_LIBDIR_OPENGL_ES1CL) { - exists($$p):LIBS_PRIVATE += -L$$p - } - DEFINES += QT_GLES_EGL } else { INCLUDEPATH += $$QMAKE_INCDIR_EGL LIBS_PRIVATE += $$QMAKE_LIBS_EGL diff --git a/mkspecs/features/unix/opengl.prf b/mkspecs/features/unix/opengl.prf index f2db819..74a5149 100644 --- a/mkspecs/features/unix/opengl.prf +++ b/mkspecs/features/unix/opengl.prf @@ -3,11 +3,6 @@ contains(QT_CONFIG, opengles1) { !isEmpty(QMAKE_LIBDIR_OPENGL_ES1):QMAKE_LIBDIR += $$QMAKE_LIBDIR_OPENGL_ES1 target_qt:LIBS_PRIVATE += $$QMAKE_LIBS_OPENGL_ES1 else:LIBS += $$QMAKE_LIBS_OPENGL_ES1 -} else:contains(QT_CONFIG, opengles1cl) { - INCLUDEPATH += $$QMAKE_INCDIR_OPENGL_ES1CL - !isEmpty(QMAKE_LIBDIR_OPENGL_ES1CL):QMAKE_LIBDIR += $$QMAKE_LIBDIR_OPENGL_ES1CL - target_qt:LIBS_PRIVATE += $$QMAKE_LIBS_OPENGL_ES1CL - else:LIBS += $$QMAKE_LIBS_OPENGL_ES1CL } else:contains(QT_CONFIG, opengles2) { INCLUDEPATH += $$QMAKE_INCDIR_OPENGL_ES2 !isEmpty(QMAKE_LIBDIR_OPENGL_ES2):QMAKE_LIBDIR += $$QMAKE_LIBDIR_OPENGL_ES2 diff --git a/mkspecs/unsupported/linux-host-g++/qmake.conf b/mkspecs/unsupported/linux-host-g++/qmake.conf index 8a480c4..7b17789 100644 --- a/mkspecs/unsupported/linux-host-g++/qmake.conf +++ b/mkspecs/unsupported/linux-host-g++/qmake.conf @@ -88,8 +88,6 @@ QMAKE_INCDIR_OPENGL = /usr/X11R6/include QMAKE_LIBDIR_OPENGL = /usr/X11R6/lib QMAKE_INCDIR_OPENGL_ES1 = $$QMAKE_INCDIR_OPENGL QMAKE_LIBDIR_OPENGL_ES1 = $$QMAKE_LIBDIR_OPENGL -QMAKE_INCDIR_OPENGL_ES1CL = $$QMAKE_INCDIR_OPENGL -QMAKE_LIBDIR_OPENGL_ES1CL = $$QMAKE_LIBDIR_OPENGL QMAKE_INCDIR_OPENGL_ES2 = $$QMAKE_INCDIR_OPENGL QMAKE_LIBDIR_OPENGL_ES2 = $$QMAKE_LIBDIR_OPENGL QMAKE_INCDIR_EGL = @@ -106,7 +104,6 @@ QMAKE_LIBS_EGL = -lEGL QMAKE_LIBS_OPENGL = -lGLU -lGL QMAKE_LIBS_OPENGL_QT = -lGL QMAKE_LIBS_OPENGL_ES1 = -lGLES_CM -QMAKE_LIBS_OPENGL_ES1CL = -lGLES_CL QMAKE_LIBS_OPENGL_ES2 = -lGLESv2 QMAKE_LIBS_OPENVG = -lOpenVG QMAKE_LIBS_THREAD = -lpthread diff --git a/src/opengl/opengl.pro b/src/opengl/opengl.pro index 7338534..ff42a49 100644 --- a/src/opengl/opengl.pro +++ b/src/opengl/opengl.pro @@ -13,7 +13,6 @@ include(../qbase.pri) !win32:!embedded:!mac:CONFIG += x11 contains(QT_CONFIG, opengl):CONFIG += opengl contains(QT_CONFIG, opengles1):CONFIG += opengles1 -contains(QT_CONFIG, opengles1cl):CONFIG += opengles1cl contains(QT_CONFIG, opengles2):CONFIG += opengles2 contains(QT_CONFIG, egl):CONFIG += egl @@ -43,7 +42,7 @@ SOURCES += qgl.cpp \ SOURCES += qpaintengine_opengl.cpp } -!contains(QT_CONFIG, opengles1):!contains(QT_CONFIG, opengles1cl) { +!contains(QT_CONFIG, opengles1) { HEADERS += qglshaderprogram.h \ qglpixmapfilter_p.h \ qgraphicsshadereffect_p.h \ @@ -78,7 +77,7 @@ SOURCES += qgl.cpp \ } x11 { - contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles1cl)|contains(QT_CONFIG, opengles2) { + contains(QT_CONFIG, opengles1)|contains(QT_CONFIG, opengles2) { SOURCES += qgl_x11egl.cpp \ qglpixelbuffer_egl.cpp \ qgl_egl.cpp \ @@ -125,8 +124,7 @@ wince*: { qglpixelbuffer_egl.cpp \ qgl_egl.cpp - HEADERS += qgl_cl_p.h \ - qgl_egl_p.h \ + HEADERS += qgl_egl_p.h } embedded { diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index bb76f1a..f2d190f 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -67,7 +67,7 @@ #include "qimage.h" #include "qgl_p.h" -#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL) +#if !defined(QT_OPENGL_ES_1) #include "gl2paintengineex/qpaintengineex_opengl2_p.h" #endif @@ -95,11 +95,6 @@ QT_BEGIN_NAMESPACE -#ifdef QT_OPENGL_ES_1_CL -#include "qgl_cl_p.h" -#endif - - #if defined(Q_WS_X11) || defined(Q_WS_MAC) || defined(Q_WS_QWS) QGLExtensionFuncs QGLContextPrivate::qt_extensionFuncs; #endif @@ -1655,7 +1650,7 @@ QImage qt_gl_read_texture(const QSize &size, bool alpha_format, bool include_alp QImage img(size, alpha_format ? QImage::Format_ARGB32_Premultiplied : QImage::Format_RGB32); int w = size.width(); int h = size.height(); -#if !defined(QT_OPENGL_ES_2) && !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL) +#if !defined(QT_OPENGL_ES_2) && !defined(QT_OPENGL_ES_1) //### glGetTexImage not in GL ES 2.0, need to do something else here! glGetTexImage(GL_TEXTURE_2D, 0, GL_RGBA, GL_UNSIGNED_BYTE, img.bits()); #endif @@ -2433,7 +2428,7 @@ QGLTexture *QGLContextPrivate::bindTexture(const QPixmap &pixmap, GLenum target, { Q_Q(QGLContext); QPixmapData *pd = pixmap.pixmapData(); -#if !defined(QT_OPENGL_ES_1) && !defined(QT_OPENGL_ES_1_CL) +#if !defined(QT_OPENGL_ES_1) if (target == GL_TEXTURE_2D && pd->classId() == QPixmapData::OpenGLClass) { const QGLPixmapData *data = static_cast(pd); @@ -2680,41 +2675,41 @@ void QGLContext::deleteTexture(QMacCompatGLuint id) } #endif -void qt_add_rect_to_array(const QRectF &r, q_vertexType *array) +void qt_add_rect_to_array(const QRectF &r, GLfloat *array) { qreal left = r.left(); qreal right = r.right(); qreal top = r.top(); qreal bottom = r.bottom(); - array[0] = f2vt(left); - array[1] = f2vt(top); - array[2] = f2vt(right); - array[3] = f2vt(top); - array[4] = f2vt(right); - array[5] = f2vt(bottom); - array[6] = f2vt(left); - array[7] = f2vt(bottom); + array[0] = left; + array[1] = top; + array[2] = right; + array[3] = top; + array[4] = right; + array[5] = bottom; + array[6] = left; + array[7] = bottom; } -void qt_add_texcoords_to_array(qreal x1, qreal y1, qreal x2, qreal y2, q_vertexType *array) +void qt_add_texcoords_to_array(qreal x1, qreal y1, qreal x2, qreal y2, GLfloat *array) { - array[0] = f2vt(x1); - array[1] = f2vt(y1); - array[2] = f2vt(x2); - array[3] = f2vt(y1); - array[4] = f2vt(x2); - array[5] = f2vt(y2); - array[6] = f2vt(x1); - array[7] = f2vt(y2); + array[0] = x1; + array[1] = y1; + array[2] = x2; + array[3] = y1; + array[4] = x2; + array[5] = y2; + array[6] = x1; + array[7] = y2; } #if !defined(QT_OPENGL_ES_2) static void qDrawTextureRect(const QRectF &target, GLint textureWidth, GLint textureHeight, GLenum textureTarget) { - q_vertexType tx = f2vt(1); - q_vertexType ty = f2vt(1); + GLfloat tx = 1.0f; + GLfloat ty = 1.0f; #ifdef QT_OPENGL_ES Q_UNUSED(textureWidth); @@ -2727,20 +2722,20 @@ static void qDrawTextureRect(const QRectF &target, GLint textureWidth, GLint tex glGetTexLevelParameteriv(textureTarget, 0, GL_TEXTURE_HEIGHT, &textureHeight); } - tx = f2vt(textureWidth); - ty = f2vt(textureHeight); + tx = GLfloat(textureWidth); + ty = GLfloat(textureHeight); } #endif - q_vertexType texCoordArray[4*2] = { + GLfloat texCoordArray[4*2] = { 0, ty, tx, ty, tx, 0, 0, 0 }; - q_vertexType vertexArray[4*2]; + GLfloat vertexArray[4*2]; qt_add_rect_to_array(target, vertexArray); - glVertexPointer(2, q_vertexTypeEnum, 0, vertexArray); - glTexCoordPointer(2, q_vertexTypeEnum, 0, texCoordArray); + glVertexPointer(2, GL_FLOAT, 0, vertexArray); + glTexCoordPointer(2, GL_FLOAT, 0, texCoordArray); glEnableClientState(GL_VERTEX_ARRAY); glEnableClientState(GL_TEXTURE_COORD_ARRAY); @@ -4902,7 +4897,7 @@ void QGLWidget::drawTexture(const QPointF &point, QMacCompatGLuint textureI