1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-22 10:22:52 +01:00
openrw/rwviewer/QOpenGLContextWrapper.hpp

29 lines
538 B
C++
Raw Normal View History

2018-08-10 02:40:23 +02:00
#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