From 2914d264ded33d236f0dbd78f899b0003d3b9d52 Mon Sep 17 00:00:00 2001 From: Nao Pross Date: Tue, 22 Jan 2019 15:34:56 +0100 Subject: Rename library from libwrapsdl2 to libwsdl2 --- event.cpp | 4 ++-- include/event.hpp | 2 +- include/video.hpp | 2 +- include/wrapsdl2.hpp | 23 ----------------------- include/wsdl2.hpp | 23 +++++++++++++++++++++++ test/window_test.cpp | 8 ++++---- video.cpp | 2 +- wrapsdl2.cpp | 8 ++++---- 8 files changed, 36 insertions(+), 36 deletions(-) delete mode 100644 include/wrapsdl2.hpp create mode 100644 include/wsdl2.hpp diff --git a/event.cpp b/event.cpp index 72de51c..60d432e 100644 --- a/event.cpp +++ b/event.cpp @@ -6,11 +6,11 @@ extern "C" { #include } -wrapsdl2::event::event(const SDL_Event& e) { +wsdl2::event::event(const SDL_Event& e) { m_event = e; } -std::optional wrapsdl2::poll_event() { +std::optional wsdl2::poll_event() { SDL_Event ev; if (SDL_PollEvent(&ev) != 0) { diff --git a/include/event.hpp b/include/event.hpp index b992852..9932cb8 100644 --- a/include/event.hpp +++ b/include/event.hpp @@ -6,7 +6,7 @@ extern "C" { #include } -namespace wrapsdl2 { +namespace wsdl2 { class event { public: using type = SDL_EventType; diff --git a/include/video.hpp b/include/video.hpp index 2749d11..a00f77e 100644 --- a/include/video.hpp +++ b/include/video.hpp @@ -8,7 +8,7 @@ extern "C" { #include } -namespace wrapsdl2 { +namespace wsdl2 { typedef SDL_Point point; typedef SDL_Rect rect; diff --git a/include/wrapsdl2.hpp b/include/wrapsdl2.hpp deleted file mode 100644 index 2f28890..0000000 --- a/include/wrapsdl2.hpp +++ /dev/null @@ -1,23 +0,0 @@ -#pragma once - -extern "C" { -#include -} - -namespace wrapsdl2 { - bool initialize(void); - void quit(void); - - namespace util { - constexpr inline bool sdl_bool(SDL_bool b) { - return b == SDL_TRUE; - } - - constexpr inline SDL_bool sdl_bool(bool b) { - return (b) ? SDL_TRUE : SDL_FALSE; - } - } - - // tool functions - void delay(unsigned ms); -} \ No newline at end of file diff --git a/include/wsdl2.hpp b/include/wsdl2.hpp new file mode 100644 index 0000000..16564ac --- /dev/null +++ b/include/wsdl2.hpp @@ -0,0 +1,23 @@ +#pragma once + +extern "C" { +#include +} + +namespace wsdl2 { + bool initialize(void); + void quit(void); + + namespace util { + constexpr inline bool sdl_bool(SDL_bool b) { + return b == SDL_TRUE; + } + + constexpr inline SDL_bool sdl_bool(bool b) { + return (b) ? SDL_TRUE : SDL_FALSE; + } + } + + // tool functions + void delay(unsigned ms); +} \ No newline at end of file diff --git a/test/window_test.cpp b/test/window_test.cpp index c473a34..17c7cf4 100644 --- a/test/window_test.cpp +++ b/test/window_test.cpp @@ -1,6 +1,6 @@ #include "../debug.hpp" -#include "wrapsdl2.hpp" +#include "wsdl2.hpp" #include "video.hpp" #include "event.hpp" @@ -10,9 +10,9 @@ int main(int argc, char *argv[]) { - using namespace wrapsdl2; + using namespace wsdl2; - wrapsdl2::initialize(); + wsdl2::initialize(); window win("Window Test", 800, 600); std::mutex win_mutex; @@ -47,6 +47,6 @@ int main(int argc, char *argv[]) { win_update.join(); - wrapsdl2::quit(); + wsdl2::quit(); return 0; } diff --git a/video.cpp b/video.cpp index 71544fe..68beff7 100644 --- a/video.cpp +++ b/video.cpp @@ -8,7 +8,7 @@ extern "C" { #include } -using namespace wrapsdl2; +using namespace wsdl2; /* class window */ diff --git a/wrapsdl2.cpp b/wrapsdl2.cpp index 3828abc..a0fa624 100644 --- a/wrapsdl2.cpp +++ b/wrapsdl2.cpp @@ -1,4 +1,4 @@ -#include "wrapsdl2.hpp" +#include "wsdl2.hpp" #include "debug.hpp" #ifdef WRAPSDL2_EXCEPTIONS @@ -9,7 +9,7 @@ extern "C" { #include } -bool wrapsdl2::initialize(void) { +bool wsdl2::initialize(void) { if (SDL_InitSubSystem(SDL_INIT_VIDEO) < 0) { #ifdef WRAPSDL2_EXCEPTIONS throw std::runtime_error("failed to initialize sdl video subsystem"); @@ -29,7 +29,7 @@ bool wrapsdl2::initialize(void) { return true; } -void wrapsdl2::quit(void) { +void wsdl2::quit(void) { if (SDL_WasInit(SDL_INIT_VIDEO)) SDL_QuitSubSystem(SDL_INIT_VIDEO); @@ -43,6 +43,6 @@ void wrapsdl2::quit(void) { -void wrapsdl2::delay(unsigned ms) { +void wsdl2::delay(unsigned ms) { SDL_Delay(ms); } \ No newline at end of file -- cgit v1.2.1