Blitting and sprites in Cairo

Donn <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <[email protected]>
How would you move a sprite across a background?

The sprite could be:

draw rectangle 32x32
clip()
push_group()
draw sprite with cairo functions
s=pop_group()

But now:

Draw background once
loop start
  Copy rect of bg where sprite is gonna go //How do you do this?
   translate() //move sprite
   set_source(s)
   paint() //Draw the sprite
  //Replace the backdrop
  ?? //Some kind of set_source + paint again?
loop

That kind of jazz.

Is this the right approach in Cairo? Is there a better way, or a faster 
one?

(I'm kinda pining for the old days of vram and rows of bytes! :D)

\d
-- 
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.