Go to the
documentation of this file.
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 #ifndef QSCREENEGL_P_H
00043 #define QSCREENEGL_P_H
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056 #include <QtGui/QScreen>
00057 #include <QtOpenGL/qgl.h>
00058 #if defined(QT_OPENGL_ES_2)
00059 #include <EGL/egl.h>
00060 #else
00061 #include <GLES/egl.h>
00062 #endif
00063 #if !defined(EGL_VERSION_1_3) && !defined(QEGL_NATIVE_TYPES_DEFINED)
00064 #undef EGLNativeWindowType
00065 #undef EGLNativePixmapType
00066 #undef EGLNativeDisplayType
00067 typedef NativeWindowType EGLNativeWindowType;
00068 typedef NativePixmapType EGLNativePixmapType;
00069 typedef NativeDisplayType EGLNativeDisplayType;
00070 #define QEGL_NATIVE_TYPES_DEFINED 1
00071 #endif
00072
00073 QT_BEGIN_HEADER
00074
00075 QT_BEGIN_NAMESPACE
00076
00077 QT_MODULE(OpenGL)
00078
00079 class QGLScreenPrivate;
00080
00081 class Q_OPENGL_EXPORT QGLScreenSurfaceFunctions
00082 {
00083 public:
00084 virtual bool createNativeWindow(QWidget *widget, EGLNativeWindowType *native);
00085 virtual bool createNativePixmap(QPixmap *pixmap, EGLNativePixmapType *native);
00086 virtual bool createNativeImage(QImage *image, EGLNativePixmapType *native);
00087 };
00088
00089 class Q_OPENGL_EXPORT QGLScreen : public QScreen
00090 {
00091 Q_DECLARE_PRIVATE(QGLScreen)
00092 public:
00093 QGLScreen(int displayId);
00094 virtual ~QGLScreen();
00095
00096 enum Option
00097 {
00098 NoOptions = 0,
00099 NativeWindows = 1,
00100 NativePixmaps = 2,
00101 NativeImages = 4,
00102 Overlays = 8
00103 };
00104 Q_DECLARE_FLAGS(Options, Option)
00105
00106 QGLScreen::Options options() const;
00107
00108 virtual bool chooseContext(QGLContext *context, const QGLContext *shareContext);
00109 virtual bool hasOpenGL() = 0;
00110
00111 QGLScreenSurfaceFunctions *surfaceFunctions() const;
00112
00113 protected:
00114 void setOptions(QGLScreen::Options value);
00115 void setSurfaceFunctions(QGLScreenSurfaceFunctions *functions);
00116
00117 private:
00118 QGLScreenPrivate *d_ptr;
00119 };
00120
00121 Q_DECLARE_OPERATORS_FOR_FLAGS(QGLScreen::Options)
00122
00123 QT_END_NAMESPACE
00124
00125 QT_END_HEADER
00126
00127 #endif // QSCREENEGL_P_H