More config options, menu bar and global getter for QuickApp.
This commit is contained in:
@@ -7,12 +7,18 @@
|
||||
#include <cstdint>
|
||||
#include <functional>
|
||||
#include <fmt/format.h>
|
||||
#include <imgui.h>
|
||||
#include <mijin/virtual_filesystem/stacked.hpp>
|
||||
#include <SDL3/SDL.h>
|
||||
|
||||
namespace raid
|
||||
{
|
||||
inline constexpr int ERR_INIT_FAILED = 100;
|
||||
inline constexpr ImGuiWindowFlags DEFAULT_MAIN_WINDOW_FLAGS = 0
|
||||
| ImGuiWindowFlags_NoBackground
|
||||
| ImGuiWindowFlags_NoDecoration
|
||||
| ImGuiWindowFlags_NoBringToFrontOnFocus
|
||||
| ImGuiWindowFlags_NoNav;
|
||||
|
||||
enum class MessageSeverity : unsigned char
|
||||
{
|
||||
@@ -30,12 +36,14 @@ struct Message
|
||||
class Application
|
||||
{
|
||||
private:
|
||||
bool mRunning = true;
|
||||
SDL_Window* mWindow = nullptr;
|
||||
SDL_GLContext mGLContext = nullptr;
|
||||
|
||||
mijin::StackedFileSystemAdapter mFS;
|
||||
|
||||
bool mRunning = true;
|
||||
ImGuiWindowFlags mMainWindowFlags = DEFAULT_MAIN_WINDOW_FLAGS;
|
||||
|
||||
using glClear_fn_t = void (*)(std::uint32_t);
|
||||
using glClearColor_fn_t = void (*)(float, float, float, float);
|
||||
|
||||
@@ -44,6 +52,13 @@ private:
|
||||
public:
|
||||
virtual ~Application() = default;
|
||||
|
||||
[[nodiscard]]
|
||||
ImGuiWindowFlags getMainWindowFlags() const { return mMainWindowFlags; }
|
||||
|
||||
void setMainWindowFlags(ImGuiWindowFlags flags) { mMainWindowFlags = flags; }
|
||||
|
||||
void requestQuit() { mRunning = false; }
|
||||
|
||||
[[nodiscard]]
|
||||
int run(int argc, char* argv[]);
|
||||
|
||||
@@ -122,16 +137,20 @@ struct QuickAppOptions
|
||||
render_cb_t render;
|
||||
} callbacks;
|
||||
std::string folderName = "raid";
|
||||
ImGuiWindowFlags mainWindowFlags = DEFAULT_MAIN_WINDOW_FLAGS;
|
||||
};
|
||||
|
||||
class QuickApp : public Application
|
||||
{
|
||||
private:
|
||||
QuickAppOptions mOptions;
|
||||
render_cb_t mRenderCallback;
|
||||
std::string mFolderName;
|
||||
public:
|
||||
void init(QuickAppOptions options);
|
||||
void render() override;
|
||||
std::string getFolderName() override;
|
||||
|
||||
static QuickApp& get();
|
||||
};
|
||||
|
||||
[[nodiscard]]
|
||||
|
||||
Reference in New Issue
Block a user