mirror of
https://github.com/rwengine/openrw.git
synced 2024-09-04 01:29:45 +02:00
29 lines
538 B
C++
29 lines
538 B
C++
#ifndef _RWVIEWER_QOPENGLWRAPPER_HPP
|
|
#define _RWVIEWER_QOPENGLWRAPPER_HPP
|
|
|
|
#include <QSurfaceFormat>
|
|
|
|
class QOpenGLContext;
|
|
class QSurface;
|
|
class QWidget;
|
|
|
|
class QOpenGLContextWrapper {
|
|
public:
|
|
QOpenGLContextWrapper(QWidget *parent);
|
|
void setup(QSurfaceFormat format);
|
|
bool create();
|
|
|
|
bool makeCurrent(QSurface *surface);
|
|
void doneCurrent();
|
|
void swapBuffers(QSurface *surface);
|
|
|
|
QOpenGLContext *get() {
|
|
return m_context;
|
|
}
|
|
private:
|
|
QOpenGLContext *m_context;
|
|
QWidget *m_parent;
|
|
};
|
|
|
|
#endif
|