code format
This commit is contained in:
@@ -1,38 +1,40 @@
|
||||
#include <QWindow>
|
||||
#include <QOpenGLExtraFunctions>
|
||||
#include <QWindow>
|
||||
|
||||
class QPainter;
|
||||
class QOpenGLContext;
|
||||
class QOpenGLPaintDevice;
|
||||
|
||||
|
||||
class OpenGLWindow : public QWindow, public QOpenGLExtraFunctions {
|
||||
class OpenGLWindow
|
||||
: public QWindow
|
||||
, public QOpenGLExtraFunctions {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit OpenGLWindow(QWindow *parent = nullptr);
|
||||
explicit OpenGLWindow(QWindow * parent = nullptr);
|
||||
virtual ~OpenGLWindow() {}
|
||||
|
||||
virtual void render() {}
|
||||
virtual void initialize() {}
|
||||
|
||||
QOpenGLContext * context() {return m_context;}
|
||||
QOpenGLContext * context() { return m_context; }
|
||||
void setVSync(bool on);
|
||||
bool getVSync() const;
|
||||
// void setSamples(int samples);
|
||||
// int getSamples() const;
|
||||
int getFrameCounter() const {return frame_cnt;}
|
||||
// void setSamples(int samples);
|
||||
// int getSamples() const;
|
||||
int getFrameCounter() const { return frame_cnt; }
|
||||
|
||||
public slots:
|
||||
void renderLater();
|
||||
void renderNow();
|
||||
|
||||
protected:
|
||||
bool event(QEvent *event) override;
|
||||
void exposeEvent(QExposeEvent *event) override;
|
||||
bool event(QEvent * event) override;
|
||||
void exposeEvent(QExposeEvent * event) override;
|
||||
|
||||
private:
|
||||
QOpenGLContext * m_context = nullptr;
|
||||
bool format_change = false;
|
||||
int frame_cnt = 0;
|
||||
bool format_change = false;
|
||||
int frame_cnt = 0;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user