Write ImGui config to an appropriate folder instead of the current one.
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
#include <cstdint>
|
||||
#include <functional>
|
||||
#include <fmt/format.h>
|
||||
#include <mijin/virtual_filesystem/stacked.hpp>
|
||||
#include <SDL3/SDL.h>
|
||||
|
||||
namespace raid
|
||||
@@ -33,6 +34,8 @@ private:
|
||||
SDL_Window* mWindow = nullptr;
|
||||
SDL_GLContext mGLContext = nullptr;
|
||||
|
||||
mijin::StackedFileSystemAdapter mFS;
|
||||
|
||||
using glClear_fn_t = void (*)(std::uint32_t);
|
||||
using glClearColor_fn_t = void (*)(float, float, float, float);
|
||||
|
||||
@@ -46,6 +49,7 @@ public:
|
||||
|
||||
protected:
|
||||
virtual void render() = 0;
|
||||
virtual std::string getFolderName() = 0;
|
||||
virtual void handleMessage(const Message& message);
|
||||
virtual void handleSDLEvent(const SDL_Event& event);
|
||||
|
||||
@@ -106,6 +110,8 @@ private:
|
||||
bool initImGui();
|
||||
void cleanup();
|
||||
void handleSDLEvents();
|
||||
void loadImGuiConfig();
|
||||
void saveImGuiConfig();
|
||||
};
|
||||
|
||||
using render_cb_t = std::function<void()>;
|
||||
@@ -115,6 +121,7 @@ struct QuickAppOptions
|
||||
{
|
||||
render_cb_t render;
|
||||
} callbacks;
|
||||
std::string folderName = "raid";
|
||||
};
|
||||
|
||||
class QuickApp : public Application
|
||||
@@ -124,6 +131,7 @@ private:
|
||||
public:
|
||||
void init(QuickAppOptions options);
|
||||
void render() override;
|
||||
std::string getFolderName() override;
|
||||
};
|
||||
|
||||
[[nodiscard]]
|
||||
|
||||
Reference in New Issue
Block a user