Jump to content
  • Advertisement

Archived

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

Mr Sound

Game Engine Subsystems

This topic is 6166 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

I''m planning to program a 3d game engine using C++. I want to use the features of C++ to create a well-structured engine. An engine class should load different subsystems which should be organised in different class too. For example a class ''world'' that loads and contains the different objects in the game, so far so good, now my idea was that every object contains a draw function, that draws the object so calling the World.Draw() function would call all the draw functions of all the objects. Till now the world''s still alright for me, but I want the engine class also contain a graphics subsystem that does the drawing including OpenGL initialization, camera matrices etc. So now the engine would have to call a World.Draw() and a Grapics.Draw(). I didn''t come to a solution how to cleanly structure an engine so that the subsystems can communicate between themselves without letting the engine class doing all the stuff, so i.e. the network class could tell the world class directly what''s happened new. I hope you can provide me with some ideas how to structure this. Thanks for your help, Mr. Sound

Share this post


Link to post
Share on other sites
Advertisement
One possible solution would be to hold several pointers to the classes and i.e. give the graphics class a pointer as a argument to the world class and the time class a pointer to the graphics class and so on.
But I don''t think that''s the ideal way for this.
Please tell me your ideas of how to create a nice''n''neat engine.

Mr. Sound

Share this post


Link to post
Share on other sites
I think it makes more sense for the graphics subsystem to draw the world, than the world to draw itself. It also makes it easy to port between graphics APIs, since you''ve only got to replace the graphics subsystem code if you switch APIs.

That''s just me, though.


codeka.com - Just click it.

Share this post


Link to post
Share on other sites
quote:
Original post by Dean Harding
I think it makes more sense for the graphics subsystem to draw the world, than the world to draw itself. It also makes it easy to port between graphics APIs, since you've only got to replace the graphics subsystem code if you switch APIs.



Yeah, I thought about that but IMHO that would only complicate things, although it would be more logical and better to port as you said.
If I would implent the drawing code for each object in the object class itself, it would be much easier to handle such things like char animation, where an object, let's say a human, consists of several sub-objects, in this case those would be the arms and legs for example. Anyway I don't intend to use DirectX or anything different than OpenGL (:



Edited by - Mr Sound on September 29, 2001 4:32:33 PM

Share this post


Link to post
Share on other sites

  • 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!