all repos — mgba @ f039234055a00181becf186ebceee71bfbbdc597

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