| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- #ifndef SAURA_OS_HPP_
- #define SAURA_OS_HPP_
- #include <cstdint>
- #include <filesystem>
- #include <SDL3/SDL_render.h>
- #include <SDL3/SDL_video.h>
- namespace fs = std::filesystem;
- namespace saura {
- class OS {
- struct Window_Context {
- uint32_t w, h;
- std::string title;
- SDL_Window *handle;
- SDL_Renderer *renderer;
- };
- private:
- std::unique_ptr<Window_Context> root_window_ctx;
- public:
- OS();
- ~OS();
- void draw_begin();
- void draw_end();
- void update();
- bool update_events();
- void sleep(double ms);
- int get_root_window_width();
- int get_root_window_height();
- void set_root_window_title(std::string title);
- double get_performance_frequency();
- double get_performance_counter();
- static std::string get_safe_getenv(const std::string key);
- static fs::path get_home_config_path();
- static std::string get_user_name();
- };
- } // namespace saura
- #endif
|