win32: pass around active shader to parameter dialog

This commit is contained in:
OV2 2019-02-01 22:41:29 +01:00
parent 1ea9bcf560
commit 7045cd8478
4 changed files with 22 additions and 8 deletions

View File

@ -82,6 +82,10 @@ public:
bool SetFullscreen(bool fullscreen);
void SetSnes9xColorFormat(void);
void EnumModes(std::vector<dMode> *modeVector);
GLSLShader *GetActiveShader()
{
return glslShader;
}
};

View File

@ -617,6 +617,11 @@ int WinGetAutomaticInputRate(void)
return (int)newInputRate;
}
GLSLShader *WinGetActiveGLSLShader()
{
return OpenGL.GetActiveShader();
}
/* Depth conversion functions begin */
void Convert16To24 (SSurface *src, SSurface *dst, RECT *srect)

View File

@ -10,6 +10,7 @@
#include "wsnes9x.h"
#include "port.h"
#include "render.h"
#include "../shaders/glsl.h"
#include <vector>
#define IsHiRes(x) ((x.Height > SNES_HEIGHT_EXTENDED || x.Width == 512))
@ -40,5 +41,6 @@ char *ReadShaderFileContents(const TCHAR *filename);
void ReduceToPath(TCHAR *filename);
double WinGetRefreshRate();
int WinGetAutomaticInputRate();
GLSLShader *WinGetActiveGLSLShader();
#endif

View File

@ -7740,14 +7740,17 @@ INT_PTR CALLBACK DlgFunky(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam)
break;
}
ShowWindow(hDlg, SW_HIDE);
GLSLShader shader;
shader.load_shader(_tToChar(GUI.OGLshaderFileName));
CShaderParamDlg dlg(shader);
if(dlg.show()) {
WinDisplayApplyChanges();
WinRefreshDisplay();
GLSLShader *shader = WinGetActiveGLSLShader();
if (shader) {
CShaderParamDlg dlg(*shader);
if (dlg.show()) {
SetDlgItemText(hDlg, IDC_SHADER_GLSL_FILE, GUI.OGLshaderFileName);
WinDisplayApplyChanges();
WinRefreshDisplay();
}
}
ShowWindow(hDlg, SW_SHOW);
break;
}