os.hpp 890 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #ifndef SAURA_OS_HPP_
  2. #define SAURA_OS_HPP_
  3. #include <SDL3/SDL.h>
  4. #include <filesystem>
  5. #include <memory>
  6. #include "saura/core/os/os_types.hpp"
  7. #include "saura/core/ui/ui.hpp"
  8. namespace fs = std::filesystem;
  9. namespace saura::os {
  10. class Context {
  11. private:
  12. std::shared_ptr<Window_Context> root_window_ctx;
  13. std::unique_ptr<ui::Context> ui_ctx;
  14. public:
  15. Context();
  16. ~Context();
  17. void draw_begin();
  18. void draw_end();
  19. void update();
  20. bool update_events();
  21. void sleep(double ms);
  22. int get_root_window_width();
  23. int get_root_window_height();
  24. void set_root_window_title(std::string title);
  25. double get_performance_frequency();
  26. double get_performance_counter();
  27. uint32_t get_dpi_scale();
  28. static std::string get_safe_getenv(const std::string key);
  29. static fs::path get_home_config_path();
  30. static std::string get_user_name();
  31. };
  32. } // namespace saura::os
  33. #endif