all repos — mgba @ 2391a1090008b92abde4aeb93b13d69b443d6e17

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#include "MessagePainter.h"
11
12#include <QImage>
13#include <QTimer>
14
15struct GBAThread;
16
17namespace QGBA {
18
19class DisplayQt : public Display {
20Q_OBJECT
21
22public:
23	DisplayQt(QWidget* parent = nullptr);
24
25public slots:
26	void startDrawing(GBAThread* context) override;
27	void stopDrawing() override {}
28	void pauseDrawing() override {}
29	void unpauseDrawing() override {}
30	void forceDraw() override { update(); }
31	void lockAspectRatio(bool lock) override;
32	void filter(bool filter) override;
33	void framePosted(const uint32_t*) override;
34
35	void showMessage(const QString& message) override;
36
37protected:
38	virtual void paintEvent(QPaintEvent*) override;
39	virtual void resizeEvent(QResizeEvent*) override;;
40
41private:
42	QImage m_backing;
43	bool m_lockAspectRatio;
44	bool m_filter;
45	MessagePainter m_messagePainter;
46};
47
48}
49
50#endif