IonicWind Software

Aurora Compiler => 2D Graphics => Topic started by: pistol350 on October 10, 2007, 04:58:21 PM

Title: How to write in a sprite buffer ?
Post by: pistol350 on October 10, 2007, 04:58:21 PM
Hi all!
Any idea how to write in a sprite buffer with Aurora ?
Title: Re: How to write in a sprite buffer ?
Post by: J B Wood (Zumwalt) on October 25, 2007, 10:04:53 PM
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*
Title: Re: How to write in a sprite buffer ?
Post by: Ionic Wind Support Team on October 25, 2007, 11:07:42 PM
The member variable m_tile of a sprite is derived from C2DSurface.   So you can perform direct sprite writiing

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

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

Paul.
Title: Re: How to write in a sprite buffer ?
Post by: pistol350 on October 26, 2007, 03:21:38 AM
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.