added test program for sdl2

This commit is contained in:
Martin Gerhardy 2016-03-03 14:39:57 +01:00
parent 331bd3dc6a
commit c3624cdefb
2 changed files with 28 additions and 0 deletions

22
src/sdl2-test.c Normal file
View File

@ -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;
}

View File

@ -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