win_openg: Added menu item to remove active shader.

This commit is contained in:
ts-korhonen
2021-04-26 09:51:23 +03:00
parent 147175677d
commit fcac2d7e78
3 changed files with 11 additions and 0 deletions

View File

@@ -350,6 +350,7 @@
#define IDM_VID_GL_FPS_75 40105
#define IDM_VID_GL_VSYNC 40106
#define IDM_VID_GL_SHADER 40107
#define IDM_VID_GL_NOSHADER 40108
#endif
#define IDM_LOG_BREAKPOINT 51201

View File

@@ -251,6 +251,7 @@ BEGIN
END
MENUITEM "&VSync", IDM_VID_GL_VSYNC
MENUITEM "&Select shader...", IDM_VID_GL_SHADER
MENUITEM "&Remove shader", IDM_VID_GL_NOSHADER
END
#endif

View File

@@ -234,6 +234,7 @@ show_render_options_menu()
CheckMenuItem(menuMain, IDM_VID_GL_FPS_60, video_framerate == 60 ? MF_CHECKED : MF_UNCHECKED);
CheckMenuItem(menuMain, IDM_VID_GL_FPS_75, video_framerate == 75 ? MF_CHECKED : MF_UNCHECKED);
CheckMenuItem(menuMain, IDM_VID_GL_VSYNC, video_vsync ? MF_CHECKED : MF_UNCHECKED);
EnableMenuItem(menuMain, IDM_VID_GL_NOSHADER, strlen(video_shader) > 0 ? MF_ENABLED : MF_DISABLED);
break;
}
}
@@ -778,10 +779,18 @@ MainWindowProcedure(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
case IDM_VID_GL_SHADER:
win_notify_dlg_open();
if (file_dlg_st(hwnd, IDS_2143, video_shader, NULL, 0) == 0)
{
strcpy_s(video_shader, sizeof(video_shader), openfilestring);
EnableMenuItem(menuMain, IDM_VID_GL_NOSHADER, strlen(video_shader) > 0 ? MF_ENABLED : MF_DISABLED);
}
win_notify_dlg_closed();
plat_vid_reload_options();
break;
case IDM_VID_GL_NOSHADER:
video_shader[0] = '\0';
EnableMenuItem(menuMain, IDM_VID_GL_NOSHADER, MF_DISABLED);
plat_vid_reload_options();
break;
#endif
case IDM_VID_FULLSCREEN: