test/testwin.c
author Sam Lantinga <slouken@libsdl.org>
Wed, 04 Jul 2007 15:22:07 +0000
branchSDL-1.2
changeset 3999 f61a20d195f7
parent 1760 a9be6a3a51d1
child 4000 9776ab9063de
permissions -rw-r--r--
Fixed bug #450
     1 #include <windows.h>
     2 #include "SDL/SDL.h"
     3 
     4 
     5 #define WIDTH 480
     6 #define HEIGHT 480
     7 #define DEPTH 32
     8 
     9 
    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;
    18 
    19                 w = SDL_SetVideoMode(WIDTH, HEIGHT, DEPTH, SDL_SWSURFACE |
    20 SDL_FULLSCREEN);
    21 
    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);
    27 
    28                 SDL_Delay(1000);
    29                 SDL_Quit();
    30         }
    31 
    32         return 0;
    33 }