Lines Matching refs:screen
18 void DrawBox(SDL_Surface *screen, int X, int Y, int width, int height) in DrawBox() argument
38 if (screen->format->BytesPerPixel==1) in DrawBox()
44 color = SDL_MapRGB(screen->format, randc, randc, randc); in DrawBox()
48 SDL_FillRect(screen, &area, color); in DrawBox()
49 if ( screen->flags & SDL_DOUBLEBUF ) { in DrawBox()
50 SDL_Flip(screen); in DrawBox()
52 SDL_UpdateRects(screen, 1, &area); in DrawBox()
56 void DrawBackground(SDL_Surface *screen) in DrawBackground() argument
68 if ( SDL_LockSurface(screen) < 0 ) { in DrawBackground()
73 buffer = (Uint8 *)screen->pixels; in DrawBackground()
75 if (screen->format->BytesPerPixel!=2) { in DrawBackground()
76 for ( i=0; i<screen->h; ++i ) { in DrawBackground()
77 memset(buffer,(i*(NUM_COLORS-1))/screen->h, screen->w * screen->format->BytesPerPixel); in DrawBackground()
78 buffer += screen->pitch; in DrawBackground()
83 for ( i=0; i<screen->h; ++i ) { in DrawBackground()
84 gradient=((i*(NUM_COLORS-1))/screen->h); in DrawBackground()
85 color = SDL_MapRGB(screen->format, gradient, gradient, gradient); in DrawBackground()
87 for (k=0; k<screen->w; k++) in DrawBackground()
91 buffer += screen->pitch; in DrawBackground()
95 SDL_UnlockSurface(screen); in DrawBackground()
96 if ( screen->flags & SDL_DOUBLEBUF ) { in DrawBackground()
97 SDL_Flip(screen); in DrawBackground()
99 SDL_UpdateRect(screen, 0, 0, 0, 0); in DrawBackground()
107 SDL_Surface *screen; in CreateScreen() local
112 screen = SDL_SetVideoMode(w, h, bpp, flags); in CreateScreen()
113 if ( screen == NULL ) { in CreateScreen()
119 (screen->flags & SDL_FULLSCREEN) ? "fullscreen" : "windowed"); in CreateScreen()
128 SDL_SetColors(screen, palette, 0, NUM_COLORS); in CreateScreen()
131 return(screen); in CreateScreen()
136 SDL_Surface *screen; in main() local
192 screen = CreateScreen(width, height, bpp, videoflags); in main()
193 if ( screen == NULL ) { in main()
197 DrawBackground(screen); in main()
204 DrawBox(screen, event.button.x, event.button.y, width, height); in main()
220 screen = CreateScreen( in main()
221 screen->w, screen->h, in main()
222 screen->format->BitsPerPixel, in main()
224 if ( screen == NULL ) { in main()
229 DrawBackground(screen); in main()
237 DrawBackground(screen); in main()
240 screen = CreateScreen( in main()
242 screen->format->BitsPerPixel, in main()
244 if ( screen == NULL ) { in main()
249 DrawBackground(screen); in main()