blob: 9af931bf6cc80731f40caafe8c29bf670b31737d (
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
34
35
36
37
38
39
40
41
42
|
#ifndef QCOCOAGLCONTEXT_H
#define QCOCOAGLCONTEXT_H
#include <QtCore/QWeakPointer>
#include <QtGui/QPlatformGLContext>
#include <QtGui/QGuiGLContext>
#include <QtGui/QWindow>
#include <Cocoa/Cocoa.h>
QT_BEGIN_NAMESPACE
class QCocoaGLContext : public QPlatformGLContext
{
public:
QCocoaGLContext(const QSurfaceFormat &format, QPlatformGLContext *share);
QSurfaceFormat format() const;
void swapBuffers(QPlatformSurface *surface);
bool makeCurrent(QPlatformSurface *surface);
void doneCurrent();
void (*getProcAddress(const QByteArray &procName)) ();
void update();
static NSOpenGLPixelFormat *createNSOpenGLPixelFormat();
NSOpenGLContext *nsOpenGLContext() const;
private:
void setActiveWindow(QWindow *window);
NSOpenGLContext *m_context;
QSurfaceFormat m_format;
QWeakPointer<QWindow> m_currentWindow;
};
QT_END_NAMESPACE
#endif // QCOCOAGLCONTEXT_H
|