Filling an SDL_Rect with color

Can anyone give me any hints as to how to fill a given SDL_Rect with
color?

SDL_FillRect should do it. You can get the colour value to fill by
using SDL_MapRGB (if I remember correctly).

PeterOn 16/03/2008, Michael Sullivan wrote:

Can anyone give me any hints as to how to fill a given SDL_Rect with
color?


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

SDL_FillRect should do it. You can get the colour value to fill by
using SDL_MapRGB (if I remember correctly).

Peter

The trick to using SDL_MapRGB is first parameter *format, which one gets
from the member of a surface, structure, using the pointer notation of
Surface ->format. Though the SDL documentation is very spare, Google is
your friends, and there are many, sometime quiet cyptic examples to be found
there in, Persevere.

On Sun, Mar 16, 2008 at 11:09 AM, Peter Mackay <mackay.pete+sdl at gmail.com> wrote:

Can anyone give me any hints as to how to fill a given SDL_Rect with
color?

SDL_FillRect is your friend :slight_smile:

Cheers,
PeterFrom: “Michael Sullivan”