all repos — mgba @ 065474d14e6a154ff1c768df40dca757ae53468f

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
14struct GBAThread;
15
16namespace QGBA {
17
18class DisplayQt : public Display {
19Q_OBJECT
20
21public:
22	DisplayQt(QWidget* parent = nullptr);
23
24public slots:
25	void startDrawing(const uint32_t* buffer, GBAThread* context);
26	void stopDrawing();
27	void pauseDrawing();
28	void unpauseDrawing();
29	void forceDraw();
30	void lockAspectRatio(bool lock);
31	void filter(bool filter);
32
33protected:
34	virtual void paintEvent(QPaintEvent*) override;
35
36private:
37	QTimer m_drawTimer;
38	GBAThread* m_context;
39	QImage m_backing;
40	bool m_lockAspectRatio;
41	bool m_filter;
42};
43
44}
45
46#endif