aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClyne Sullivan <clyne@bitgloo.com>2022-05-22 17:59:14 -0400
committerClyne Sullivan <clyne@bitgloo.com>2022-05-22 17:59:14 -0400
commit5846bda565dc100fc73550d937ec910bd29532f3 (patch)
tree175d520edd62a7f3fc6bd19b7376f341f751ce52
parentf3277c3878c4b2e41acd1f35acce6b06a1ca5ac5 (diff)
add help menu
-rw-r--r--source/main.cpp35
1 files changed, 34 insertions, 1 deletions
diff --git a/source/main.cpp b/source/main.cpp
index e0d893e..b5514e4 100644
--- a/source/main.cpp
+++ b/source/main.cpp
@@ -47,7 +47,7 @@ static ImFont *fontMono = nullptr;
template<bool first = false>
static void renderWindow();
-int main(int argc, char *argv[])
+int main(int, char **)
{
if (!guiInitialize())
return -1;
@@ -90,6 +90,8 @@ void log(const std::string& str)
template<bool first>
void renderWindow()
{
+ static bool showHelp = false;
+
// Start the new window frame and render the menu bar.
ImGui_ImplOpenGL2_NewFrame();
ImGui_ImplSDL2_NewFrame();
@@ -99,6 +101,25 @@ void renderWindow()
fileRenderMenu();
deviceRenderMenu();
codeRenderMenu();
+
+ if (ImGui::BeginMenu("Help")) {
+ if (ImGui::MenuItem("Open wiki...")) {
+#ifdef STMDSP_WIN32
+ system("start "
+#else
+ system("xdg-open "
+#endif
+ "https://code.bitgloo.com/clyne/stmdspgui/wiki");
+ }
+
+ ImGui::Separator();
+ if (ImGui::MenuItem("About")) {
+ showHelp = true;
+ }
+
+ ImGui::EndMenu();
+ }
+
ImGui::EndMainMenuBar();
}
@@ -139,6 +160,18 @@ void renderWindow()
deviceRenderDraw();
+ if (showHelp) {
+ ImGui::Begin("help");
+
+ ImGui::Text("stmdspgui\nCompiled on " __DATE__ ".\n\nWritten by Clyne Sullivan.\n");
+
+ if (ImGui::Button("Close")) {
+ showHelp = false;
+ }
+
+ ImGui::End();
+ }
+
// Draw everything to the screen.
guiRender();
}