init the renderer on demand, instead of always ready

This commit is contained in:
Joakim L. Gilje
2021-12-15 19:58:09 +01:00
parent cf79387f35
commit d2115bc5e4
4 changed files with 52 additions and 35 deletions

View File

@@ -31,6 +31,13 @@ public:
event->ignore();
}
enum class Renderer {
Software,
OpenGL,
OpenGLES,
};
void switchRenderer(Renderer renderer);
signals:
void blitToRenderer(const QImage& img, int, int, int, int);
@@ -38,9 +45,6 @@ public slots:
void blit(int x, int y, int w, int h);
void mousePoll();
private slots:
void on_RendererStack_currentChanged(int arg1);
private:
Ui::RendererStack *ui;
@@ -57,6 +61,8 @@ private:
// when calling bits();
int currentBuf = 0;
QVector<QImage> imagebufs;
QWidget* current = nullptr;
};
#endif // QT_RENDERERCONTAINER_HPP