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

David Olofson david at olofson.net
Sun Nov 27 10:47:08 PST 2005


On Sunday 27 November 2005 19.20, Tom Wilson wrote:
[...]
> > 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.

That does indeed avoid the "problem", and it is the obvious way of 
doing it in a few rare cases - but I can't see the point in 
reinventing clipping outside SDL, especially since SDL will do the 
clipping tests either way. (Unless you bypass the official API, that 
is.)


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

.- Audiality -----------------------------------------------.
|  Free/Open Source audio engine for games and multimedia.  |
| MIDI, modular synthesis, real time effects, scripting,... |
`-----------------------------------> http://audiality.org -'
   --- http://olofson.net --- http://www.reologica.se ---




More information about the SDL mailing list