Jump to content
  • Advertisement

Archived

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

Ritual Magic

"Standard" classes - suggestions?

This topic is 5769 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 alls OK, well, the whole game writing thing is turning out to be alot of fun What I'd like to do now is to write some base classes that I can use in all my games. What I would like are some suggestions on what to write. I've already written a mouse/keyboard class using DirectInput. I obviously need a sound class (although I know nothing about sound so I'm leaving that on the long finger for a bit). A general MakeWindow class? I realise I'm probably asking an impossible question, but any suggestions will do I'm not looking for code to copy, just some advice in case I miss obvious stuff and end up redoing it all later. On an aside, maybe someone could offer a suggestion on the following prolem I'm having: I'm writing a "button" class, for clickable areas of the screen. I'm using OpenGL, and currently just going with 2D stuff, so I'm using a textured Quad for the button. So far what I have looks something along the lines of: class CPanel { private: int x, y; // coordinates on screen int height, width; // height and width int textureid; // which texture to use bool visible, clickable; // visible? clickable? ???????? // function to call if clickable? public: methods in here.... }; Now, I would like to be able to tie the function to the button itself if it's clicked. For example, if I have a button that says "Quit", I'd like to call all the DeInit procedures and kill the app. Someone suggested a function pointer, but I'm not all that sure on how to implement this. Someone else told me it was just the wrong way to go about it Any suggestions? As always, thanks for any advice Sorry if it takes me a whil to get back and I appear to be ignoring the thread - I'm not, it's just that I'm currently without Net access at home, and I can only get the use of a machine at Uni occasionally. RM. ------------------------------------------------------------ Yes. it''s true, I DO wield the ugly stick. And I see I have beaten you with it before! [edited by - Ritual Magic on November 4, 2002 6:35:20 AM]

Share this post


Link to post
Share on other sites
Advertisement

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!