From 18c95a7226148747ae886eb4992d2424cd80aae8 Mon Sep 17 00:00:00 2001 From: Harry Jeffery Date: Mon, 12 Aug 2019 00:28:24 +0100 Subject: Dummy windows for unit testing --- Makefile | 2 +- src/dummy_window.c | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 97 insertions(+), 1 deletion(-) create mode 100644 src/dummy_window.c diff --git a/Makefile b/Makefile index e6729cb..bf1f8e1 100644 --- a/Makefile +++ b/Makefile @@ -117,7 +117,7 @@ $(BUILDDIR): $(BUILDDIR)/%.o: src/%.c Makefile $(CC) -c $(CFLAGS) $(CPPFLAGS) -o $@ $< -$(BUILDDIR)/test_%: test/%.c $(filter-out src/main.c, $(SOURCES)) +$(BUILDDIR)/test_%: test/%.c src/dummy_window.c $(filter-out src/main.c, $(SOURCES)) $(CC) -o $@ -Isrc $(TFLAGS) $^ $(LDFLAGS) $(TLIBS) check: $(BUILDDIR) $(TESTS) diff --git a/src/dummy_window.c b/src/dummy_window.c new file mode 100644 index 0000000..ae6e9c3 --- /dev/null +++ b/src/dummy_window.c @@ -0,0 +1,96 @@ +#include "window.h" + +#include +#include + +struct imv_window *imv_window_create(int w, int h, const char *title) +{ + (void)w; + (void)h; + (void)title; + return NULL; +} + +void imv_window_free(struct imv_window *window) +{ + (void)window; +} + +void imv_window_clear(struct imv_window *window, unsigned char r, + unsigned char g, unsigned char b) +{ + (void)window; + (void)r; + (void)g; + (void)b; +} + +void imv_window_get_size(struct imv_window *window, int *w, int *h) +{ + (void)window; + (void)w; + (void)h; +} + +void imv_window_get_framebuffer_size(struct imv_window *window, int *w, int *h) +{ + (void)window; + (void)w; + (void)h; +} + +void imv_window_set_title(struct imv_window *window, const char *title) +{ + (void)window; + (void)title; +} + +bool imv_window_is_fullscreen(struct imv_window *window) +{ + (void)window; + return false; +} + +void imv_window_set_fullscreen(struct imv_window *window, bool fullscreen) +{ + (void)window; + (void)fullscreen; +} + +bool imv_window_get_mouse_button(struct imv_window *window, int button) +{ + (void)window; + (void)button; + return false; +} + +void imv_window_get_mouse_position(struct imv_window *window, double *x, double *y) +{ + (void)window; + (void)x; + (void)y; +} + +void imv_window_present(struct imv_window *window) +{ + (void)window; +} + +void imv_window_wait_for_event(struct imv_window *window, double timeout) +{ + (void)window; + (void)timeout; +} + +void imv_window_push_event(struct imv_window *window, struct imv_event *e) +{ + (void)window; + (void)e; +} + +void imv_window_pump_events(struct imv_window *window, imv_event_handler handler, void *data) +{ + (void)window; + (void)handler; + (void)data; +} -- cgit v1.2.3