Archived

This topic is now archived and is closed to further replies.

General VC++ help

This topic is 5656 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi im currently learning myself to make some kind of a game engine, and im at a stage where i have to start to code some sprite routines. Now the sprite routine has to be a Class but im not sure actually how to implement it. I know how to code it but i dont know WHERE to put it ie i got my main.cpp and few headers.h i made and coded a Class called CSprite now where do i put the Class? Do u put it in its own cpp like CSprite.cpp ? if so how do i use it? thanks

Share this post


Link to post
Share on other sites
yes. create a CSprite.cpp and a CSprite.h. CSprite.h will contain your class declaration (class CSprite { CSprite() ... }; ) and CSprite.cpp will contain the actual method definitions. To use it all you have to do is #include <CSprite.h> and declare a CSprite object. That should get you started since you said you already know how to do the routines and stuff. Good luck.

[edited by - BitBlt on June 24, 2002 2:26:15 PM]

Share this post


Link to post
Share on other sites