Skip to main content
GameDev.net gamedev.net
🔒 Locked

game engine graphics

Started by rangler Jun 5, 2004 at 3:21 AM 1 replies 350+ views
Original Post
rangler
rangler
Aside form all the OpenGl vs D3D hoopla what is the structure of general graphics engine? As a newcomer I want to start a basic engine but have found the graphics side to be the most challenging part of it. Is it beter to have a centeralized class where you pass an object to a draw function or equip each object with its own drawing function so it is self reliant? And what are some pitfalls you have found in terms of basic graphics programming?
//My SignatureString sig = "Rangler";System.out.println(sig);
VladR
VladR
Just start working on something. Along the way, youll necessarilly rewrite the class structure several times to suit your needs better. Whatever design you make at the beginning, there is a border after which the adding of another feature clutters the code and makes it hard to maintain.
Just start with some import of the objects from some modelling program, add some multitexturing, lighting, animation, collision detection,shaders,frustum culling and you
ll realize there were hundreds of things you had no idea about when you started designing your engine class hierarchy.
Thats life, fortunately thats the fun part, when you`re learning new stuff from C++ (STL,Namespaces,...) and designing your classes around it while rewriting existing portions of code.
Just Do It.

VladR
Avenger 3D game (Last update MAR-26)
dx elliot
dx elliot
I''ve learned to love managers, that is, appending anything to a class by sending in a filled structure of "attributes" and having it take care of everything for me (collision, updating, rendering). It gets pushed into a linked list of similar objects depending on the manager and attributes it can accept (entities in model representation form, textures, world effects, projectiles, 3d sound effects, misc particle effects). It returns a pointer to the object after it has been added, in order to send that same pointer in for manipulation when needed at any time. Make the managers powerful, and it makes your code much easier to maintain. Then you won''t really have to worry about making a class for this, a class for that, rendering this, updating that. Just add attributes to whichever manager and start feeding it the new features, go nuts over it too, you''ll find it to be much easier this way.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.