diff options
author | Sven Göthel <[email protected]> | 2024-07-14 02:33:00 +0200 |
---|---|---|
committer | Sven Göthel <[email protected]> | 2024-07-14 02:33:00 +0200 |
commit | 5375320c615efc0c4481d3aad8296ad9a48ed6d9 (patch) | |
tree | f798288989e3cf96d70fb5a4a9a1cba96d7dfc9a /include/pixel/pixel.hpp | |
parent | b9dbd3a453b7c803be1b6d1ec323ef595ddc8ea8 (diff) |
pixel::init_gfx_subsystem: Return true if successful, otherwise false - don't just exit(1); Also validate sdl_win, sdl_win_id and sdl_rend
Diffstat (limited to 'include/pixel/pixel.hpp')
-rw-r--r-- | include/pixel/pixel.hpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/pixel/pixel.hpp b/include/pixel/pixel.hpp index 2e50693..78aa41b 100644 --- a/include/pixel/pixel.hpp +++ b/include/pixel/pixel.hpp @@ -39,6 +39,8 @@ #include <iostream> #include <cctype> +#include <pixel/version.hpp> + #if defined(__EMSCRIPTEN__) #include <emscripten.h> #else @@ -459,7 +461,7 @@ namespace pixel { // /** GFX Toolkit: Initialize a window of given size with a usable framebuffer. */ - void init_gfx_subsystem(const char* title, int window_width, int window_height, const float origin_norm[2], + bool init_gfx_subsystem(const char* title, int window_width, int window_height, const float origin_norm[2], bool enable_vsync=true, bool use_subsys_primitives=true); /** GFX Toolkit: Clear the soft-framebuffer. */ void clear_pixel_fb(uint8_t r, uint8_t g, uint8_t b, uint8_t a) noexcept; |