1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-22 02:12:45 +01:00
openrw/rwviewer/QOpenGLContextWrapper.hpp
2018-08-10 03:53:54 +02:00

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