engine objects

Started by
0 comments, last by kaos2000 21 years, 9 months ago
i am new to game programing but very good at c/c++. My question is if ia going t use directx for the render should i create my own classes(lights,mesh,color,etc.....) for the engine. one soul to use many lives to live!
one soul to use many lives to live!
Advertisement
DirectX (more specifically D3D (since its what I know a little about)) already provides some of what you may want to use. There are mesh, light and colour objects in d3d8 (as part of the d3dx gear). You can use these if you want, but you don''t have to.
If you use per-vertex lighting then using the d3d lights may be a good way to go. If you''re using precomputedl ightmaps for your lighting then they aren''t that much use, except to keep track of lights which may exist, but not actually provide any support for lighting itself.
As far as mesh classes go, depending on your needs the D3DXMESH stuff may suit you but then again it may not.
Have a look at the DX structures. If they look like you could use them effectively then go for it. Otherwise feel free to write your own - you''ll learn more too.

Also keep in mind that a lot of your engine may not be related to these. If your building an octree/bsp/whatever based engine then of course you''ll have to write classes to support these.
Building an engine takes probably 3 things:
Time, Patience and lots of re-writes and re-thinks about the way you do things.
When writing an engine (I''m still in this process) you''ll throw many things away but will learn a lot from the design / implementation mistakes you made. Eventually one hopes that they''ll get it right.
Go experiment - its the only way you''ll find out.

good luck
Toby

Gobsmacked - by Toby Murray

This topic is closed to new replies.

Advertisement