#pragma once

#include <functional>

namespace fn {

struct AppConfig {
    const char* title = "fn_registry";
    int width = 1280;
    int height = 720;
    bool vsync = true;
    float bg_r = 0.1f;
    float bg_g = 0.1f;
    float bg_b = 0.1f;
};

// Run an ImGui application. The render_fn is called every frame
// between ImGui::NewFrame() and ImGui::Render().
// Returns 0 on clean exit, 1 on error.
int run_app(AppConfig config, std::function<void()> render_fn);

// Convenience: run with default config
int run_app(std::function<void()> render_fn);

} // namespace fn
