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
f61a20d195f7 Fixed bug #450
Sam Lantinga <slouken@libsdl.org>
parents: 1760
diff changeset
1 #include <windows.h>
f61a20d195f7 Fixed bug #450
Sam Lantinga <slouken@libsdl.org>
parents: 1760
diff changeset
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
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
4
3999
f61a20d195f7 Fixed bug #450
Sam Lantinga <slouken@libsdl.org>
parents: 1760
diff changeset
5 #define WIDTH 480
f61a20d195f7 Fixed bug #450
Sam Lantinga <slouken@libsdl.org>
parents: 1760
diff changeset
6 #define HEIGHT 480
f61a20d195f7 Fixed bug #450
Sam Lantinga <slouken@libsdl.org>
parents: 1760
diff changeset
7 #define DEPTH 32
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
8
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
9
3999
f61a20d195f7 Fixed bug #450
Sam Lantinga <slouken@libsdl.org>
parents: 1760
diff changeset
10 int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR
f61a20d195f7 Fixed bug #450
Sam Lantinga <slouken@libsdl.org>
parents: 1760
diff changeset
11 lpCmdLine, int nCmdShow)
f61a20d195f7 Fixed bug #450
Sam Lantinga <slouken@libsdl.org>
parents: 1760
diff changeset
12 {
f61a20d195f7 Fixed bug #450
Sam Lantinga <slouken@libsdl.org>
parents: 1760
diff changeset
13 if (SDL_Init(SDL_INIT_VIDEO|SDL_INIT_TIMER) != -1)
f61a20d195f7 Fixed bug #450
Sam Lantinga <slouken@libsdl.org>
parents: 1760
diff changeset
14 {
f61a20d195f7 Fixed bug #450
Sam Lantinga <slouken@libsdl.org>
parents: 1760
diff changeset
15 SDL_Surface* w;
f61a20d195f7 Fixed bug #450
Sam Lantinga <slouken@libsdl.org>
parents: 1760
diff changeset
16 Uint32* r;
f61a20d195f7 Fixed bug #450
Sam Lantinga <slouken@libsdl.org>
parents: 1760
diff changeset
17 int x;
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
18
3999
f61a20d195f7 Fixed bug #450
Sam Lantinga <slouken@libsdl.org>
parents: 1760
diff changeset
19 w = SDL_SetVideoMode(WIDTH, HEIGHT, DEPTH, SDL_SWSURFACE |
f61a20d195f7 Fixed bug #450
Sam Lantinga <slouken@libsdl.org>
parents: 1760
diff changeset
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
f61a20d195f7 Fixed bug #450
Sam Lantinga <slouken@libsdl.org>
parents: 1760
diff changeset
22 SDL_LockSurface(w);
f61a20d195f7 Fixed bug #450
Sam Lantinga <slouken@libsdl.org>
parents: 1760
diff changeset
23 r = w->pixels + w->pitch * HEIGHT / 2;
f61a20d195f7 Fixed bug #450
Sam Lantinga <slouken@libsdl.org>
parents: 1760
diff changeset
24 for (x = 0; x < WIDTH; ++x) r[x] = 0xFFFFFFFF;
f61a20d195f7 Fixed bug #450
Sam Lantinga <slouken@libsdl.org>
parents: 1760
diff changeset
25 SDL_UnlockSurface(w);
f61a20d195f7 Fixed bug #450
Sam Lantinga <slouken@libsdl.org>
parents: 1760
diff changeset
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
f61a20d195f7 Fixed bug #450
Sam Lantinga <slouken@libsdl.org>
parents: 1760
diff changeset
28 SDL_Delay(1000);
f61a20d195f7 Fixed bug #450
Sam Lantinga <slouken@libsdl.org>
parents: 1760
diff changeset
29 SDL_Quit();
f61a20d195f7 Fixed bug #450
Sam Lantinga <slouken@libsdl.org>
parents: 1760
diff changeset
30 }
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
31
3999
f61a20d195f7 Fixed bug #450
Sam Lantinga <slouken@libsdl.org>
parents: 1760
diff changeset
32 return 0;
0
74212992fb08 Initial revision
Sam Lantinga <slouken@lokigames.com>
parents:
diff changeset
33 }