December 03, 2020, 12:58:16 pm


Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........

How to write in a sprite buffer ?

Started by pistol350, October 10, 2007, 04:58:21 pm

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


Hi all!
Any idea how to write in a sprite buffer with Aurora ?

Peter B.

J B Wood (Zumwalt)

um elaborate
You write to the back buffer and flip between the back and the front for seeing what is going on and what is in process.
Otherwise, are you talking about simple pointers in aurora?
*scratches head*

Ionic Wind Support Team

The member variable m_tile of a sprite is derived from C2DSurface.   So you can perform direct sprite writiing

pBuffer = mysprite.m_tile->GetSurfacePointer();
pitch = mysprite.m_tile->GetSurfacePitch();
//work with the sprint buffer

Don't have a more complete example handy.  A simple example of drawing to a sprite can be found in breakout.src

Ionic Wind Support Team


Paul got it right! :)

In fact i did not know that the Lock() method which seemed to be a member of the C2DSurface Class, could be used with an object of C2DSprite class.
BTW, when i come to think about it, it's not that weird  :)
this short example is fine.

Thank you guys.

Peter B.