src/platform/qt/DisplayQt.h (view raw)
1/* Copyright (c) 2013-2015 Jeffrey Pfau
2 *
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6#ifndef QGBA_DISPLAY_QT
7#define QGBA_DISPLAY_QT
8
9#include "Display.h"
10
11#include <QImage>
12#include <QTimer>
13
14struct GBAThread;
15
16namespace QGBA {
17
18class DisplayQt : public Display {
19Q_OBJECT
20
21public:
22 DisplayQt(QWidget* parent = nullptr);
23
24 bool isDrawing() const override { return m_isDrawing; }
25 bool supportsShaders() const override { return false; }
26 VideoShader* shaders() override { return nullptr; }
27
28public slots:
29 void startDrawing(GBAThread* context) override;
30 void stopDrawing() override { m_isDrawing = false; }
31 void pauseDrawing() override { m_isDrawing = false; }
32 void unpauseDrawing() override { m_isDrawing = true; }
33 void forceDraw() override { update(); }
34 void lockAspectRatio(bool lock) override;
35 void filter(bool filter) override;
36 void framePosted(const uint32_t*) override;
37 void setShaders(struct VDir*) override {}
38 void clearShaders() override {}
39
40protected:
41 virtual void paintEvent(QPaintEvent*) override;
42
43private:
44 bool m_isDrawing;
45 QImage m_backing;
46};
47
48}
49
50#endif