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:
parent
387f9fca30
commit
d12f39427e
5
Makefile
Normal file
5
Makefile
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
|
||||||
|
CFLAGS := `sdl-config --cflags`
|
||||||
|
LDFLAGS := `sdl-config --libs`
|
||||||
|
|
||||||
|
all: sdl-vidinfo-test
|
23
sdl-vidinfo-test.c
Normal file
23
sdl-vidinfo-test.c
Normal 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;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user