all repos — mgba @ ef68c84e76bfd95b454bcbc3eec4d6946d23a282

mGBA Game Boy Advance Emulator

src/platform/qt/ShaderSelector.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_SHADER_SELECTOR_H
 7#define QGBA_SHADER_SELECTOR_H
 8
 9#include <QDialog>
10
11#include "ui_ShaderSelector.h"
12
13struct GBAGLES2Shader;
14class QGridLayout;
15struct VideoShader;
16
17namespace QGBA {
18
19class ConfigController;
20class Display;
21
22class ShaderSelector : public QDialog {
23Q_OBJECT
24
25public:
26	ShaderSelector(Display* display, ConfigController* config, QWidget* parent = nullptr);
27	~ShaderSelector();
28
29public slots:
30	void refreshShaders();
31	void clear();
32
33private slots:
34	void selectShader();
35	void loadShader(const QString& path);
36	void clearShader();
37	void buttonPressed(QAbstractButton*);
38
39signals:
40	void saved();
41	void reset();
42	void resetToDefault();
43
44private:
45	void addUniform(QGridLayout*, const QString& section, const QString& name, float* value, float min, float max, int y, int x);
46	void addUniform(QGridLayout*, const QString& section, const QString& name, int* value, int min, int max, int y, int x);
47	QWidget* makePage(GBAGLES2Shader*, const QString& name, int pass);
48
49	Ui::ShaderSelector m_ui;
50	Display* m_display;
51	ConfigController* m_config;
52	VideoShader* m_shaders;
53	QString m_shaderPath;
54};
55
56}
57
58#endif