Skip to content

Commit

Permalink
fixed current shader tab
Browse files Browse the repository at this point in the history
  • Loading branch information
ypujante committed Sep 8, 2024
1 parent 0199902 commit cf026e8
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ cmake_minimum_required(VERSION 3.28)
# -G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE=/usr/local/emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -DCMAKE_BUILD_TYPE=Debug

set(wgpu-shader-toy_RELEASE_YEAR "2024")
set(wgpu-shader-toy_RELEASE_MONTH "08" )
set(wgpu-shader-toy_RELEASE_DAY "18" )
set(wgpu-shader-toy_RELEASE_MONTH "09" )
set(wgpu-shader-toy_RELEASE_DAY "08" )

set(wgpu-shader-toy_VERSION "${wgpu-shader-toy_RELEASE_YEAR}.${wgpu-shader-toy_RELEASE_MONTH}.${wgpu-shader-toy_RELEASE_DAY}")

Expand Down
26 changes: 15 additions & 11 deletions src/cpp/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ void MainWindow::renderMainMenuBar()
saveState();
if(ImGui::MenuItem("Export (disk)"))
promptExportProject();
if(ImGui::MenuItem("Quick Export (disk)", getShortcutString("D")))
if(ImGui::MenuItem("Quick Export (disk)", getShortcutString("S")))
exportProject();
if(ImGui::MenuItem("Import (disk)"))
importFromDisk();
Expand Down Expand Up @@ -1106,15 +1106,19 @@ void MainWindow::maybeNewFragmentShader(std::string const &iTitle, std::string c
//------------------------------------------------------------------------
void MainWindow::setCurrentFragmentShader(std::shared_ptr<FragmentShader> iFragmentShader)
{
fCurrentFragmentShader = std::move(iFragmentShader);
if(fLayoutManual)
fFragmentShaderWindow->resize(fCurrentFragmentShader->getWindowSize());
else
fCurrentFragmentShader->setWindowSize(fFragmentShaderWindow->getSize());
fFragmentShaderWindow->setCurrentFragmentShader(fCurrentFragmentShader);
auto title = fmt::printf("WebGPU Shader Toy | %s", fCurrentFragmentShader->getName());
setTitle(title);
fFragmentShaderWindow->setTitle(title);
if(fCurrentFragmentShader != iFragmentShader)
{
fCurrentFragmentShader = std::move(iFragmentShader);
if(fLayoutManual)
fFragmentShaderWindow->resize(fCurrentFragmentShader->getWindowSize());
else
fCurrentFragmentShader->setWindowSize(fFragmentShaderWindow->getSize());
fFragmentShaderWindow->setCurrentFragmentShader(fCurrentFragmentShader);
auto title = fmt::printf("WebGPU Shader Toy | %s", fCurrentFragmentShader->getName());
setTitle(title);
fFragmentShaderWindow->setTitle(title);
fCurrentFragmentShaderNameRequest = fCurrentFragmentShader->getName();
}
}

//------------------------------------------------------------------------
Expand Down Expand Up @@ -1384,7 +1388,7 @@ void MainWindow::newAboutDialog()
ImGui::Text("And to have fun while doing it :)");
ImGui::SeparatorText("Versions");
ImGui::Text("Version: %s", kFullVersion);
ImGui::Text("emscripten: %d.%d.%d", __EMSCRIPTEN_major__, __EMSCRIPTEN_minor__, __EMSCRIPTEN_tiny__);
ImGui::Text("Emscripten: %d.%d.%d", __EMSCRIPTEN_major__, __EMSCRIPTEN_minor__, __EMSCRIPTEN_tiny__);
ImGui::Text("ImGui: %s", IMGUI_VERSION);
ImGui::Text("GLFW: %s", glfwGetVersionString());
})
Expand Down

0 comments on commit cf026e8

Please sign in to comment.