diff options
-rw-r--r-- | src/sdl2-test.c | 22 | ||||
-rw-r--r-- | src/sdl2.mk | 6 |
2 files changed, 28 insertions, 0 deletions
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 <SDL.h> + +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 |