SDL_FillRect messing with my input rect!

I just found a bug in my code that was caused by a call to SDL_FillRect().
It really looks like SDL_FillRect() modified the second input parameter, the
SDL_Rect pointer. I also noticed that this pointer was to a non-constant
SDL_Rect, so that would support my claim.

The documentation says nothing about this parameter being modified. The
modified value doesn’t suggest anything to me, so I can’t figure out what
it’s trying to return.

Is this a known feature or bug of the SDL? Has anyone seen this before?
Does anyone know what’s going on?

Thank you…_________________________________________________________________
One week left to travel virtually with MSN Search World Tour
http://worldtour.sympatico.msn.ca/

If there is a clip rectangle set on the destination (set via
SDL_SetClipRect), then this function will clip based on the
intersection of the clip rectangle and the dstrect rectangle, and the
dstrect rectangle will be modified to represent the area actually filled.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

See:
http://www.libsdl.org/cgi/docwiki.cgi/SDL_5fFillRect

Hope that helps! :)On Tue, May 30, 2006 at 09:39:23PM -0400, Id Kong wrote:

I just found a bug in my code that was caused by a call to SDL_FillRect().
It really looks like SDL_FillRect() modified the second input parameter, the
SDL_Rect pointer. I also noticed that this pointer was to a non-constant
SDL_Rect, so that would support my claim.

The documentation says nothing about this parameter being modified.

From the documentation:


-bill!
bill at newbreedsoftware.com
http://www.newbreedsoftware.com/

(includesSDL-announce)"
SDL-announce)"

From the documentation:

If there is a clip rectangle set on the destination (set via
SDL_SetClipRect), then this function will clip based on the
intersection of the clip rectangle and the dstrect rectangle, and the
dstrect rectangle will be modified to represent the area actually
filled.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

See:
http://www.libsdl.org/cgi/docwiki.cgi/SDL_5fFillRect

Hope that helps! :slight_smile:

Thanks! I misunderstood that line, since it says “If there is a clip
rectangle set on the destination (set via SDL_SetClipRect)” and, of course,
I never called that function so I expected there to be no clip rectangle…

But, in retrospect, it probably has one, by default–the very screen itself.
It, perhaps, makes it possible to draw rectangles partially off screen,
too. I’ve noticed that SDL_BlitSurface doesn’t allow blits that are
partially off screen, so perhaps that’s an indication of this feature…

Thanks a lot for the clarification!>From: Bill Kendrick

Reply-To: "A list for developers using the SDL library.
To: "A list for developers using the SDL library. (includes
Subject: Re: [SDL] SDL_FillRect messing with my input rect!
Date: Wed, 31 May 2006 11:31:38 -0700


One week left to travel virtually with MSN Search World Tour
http://worldtour.sympatico.msn.ca/