summaryrefslogtreecommitdiffstats
path: root/wrapsdl2.cpp
diff options
context:
space:
mode:
authorNao Pross <naopross@thearcway.org>2019-01-21 04:48:02 +0100
committerNao Pross <naopross@thearcway.org>2019-01-21 04:48:02 +0100
commitca091e358a8b02423ba304bfca055712b3a70881 (patch)
tree71252ee4f0316387fd2c335fe299313b5b313167 /wrapsdl2.cpp
parentInitial commit, add makefile, .gitignore and debug header (diff)
downloadlibwsdl2-ca091e358a8b02423ba304bfca055712b3a70881.tar.gz
libwsdl2-ca091e358a8b02423ba304bfca055712b3a70881.zip
Add basic window wrapper
Diffstat (limited to '')
-rw-r--r--wrapsdl2.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/wrapsdl2.cpp b/wrapsdl2.cpp
new file mode 100644
index 0000000..6c7896f
--- /dev/null
+++ b/wrapsdl2.cpp
@@ -0,0 +1,19 @@
+#include "wrapsdl2.hpp"
+#include "debug.hpp"
+
+extern "C" {
+#include <SDL2/SDL.h>
+}
+
+bool wrapsdl2::initialize(void) {
+ if (SDL_InitSubSystem(SDL_INIT_VIDEO) < 0) {
+ npdebug("failed to initialize sdl video subsystem");
+ return false;
+ }
+
+ return true;
+}
+
+void wrapsdl2::quit(void) {
+ SDL_Quit();
+}