Guest User

Untitled

a guest
Oct 22nd, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.60 KB | None | 0 0
  1. #include <SDL/SDL.h>
  2.  
  3. int main () {
  4.    SDL_Event a;
  5.    SDL_Surface *screen;
  6.    int w,h,i;
  7.    w=281;
  8.    h=93;
  9.    SDL_Init(SDL_INIT_VIDEO);
  10.    screen=SDL_SetVideoMode(w,h,8,SDL_HWSURFACE|SDL_DOUBLEBUF);
  11.    printf ("w: %d h: %d\n",screen->w,screen->h);
  12.    if (SDL_MUSTLOCK(screen))
  13.       SDL_LockSurface(screen);
  14.    for (i=0;i<w*h;i++)
  15.       memset ((unsigned char*)screen->pixels+i,0xff,1);
  16.    if (SDL_MUSTLOCK(screen))
  17.       SDL_UnlockSurface(screen);
  18.    SDL_Flip(screen);
  19.    while (1) {
  20.       if (SDL_PollEvent (&a) && a.type==SDL_QUIT)
  21.          break;
  22.    }
  23.    SDL_Quit ();
  24.    return 0;
  25. }
Add Comment
Please, Sign In to add comment