General advice needed for C++ newbie
Hi everyone,
I''m new to C++ and have just started writing a game. I''ve created a ''template'' project, which creates a window, DirectDraw object, primary surface, backbuffer, etc., and everything works fine. However, I''ve written everything in a classic, non-OO way and the more I look at the project the more I think that I should really go OO straight away and put everything into classes.
As it stands, my project is split between separate source files which each deal with either the main game stuff, the direct draw stuff, the windows creation stuff, and so on, with global variables and external function prototypes linking the modules.
I realise that this isn''t too far off being OO in itself and that a logical progression would be to create classes to replace the modular code I have so far.
This is where I start getting a headache! I understand object oriented programming in theory, but I''ve had no experience of actually doing it. Books on the subject give examples which fit nicely into separate classes and the whole things seems to make sense. However, when it comes to writing my game, deciding what classes I need to create and how each class will be related to/interact with the others is confusing me.
Can anyone recommend a good tutorial, preferably covering the development of a DirectX game in C++ which actually use the OO features of the language, rather than just the normal functional C stuff? What would also help would be if people who''ve successfully done this already could describe what classes they''ve used to accomplish it and how the classes interact.
Any help would be much appreciated.
Moot
Ok, I'm going to answer my own question, having done a little more research and learning (I was feeling bad about having 0 replies too!)
The above post was a bit long because I'm new to C++ and didn't really understand what it was I was looking for. What I meant to say was something like this:
I want to make my game as Object Oriented as possible by encapsulating all the DirectX code in C++ wrappers. Has anyone done this? I'm having trouble getting my head round what classes I need to create and the hierarchy/dependencies of these classes.
The answer to my question is:
Someone's already done a very thorough job of exactly what you're talking about. CDX is a collection of DirectX wrappers which you can use in your own projects. Not only that but the full source code is available for download.
Click here to go to the CDX web site
I'm still going to write my own wrappers rather than use CDX, more as a learning exercise than anything else, but it's so useful to have a working, real world example to refer to.
Thanks, CDX dudes!
Edited by - Moot on November 23, 2000 9:48:39 AM
The above post was a bit long because I'm new to C++ and didn't really understand what it was I was looking for. What I meant to say was something like this:
I want to make my game as Object Oriented as possible by encapsulating all the DirectX code in C++ wrappers. Has anyone done this? I'm having trouble getting my head round what classes I need to create and the hierarchy/dependencies of these classes.
The answer to my question is:
Someone's already done a very thorough job of exactly what you're talking about. CDX is a collection of DirectX wrappers which you can use in your own projects. Not only that but the full source code is available for download.
Click here to go to the CDX web site
I'm still going to write my own wrappers rather than use CDX, more as a learning exercise than anything else, but it's so useful to have a working, real world example to refer to.
Thanks, CDX dudes!
Edited by - Moot on November 23, 2000 9:48:39 AM
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement