@@ -30,19 +30,6 @@ void guiAddCameraParams(CylindricalCamera &controller,
3030 }
3131}
3232
33- static void screenshot_taker_gui (SDL_Window *window, std::string &filename) {
34- static std::string out;
35- out.reserve (64ul );
36-
37- ImGui::BeginChild (" screenshot_taker" , {0 , 0 },
38- ImGuiChildFlags_Borders | ImGuiChildFlags_AutoResizeY);
39- guiAddFileDialog (window, DialogFileType::IMAGES, out);
40- if (ImGui::Button (" Take screenshot" ))
41- filename = out.empty () ? generateMediaFilenameFromTimestamp () : out;
42-
43- ImGui::EndChild ();
44- }
45-
4633void Visualizer::defaultGuiCallback () {
4734
4835 // Verify ABI compatibility between caller code and compiled version of Dear
@@ -111,7 +98,19 @@ void Visualizer::defaultGuiCallback() {
11198 " Screenshots"
11299#endif
113100 )) {
114- screenshot_taker_gui (renderer.window , m_currentScreenshotFilename);
101+ ImGui::BeginChild (" screenshot_taker" , {0 , 0 },
102+ ImGuiChildFlags_Borders | ImGuiChildFlags_AutoResizeY);
103+ guiAddFileDialog (renderer.window , DialogFileType::IMAGES,
104+ m_currentScreenshotFilename);
105+ if (ImGui::Button (" Take screenshot" )) {
106+ m_shouldScreenshot = true ;
107+ if (m_currentScreenshotFilename.empty ()) {
108+ generateMediaFilenameFromTimestamp (" cdw_screenshot" ,
109+ m_currentScreenshotFilename);
110+ }
111+ }
112+
113+ ImGui::EndChild ();
115114
116115#ifdef CANDLEWICK_WITH_FFMPEG_SUPPORT
117116 ImGui::BeginChild (" video_record" , {0 , 0 },
0 commit comments