March 29, 2024, 06:37:39 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


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.

pistol350

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

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

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.
Ionic Wind Support Team

pistol350

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.
Regards,

Peter B.