2019-09-18 18:11:37 +02:00
|
|
|
/*****************************************************************************\
|
|
|
|
Snes9x - Portable Super Nintendo Entertainment System (TM) emulator.
|
|
|
|
This file is licensed under the Snes9x License.
|
|
|
|
For further information, consult the LICENSE file in the root directory.
|
|
|
|
\*****************************************************************************/
|
|
|
|
|
2018-05-24 18:12:35 +02:00
|
|
|
#pragma once
|
|
|
|
#include "windows.h"
|
|
|
|
#include "../shaders/glsl.h"
|
2023-02-01 21:47:42 +01:00
|
|
|
#include <functional>
|
2018-05-24 18:12:35 +02:00
|
|
|
|
|
|
|
typedef void(*APPLYCALLBACK) ();
|
|
|
|
|
|
|
|
class CShaderParamDlg
|
|
|
|
{
|
|
|
|
private:
|
|
|
|
static INT_PTR CALLBACK DlgShaderParams(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
|
2018-05-25 22:24:32 +02:00
|
|
|
static INT_PTR CALLBACK WndProcContainerStatic(HWND hStatic, UINT msg, WPARAM wParam, LPARAM lParam);
|
2018-05-24 18:12:35 +02:00
|
|
|
void createContent(HWND hDlg);
|
2023-02-14 00:54:57 +01:00
|
|
|
void resize(HWND hDlg);
|
2018-05-24 18:12:35 +02:00
|
|
|
void get_changed_parameters(HWND hDlg);
|
2018-05-25 22:24:32 +02:00
|
|
|
void handle_up_down(HWND hStatic, int id, int change);
|
2018-05-24 18:12:35 +02:00
|
|
|
void save_custom_shader();
|
2018-05-25 22:24:32 +02:00
|
|
|
void apply_changes(HWND hDlg);
|
2023-02-14 00:54:57 +01:00
|
|
|
void trackbar_changed(HWND trackbar);
|
2018-05-24 18:12:35 +02:00
|
|
|
|
|
|
|
HFONT hFont;
|
|
|
|
unsigned int avgCharWidth;
|
|
|
|
unsigned int avgCharHeight;
|
2023-02-14 00:54:57 +01:00
|
|
|
unsigned int maxDescriptionWidth;
|
2018-05-24 18:12:35 +02:00
|
|
|
int scrollpos;
|
2023-02-01 21:47:42 +01:00
|
|
|
std::vector<GLSLParam>& parameters;
|
|
|
|
std::vector<GLSLParam> saved_parameters;
|
|
|
|
std::function<void (const char *)> save_function;
|
2018-05-24 18:12:35 +02:00
|
|
|
|
2023-02-14 00:54:57 +01:00
|
|
|
struct ParameterWidgetSet
|
|
|
|
{
|
|
|
|
HWND label;
|
|
|
|
HWND trackbar;
|
|
|
|
HWND entry;
|
|
|
|
HWND updown;
|
|
|
|
};
|
|
|
|
std::vector<ParameterWidgetSet> parameter_widgets;
|
|
|
|
|
2018-05-25 22:24:32 +02:00
|
|
|
WNDPROC oldStaticProc;
|
|
|
|
|
2018-05-24 18:12:35 +02:00
|
|
|
public:
|
2023-02-01 21:47:42 +01:00
|
|
|
CShaderParamDlg(std::vector<GLSLParam> ¶meters, std::function<void (const char *)> save_function);
|
2018-05-24 18:12:35 +02:00
|
|
|
virtual ~CShaderParamDlg();
|
|
|
|
|
|
|
|
bool show();
|
|
|
|
};
|
|
|
|
|