Archived

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

plaribus

D3D for Game Engines, the Inclusion Factor

Recommended Posts

Haven''t posted anything here in quite a while... Anywho, I''m trying to write a basic D3D engine in C++. Basic, as in it doesn''t need to be the all-time best gaming engine ever made, just good enough to have a terrain map and run around in it (maybe with some farm animals). It will be Windows platform obviously, but I may make it cross-platform in the future by incorporating SDL or OGL. Question 1: Many of the examples I''ve seen of D3D based renderage has taken place from a combined D3D/Windows Application data class. If you''ve looked at the DirectX SDK, you probably know what I''m talking about, it goes by the name of "CD3DApplication" (d3dapp.h), ATI, in their crazyness, actually uses the same class in their demos... Is this common practice, common demo practice, or is it just common practice if you know you''ll never EVER write a cross-platform version of the program? Question 2: Assuming you said "Common practice? What is this tom-foolery?!!" to the first section. How would you separate out the classes? Windows application class with a D3D class inside, a D3D class derived from a Windows application base class, etc. If you don''t want to take the time to write out an explanation you can just clicky link me a website/tutorial or a recommend a good book. Don''t be afraid of using "advanced c++ techniques."

Share this post


Link to post
Share on other sites
quote:
Question 1:
Many of the examples I''ve seen of D3D based renderage has taken place from a combined D3D/Windows Application data class. If you''ve looked at the DirectX SDK, you probably know what I''m talking about, it goes by the name of "CD3DApplication" (d3dapp.h), ATI, in their crazyness, actually uses the same class in their demos... Is this common practice, common demo practice, or is it just common practice if you know you''ll never EVER write a cross-platform version of the program?


I really won''t use it. That is there just to make the code look as simple as possible. I really won''t recommend starting with that, or you''ll get burned out trying to find out where all the code is placed. If you write all the stuff yourself, you can be more organized and possibly more optimized.

quote:
Assuming you said "Common practice? What is this tom-foolery?!!" to the first section. How would you separate out the classes? Windows application class with a D3D class inside, a D3D class derived from a Windows application base class, etc.

It is very easy, especially if you know basic windows programming. Just go download the code off the net of some simple example. It really shouldn''t be more than 100 lines of code in one file.

Share this post


Link to post
Share on other sites