all repos — mgba @ f6f3cb5d3d8b91dd603772ea0eebb2513562a0cf

mGBA Game Boy Advance Emulator

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
14namespace QGBA {
15
16class DisplayQt : public Display {
17Q_OBJECT
18
19public:
20	DisplayQt(QWidget* parent = nullptr);
21
22	bool isDrawing() const override { return m_isDrawing; }
23	bool supportsShaders() const override { return false; }
24	VideoShader* shaders() override { return nullptr; }
25
26public slots:
27	void startDrawing(mCoreThread* context) override;
28	void stopDrawing() override { m_isDrawing = false; }
29	void pauseDrawing() override { m_isDrawing = false; }
30	void unpauseDrawing() override { m_isDrawing = true; }
31	void forceDraw() override { update(); }
32	void lockAspectRatio(bool lock) override;
33	void lockIntegerScaling(bool lock) override;
34	void filter(bool filter) override;
35	void framePosted(const uint32_t*) override;
36	void setShaders(struct VDir*) override {}
37	void clearShaders() override {}
38
39protected:
40	virtual void paintEvent(QPaintEvent*) override;
41
42private:
43	bool m_isDrawing = false;
44	unsigned m_width;
45	unsigned m_height;
46	QImage m_backing{nullptr};
47};
48
49}
50
51#endif