Page 1 of 1

'OO' C++ programming with PocketFrog

PostPosted: Jun 26, 2002 @ 6:16pm
by Conan

PostPosted: Jun 26, 2002 @ 7:14pm
by Pam

Thanks Pam

PostPosted: Jun 26, 2002 @ 7:59pm
by Conan

PostPosted: Jun 26, 2002 @ 8:03pm
by Pam

Loading the bitmap

PostPosted: Jun 26, 2002 @ 10:49pm
by Conan
That's the bit I really gave up on. Hope you get it working

PostPosted: Jun 26, 2002 @ 11:55pm
by Pam

Is it really the best way?

PostPosted: Jun 27, 2002 @ 9:01am
by jbella

Is it really the best way?

PostPosted: Jun 27, 2002 @ 10:26am
by BurningSheep

Best way to do it ?

PostPosted: Jun 27, 2002 @ 10:45am
by Conan

Pam, one last question

PostPosted: Jun 27, 2002 @ 11:00am
by Conan

Managers

PostPosted: Jun 27, 2002 @ 11:13am
by jbella

Pam, one last question

PostPosted: Jun 27, 2002 @ 11:34am
by BurningSheep

thanks for the tip

PostPosted: Jun 27, 2002 @ 12:33pm
by Conan

PostPosted: Jun 27, 2002 @ 2:40pm
by Pam
Ok. Bad Pam. Slap on the wrist for posting poorly documented code. :wink:

I'll try to clean up the code and repost it with comments.

Each Sprite has a member called SpriteData which holds the bitmap for the sprite. In my case it's actually frames for the animation.

What I do in SetSpriteData() is pass a Surface that I have loaded in GameInit() from a resource.

To copy the contents of the passed-in Surface to the SpriteData surface, I change the rendering target from the default, which is the BackBuffer, to my SpriteData surface. Then I can Blit the passed-in surface onto the SpriteData surface. Then I set the rendering target back to the default.

I got this part from this thread:


I am definitely taking a peformance hit by using all these classes. But, for my purposes, the performance is still more than adequate. If I get too many sprites going at once, then I'll see it I suppose.

Pam

Performance etc

PostPosted: Jun 27, 2002 @ 3:12pm
by Conan