diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..4788eb3 --- /dev/null +++ b/Makefile @@ -0,0 +1,5 @@ + +CFLAGS := `sdl-config --cflags` +LDFLAGS := `sdl-config --libs` + +all: sdl-vidinfo-test diff --git a/sdl-vidinfo-test.c b/sdl-vidinfo-test.c new file mode 100644 index 0000000..fd912de --- /dev/null +++ b/sdl-vidinfo-test.c @@ -0,0 +1,23 @@ + +#include +#include + +int main() +{ + if (SDL_Init(SDL_INIT_VIDEO)) + { + fprintf(stderr, "SDL_Init() returned error!\n"); + return -1; + } + + const SDL_VideoInfo * vidInfo = SDL_GetVideoInfo(); + if (vidInfo == NULL) + { + fprintf(stderr, "SDL_GetVideoInfo() returned NULL!\n"); + return -2; + } + + printf("Width: %d\nHeight: %d\n", vidInfo->current_w, vidInfo->current_h); + + return 0; +}