git-svn-id: svn://db.shs.com.ru/libs@537 a8b55f48-bf90-11e4-a774-851b48703e85

This commit is contained in:
2019-05-27 08:50:09 +00:00
parent 58fce3cd81
commit 5d4eab2341
4 changed files with 169 additions and 0 deletions

39
qglview/openglwindow.h Normal file
View File

@@ -0,0 +1,39 @@
#include <QWindow>
#include <QOpenGLFunctions>
class QPainter;
class QOpenGLContext;
class QOpenGLPaintDevice;
class OpenGLWindow : public QWindow, protected QOpenGLFunctions
{
Q_OBJECT
public:
explicit OpenGLWindow(QWindow *parent = 0);
~OpenGLWindow();
virtual void render(QPainter *painter);
virtual void render();
virtual void initialize();
void setAnimating(bool animating);
QOpenGLContext * context() {return m_context;}
public slots:
void renderLater();
void renderNow();
protected:
bool event(QEvent *event) override;
void exposeEvent(QExposeEvent *event) override;
private:
bool m_animating;
QOpenGLContext *m_context;
QOpenGLPaintDevice *m_device;
};