[SDL] Re: Surface coordinates can't be less than zero?

Tom Wilson t.wilson at hazid.com
Sun Nov 27 10:20:42 PST 2005


Nick Stovall wrote:
>>So, for example if your screen is size 100x100 and you have a off screen 
>>surface of size 150x150 this gives you a 25 pixel buffering zone all 
>>round the edge of the screen.
>>
>>You would translate any screen co-ordinates by (+25, +25) before drawing 
>>to the off screen surface.  Then you would blit the off screen surface 
>>from 25,25 to 125,125 to the screen at screen position 0,0.
>>
>>Hope this makes sense. I tend to ramble.
>>
>>- Tom
> 
> The problem with that is that when I blit the buffer to the screen,
> its X- and Y- coordinates will still be set to 0, just like any other
> surface.
>  

You won't be using -X and -Y co-ordinates to blit.

It will solve your problem.

You blit the offscreen surface *from*  25,25 to 125,125  to the *screen* 
at 0,0

No negative co-ordinates are involved.

- Tom






More information about the SDL mailing list