Mercurial > sdl-ios-xcode
annotate test/testwin.c @ 3999:f61a20d195f7 SDL-1.2
Fixed bug #450
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Wed, 04 Jul 2007 15:22:07 +0000 |
parents | a9be6a3a51d1 |
children | 9776ab9063de |
rev | line source |
---|---|
3999 | 1 #include <windows.h> |
2 #include "SDL/SDL.h" | |
1151
be9c9c8f6d53
Removed atexit() from most of the test programs; atexit(SDL_Quit) isn't safe
Ryan C. Gordon <icculus@icculus.org>
parents:
228
diff
changeset
|
3 |
0 | 4 |
3999 | 5 #define WIDTH 480 |
6 #define HEIGHT 480 | |
7 #define DEPTH 32 | |
0 | 8 |
9 | |
3999 | 10 int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR |
11 lpCmdLine, int nCmdShow) | |
12 { | |
13 if (SDL_Init(SDL_INIT_VIDEO|SDL_INIT_TIMER) != -1) | |
14 { | |
15 SDL_Surface* w; | |
16 Uint32* r; | |
17 int x; | |
0 | 18 |
3999 | 19 w = SDL_SetVideoMode(WIDTH, HEIGHT, DEPTH, SDL_SWSURFACE | |
20 SDL_FULLSCREEN); | |
1152
51a8702d8ecd
Updates to PocketPC (WinCE) support, thanks to Dmitry Yakimov at
Ryan C. Gordon <icculus@icculus.org>
parents:
1151
diff
changeset
|
21 |
3999 | 22 SDL_LockSurface(w); |
23 r = w->pixels + w->pitch * HEIGHT / 2; | |
24 for (x = 0; x < WIDTH; ++x) r[x] = 0xFFFFFFFF; | |
25 SDL_UnlockSurface(w); | |
26 SDL_UpdateRect(w, 0, 0, 0, 0); | |
1151
be9c9c8f6d53
Removed atexit() from most of the test programs; atexit(SDL_Quit) isn't safe
Ryan C. Gordon <icculus@icculus.org>
parents:
228
diff
changeset
|
27 |
3999 | 28 SDL_Delay(1000); |
29 SDL_Quit(); | |
30 } | |
0 | 31 |
3999 | 32 return 0; |
0 | 33 } |