From d12f39427ef4630c6ac5ad3b23b8edcc7dbe19ac Mon Sep 17 00:00:00 2001 From: josh Date: Wed, 16 Sep 2009 23:24:16 +0000 Subject: [PATCH] added sdl-vidinfo-test files git-svn-id: svn://anubis/misc/sdl-vidinfo-test@135 bd8a9e45-a331-0410-811e-c64571078777 --- Makefile | 5 +++++ sdl-vidinfo-test.c | 23 +++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 Makefile create mode 100644 sdl-vidinfo-test.c 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; +}