all repos — mgba @ f6755a6e1b7b0cf2b944cd8ca842746f11d6bf82

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#pragma once
 7
 8#include "Display.h"
 9
10#include <QImage>
11#include <QTimer>
12
13namespace QGBA {
14
15class DisplayQt : public Display {
16Q_OBJECT
17
18public:
19	DisplayQt(QWidget* parent = nullptr);
20
21	void startDrawing(std::shared_ptr<CoreController>) override;
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 stopDrawing() override;
28	void pauseDrawing() override { m_isDrawing = false; }
29	void unpauseDrawing() override { m_isDrawing = true; }
30	void forceDraw() override { update(); }
31	void lockAspectRatio(bool lock) override;
32	void lockIntegerScaling(bool lock) override;
33	void interframeBlending(bool enable) override;
34	void filter(bool filter) override;
35	void framePosted() override;
36	void setShaders(struct VDir*) override {}
37	void clearShaders() override {}
38	void resizeContext() override;
39
40protected:
41	virtual void paintEvent(QPaintEvent*) override;
42
43private:
44	bool m_isDrawing = false;
45	unsigned m_width;
46	unsigned m_height;
47	QImage m_backing{nullptr};
48	QImage m_oldBacking{nullptr};
49	std::shared_ptr<CoreController> m_context = nullptr;
50};
51
52}