From c3624cdefb7ff0c4b69316c7c1b740b97f55e1db Mon Sep 17 00:00:00 2001 From: Martin Gerhardy Date: Thu, 3 Mar 2016 14:39:57 +0100 Subject: added test program for sdl2 --- src/sdl2-test.c | 22 ++++++++++++++++++++++ src/sdl2.mk | 6 ++++++ 2 files changed, 28 insertions(+) create mode 100644 src/sdl2-test.c diff --git a/src/sdl2-test.c b/src/sdl2-test.c new file mode 100644 index 0000000..fd25c4e --- /dev/null +++ b/src/sdl2-test.c @@ -0,0 +1,22 @@ +/* + * This file is part of MXE. + * See index.html for further information. + */ + +#include + +int main(int argc, char *argv[]) +{ + SDL_Window* window = NULL; + + (void)argc; + (void)argv; + + if (SDL_Init(SDL_INIT_VIDEO) < 0) return 1; + + window = SDL_CreateWindow("MXE test", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 640, 480, SDL_WINDOW_SHOWN); + SDL_Delay(2000); + SDL_DestroyWindow(window); + SDL_Quit(); + return 0; +} diff --git a/src/sdl2.mk b/src/sdl2.mk index 6f40659..8fbb59b 100644 --- a/src/sdl2.mk +++ b/src/sdl2.mk @@ -27,4 +27,10 @@ define $(PKG)_BUILD $(MAKE) -C '$(1)' -j '$(JOBS)' $(MAKE) -C '$(1)' -j 1 install ln -sf '$(PREFIX)/$(TARGET)/bin/sdl2-config' '$(PREFIX)/bin/$(TARGET)-sdl2-config' + + '$(TARGET)-gcc' \ + -W -Wall -Werror -ansi -pedantic \ + '$(2).c' -o '$(PREFIX)/$(TARGET)/bin/test-sdl2.exe' \ + `'$(TARGET)-pkg-config' sdl2 --cflags --libs` + endef -- cgit v0.12