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
slouken@3999
     1
#include <windows.h>
slouken@3999
     2
#include "SDL/SDL.h"
slouken@0
     3
slouken@0
     4
slouken@3999
     5
#define WIDTH 480
slouken@3999
     6
#define HEIGHT 480
slouken@3999
     7
#define DEPTH 32
slouken@0
     8
slouken@0
     9
slouken@3999
    10
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR
slouken@3999
    11
lpCmdLine, int nCmdShow)
slouken@3999
    12
{
slouken@3999
    13
        if (SDL_Init(SDL_INIT_VIDEO|SDL_INIT_TIMER) != -1)
slouken@3999
    14
        {
slouken@3999
    15
                SDL_Surface* w;
slouken@3999
    16
                Uint32* r;
slouken@3999
    17
                int x;
slouken@0
    18
slouken@3999
    19
                w = SDL_SetVideoMode(WIDTH, HEIGHT, DEPTH, SDL_SWSURFACE |
slouken@3999
    20
SDL_FULLSCREEN);
slouken@0
    21
slouken@3999
    22
                SDL_LockSurface(w);
slouken@3999
    23
                r = w->pixels + w->pitch * HEIGHT / 2;
slouken@3999
    24
                for (x = 0; x < WIDTH; ++x) r[x] = 0xFFFFFFFF;
slouken@3999
    25
                SDL_UnlockSurface(w);
slouken@3999
    26
                SDL_UpdateRect(w, 0, 0, 0, 0);
slouken@3999
    27
slouken@3999
    28
                SDL_Delay(1000);
slouken@3999
    29
                SDL_Quit();
slouken@3999
    30
        }
slouken@3999
    31
slouken@3999
    32
        return 0;
icculus@1151
    33
}