Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <SDL/SDL.h>
- int main () {
- SDL_Event a;
- SDL_Surface *screen;
- int w,h,i;
- w=281;
- h=93;
- SDL_Init(SDL_INIT_VIDEO);
- screen=SDL_SetVideoMode(w,h,8,SDL_HWSURFACE|SDL_DOUBLEBUF);
- printf ("w: %d h: %d\n",screen->w,screen->h);
- if (SDL_MUSTLOCK(screen))
- SDL_LockSurface(screen);
- for (i=0;i<w*h;i++)
- memset ((unsigned char*)screen->pixels+i,0xff,1);
- if (SDL_MUSTLOCK(screen))
- SDL_UnlockSurface(screen);
- SDL_Flip(screen);
- while (1) {
- if (SDL_PollEvent (&a) && a.type==SDL_QUIT)
- break;
- }
- SDL_Quit ();
- return 0;
- }
Add Comment
Please, Sign In to add comment