[SDL] Corruption of Rect in SDL_BlitSurface

David Olofson david at olofson.net
Wed Jul 5 10:41:07 PDT 2006


On Wednesday 05 July 2006 19:26, Patricia Curtis wrote:
> Hi I Just noticed that SDL_BlitSurface corrupts the destination rect
> when used with negative x and y values, which prevents reuse of the
> rect. not a big problem but i would have thought it would not
> corrupt it.

What exactly do you mean by "corrupts"?

The SDL blitting functions writing the clipped rectangle into the 
destination Rect *is* documented behavior. It has no effect on the x 
and y fields as long as they're inside the destination surface - but 
negative coordinates are obviously outside, as are coordinates beyond 
the width and height of the destination surface, and these will be 
clamped to [0, dest.(w|h) - 1].


//David Olofson - Programmer, Composer, Open Source Advocate

.-------  http://olofson.net - Games, SDL examples  -------.
|        http://zeespace.net - 2.5D rendering engine       |
|       http://audiality.org - Music/audio engine          |
|     http://eel.olofson.net - Real time scripting         |
'--  http://www.reologica.se - Rheology instrumentation  --'




More information about the SDL mailing list