5#ifndef QOPENGLCONTEXT_PLATFORM_H
6#define QOPENGLCONTEXT_PLATFORM_H
19#include <QtGui/qtguiglobal.h>
20#include <QtGui/qopenglcontext.h>
21#include <QtGui/qwindowdefs.h>
23#include <QtCore/qnativeinterface.h>
25#if defined(Q_OS_MACOS)
26Q_FORWARD_DECLARE_OBJC_CLASS(NSOpenGLContext);
29#if QT_CONFIG(xcb_glx_plugin)
30struct __GLXcontextRec;
typedef struct __GLXcontextRec *GLXContext;
33typedef void *EGLContext;
34typedef void *EGLDisplay;
35typedef void *EGLConfig;
38#if !defined(Q_OS_MACOS) && defined(Q_QDOC)
39typedef void *NSOpenGLContext;
44namespace QNativeInterface {
46#if defined(Q_OS_MACOS) || defined(Q_QDOC)
47struct Q_GUI_EXPORT QCocoaGLContext
49 QT_DECLARE_NATIVE_INTERFACE(QCocoaGLContext, 1, QOpenGLContext)
50 static QOpenGLContext *fromNative(QT_IGNORE_DEPRECATIONS(NSOpenGLContext) *context, QOpenGLContext *shareContext =
nullptr);
51 virtual QT_IGNORE_DEPRECATIONS(NSOpenGLContext) *nativeContext()
const = 0;
55#if defined(Q_OS_WIN) || defined(Q_QDOC)
56struct Q_GUI_EXPORT QWGLContext
58 QT_DECLARE_NATIVE_INTERFACE(QWGLContext, 1, QOpenGLContext)
59 static HMODULE openGLModuleHandle();
60 static QOpenGLContext *fromNative(HGLRC context, HWND window, QOpenGLContext *shareContext =
nullptr);
61 virtual HGLRC nativeContext()
const = 0;
65#if QT_CONFIG(xcb_glx_plugin) || defined(Q_QDOC)
66struct Q_GUI_EXPORT QGLXContext
68 QT_DECLARE_NATIVE_INTERFACE(QGLXContext, 1, QOpenGLContext)
69 static QOpenGLContext *fromNative(GLXContext configBasedContext, QOpenGLContext *shareContext =
nullptr);
70 static QOpenGLContext *fromNative(GLXContext visualBasedContext,
void *visualInfo, QOpenGLContext *shareContext =
nullptr);
71 virtual GLXContext nativeContext()
const = 0;
75#if QT_CONFIG(egl) || defined(Q_QDOC)
76struct Q_GUI_EXPORT QEGLContext
78 QT_DECLARE_NATIVE_INTERFACE(QEGLContext, 1, QOpenGLContext)
79 static QOpenGLContext *fromNative(EGLContext context, EGLDisplay display, QOpenGLContext *shareContext =
nullptr);
80 virtual EGLContext nativeContext()
const = 0;
81 virtual EGLConfig config()
const = 0;
82 virtual EGLDisplay display()
const = 0;
84 virtual void invalidateContext() = 0;