sdl-vidinfo-test/sdl-vidinfo-test.c
josh d12f39427e added sdl-vidinfo-test files
git-svn-id: svn://anubis/misc/sdl-vidinfo-test@135 bd8a9e45-a331-0410-811e-c64571078777
2009-09-16 23:24:16 +00:00

24 lines
447 B
C

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