summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--test/makefile19
-rw-r--r--test/window_test.cpp24
3 files changed, 44 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index 378eac2..5bb839e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
build
+test/build
diff --git a/test/makefile b/test/makefile
new file mode 100644
index 0000000..11df431
--- /dev/null
+++ b/test/makefile
@@ -0,0 +1,19 @@
+# Compiler
+CPP := c++
+CFLAGS := -Wall -pedantic -std=c++17 -fPIC -I ../include -DDEBUG
+LFLAGS := ../build/libwrapsdl2.so -lSDL2
+
+SRCS := $(wildcard *.cpp)
+OBJS := $(patsubst %.cpp,build/%.o,$(SRCS))
+
+# Recipes
+all: build/window_test
+
+build/window_test: build/window_test.o
+ $(CPP) $(CFLAGS) -o $@ $< $(LFLAGS)
+
+build/%.o: %.cpp build
+ $(CPP) $(CFLAGS) -o $@ -c $<
+
+build:
+ mkdir -p build
diff --git a/test/window_test.cpp b/test/window_test.cpp
new file mode 100644
index 0000000..70fcb1a
--- /dev/null
+++ b/test/window_test.cpp
@@ -0,0 +1,24 @@
+#include "wrapsdl2.hpp"
+#include "video.hpp"
+
+#include <iostream>
+
+int main(int argc, char *argv[]) {
+ wrapsdl2::initialize();
+
+ {
+ wrapsdl2::window win("Window Test", 800, 600);
+
+ std::cout << "press ENTER to show the window" << std::endl;
+ std::cin.get();
+
+ win.show();
+ win.update();
+
+ std::cout << "press ENTER to quit" << std::endl;
+ std::cin.get();
+ }
+
+ wrapsdl2::quit();
+ return 0;
+}