how to design classes ?

Started by
11 comments, last by GameDev.net 19 years, 6 months ago
Hi, I have read some directX tutorials. I want to create a simple library which supports a simple framework for working with DX. I don't know steps I have to do to design classes. So anyone tell me which steps you have done to design classes for a library. (should I write down any ideas in my head... then what's next ?... a diagram...?) SO what do a game programmer have to do when designing a game engine... thanks [smile] (sorry for my bad english)
Advertisement
i think practise is the best teacher in learning how to design code. theres no better way to learn then by trying yourself, and failing horribly [smile]. why do you want to write a library, anyway?
FTA, my 2D futuristic action MMORPG
I want to create a library because I want to practice.
I know I have to practice but I also need some guides. It's not easy to practice if I don't know what I have to do.

Any tools required ?

Any suggestion ?
thanks [smile]
1) Think about it
2) Do it
3) realize you screwed up
4) go back to number 1
______________________________________________________________________________________With the flesh of a cow.
oh, Ainokea, it's not a detailed scheme. (I'm a newbie)
this loop never ends ? (thanks anyway)

Are there some tuts at somewhere on Internet ?
... [smile]
theres really no clear formula. since you want a simple wrapper, consider what you'd like to wrap (that was catchy). for instance, you'd probably want a window class that creates a window and initializes whatever dx stuff you want. mostly, just whip up what you'd like in your head, and just go at it. you will redo it multiple times, so don't worry about being perfect. just get it to work.
as for tutorials, the chris hargrove tutorials are both game related and wrap win32 and dx. they are worth scanning for ideas.
good luck.
- stormrunner
thanks
I'll try
thanks for your advice [smile]
Here is my idea

- cApplication: this class will control the program flow by calling virtual functions of cObject (an abstract class).
In this class there is a stack manager that store the classes (like cGraphics, cInput, ... these classes are derived from cObject class).

- ....

So should I use STL and if so, where can I find a good STL tutorial ?

thanks [smile]
Quote:Original post by fantasy_world
So should I use STL and if so, where can I find a good STL tutorial ?


Definitely.

The C++ Template Library, a tutorial and reference is a must-have for any C++ programmer.
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
Quote:Original post by fantasy_world
Here is my idea

- cApplication: this class will control the program flow by calling virtual functions of cObject (an abstract class).
In this class there is a stack manager that store the classes (like cGraphics, cInput, ... these classes are derived from cObject class).

- ....

So should I use STL and if so, where can I find a good STL tutorial ?

thanks [smile]

About the stl of course you should use it. here is one tutorial linky
and here is the docs click
______________________________________________________________________________________With the flesh of a cow.

This topic is closed to new replies.

Advertisement