all repos — mgba @ 129af691054cb1acffd9a2be9eb9f1dbf47f51df

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