Structure of a Graphics Engine

Started by
2 comments, last by Roger Rabbit 18 years, 5 months ago
Hey All Myself and some others in my group are just about to start production of a Hardware Accelerated Graphics Engine, which will eventually be used to produce a fully working game. What I was wondering is: is there a specific way to structure the code of the engine? I'm assuming that there are seperate files for OpenGL and DirectX. But within those files, what tests to I need to run and in what order? Sorry if this is a bit of a n00b question but I've never worked on a project this big. Thank you very much for your help! -Andy
Advertisement
The question is not necessarily n00b..
However, it sounds like you should have a go at some simpler projects before trying to create your own graphics engine.
Writing a graphics engine is a huge undertaking. Just take a look at the API documentation of Ogre at www.ogre3d.org.
I'm not sure how much (graphics) programming you have done before, but you should have been programming for quite some time before you attempt building your own graphics engine.

If you feel that you have the skills to create one, I can promise you that you will:
- Learn ALOT
- spend a lot of time on it
- have fun :)
- get bored and not work on it for a while
- pick it up again, and decide to rework a lot of stuff because you're not happy with how it's designed.
- Learn ALOT (yes.. again)

Any decently structured project you make involving graphics is going to have some sort of graphics engine. I remember in 9th grade I wrote a vb class to handle some basic DX7 operations, such as intialize device, load .x file, draw .x file.

You will need to abstract a window creation class, a device (opengl or directx) class, and at least some sort of graphics entity class such a model (research on .3ds files or .ms3d). Then these classes will be reused in the future such as all your games will

Create a window
Open the device
Load graphics objects

while (!closing)
dostuff
Draw Graphics objects

cleanup graphics objects
cleanup device
cleanup window
exit
Wow thanks for replying so quickly people. I've done a lot of basic programming, ie. drawing simple stuff in both DirectX and OpenGL, and I know those tests are generally included in the engine. There are a group of 4 or 5 of us currently programming so I'm not alone. Thank you all again!

-Andy

This topic is closed to new replies.

Advertisement