src/platform/qt/Display.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
7#define QGBA_DISPLAY
8
9#include <QWidget>
10
11struct GBAThread;
12
13namespace QGBA {
14
15class Display : public QWidget {
16Q_OBJECT
17
18public:
19 enum class Driver {
20 QT = 0,
21#ifdef BUILD_GL
22 OPENGL = 1,
23#endif
24 };
25
26 Display(QWidget* parent = nullptr);
27
28 static Display* create(QWidget* parent = nullptr);
29 static void setDriver(Driver driver) { s_driver = driver; }
30
31public slots:
32 virtual void startDrawing(GBAThread* context) = 0;
33 virtual void stopDrawing() = 0;
34 virtual void pauseDrawing() = 0;
35 virtual void unpauseDrawing() = 0;
36 virtual void forceDraw() = 0;
37 virtual void lockAspectRatio(bool lock) = 0;
38 virtual void filter(bool filter) = 0;
39 virtual void framePosted(const uint32_t*) = 0;
40
41 virtual void showMessage(const QString& message) = 0;
42
43private:
44 static Driver s_driver;
45};
46
47}
48
49#endif