diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/input.hpp | 0 | ||||
-rw-r--r-- | include/video.hpp | 14 | ||||
-rw-r--r-- | include/wrapsdl2.hpp | 16 |
3 files changed, 26 insertions, 4 deletions
diff --git a/include/input.hpp b/include/input.hpp deleted file mode 100644 index e69de29..0000000 --- a/include/input.hpp +++ /dev/null diff --git a/include/video.hpp b/include/video.hpp index 1b6e022..45b1fc5 100644 --- a/include/video.hpp +++ b/include/video.hpp @@ -1,11 +1,16 @@ #pragma once #include <string> +#include <array> -class SDL_Window; -class SDL_Surface; +extern "C" { +#include <SDL2/SDL_video.h> +} namespace wrapsdl2 { + typedef SDL_Point point; + typedef SDL_Rect rect; + class window { public: window() = delete; @@ -14,11 +19,14 @@ namespace wrapsdl2 { window(const std::string& title, std::size_t width, std::size_t height); ~window(); - // manipulation + // setters void show(); void hide(); void raise(); + // getters + bool visible(); + // rendering void update(); diff --git a/include/wrapsdl2.hpp b/include/wrapsdl2.hpp index 993a704..847ed99 100644 --- a/include/wrapsdl2.hpp +++ b/include/wrapsdl2.hpp @@ -1,9 +1,23 @@ #pragma once +extern "C" { +#include <SDL2/SDL.h> +} + namespace wrapsdl2 { bool initialize(void); void quit(void); + + namespace util { + constexpr bool sdl_bool(SDL_bool b) { + return b == SDL_TRUE; + } + + constexpr SDL_bool sdl_bool(bool b) { + return (b) ? SDL_TRUE : SDL_FALSE; + } + } // tool functions - void delay() + void delay(unsigned ms); }
\ No newline at end of file |