added sdl-vidinfo-test files

git-svn-id: svn://anubis/misc/sdl-vidinfo-test@135 bd8a9e45-a331-0410-811e-c64571078777
This commit is contained in:
josh 2009-09-16 23:24:16 +00:00
parent 387f9fca30
commit d12f39427e
2 changed files with 28 additions and 0 deletions

5
Makefile Normal file
View File

@ -0,0 +1,5 @@
CFLAGS := `sdl-config --cflags`
LDFLAGS := `sdl-config --libs`
all: sdl-vidinfo-test

23
sdl-vidinfo-test.c Normal file
View File

@ -0,0 +1,23 @@
#include <stdio.h>
#include <SDL.h>
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;
}