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:
1 parent
387f9fca30
commit
d12f39427e
2 files changed
+28
No files matched your search
@@ -0,0 +1,5 @@
|
|||||||
|
|
||||||
|
CFLAGS := `sdl-config --cflags`
|
||||||
|
LDFLAGS := `sdl-config --libs`
|
||||||
|
|
||||||
|
all: sdl-vidinfo-test
|
||||||
@@ -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;
|
||||||
|
}
|
||||||
Reference in new issue
Block a user