• Advertisement

Archived

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

Lights in DX versus OGL

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

Hi! I''m making a simple 3D engine to learn 3D engine programming *daa* My main goal is to learn OGL _and_ DX! That''s why I try as hard as I can to hide all API specific stuff, mostly behind inheritance (C++). Right now I''m making it in OGL (don''t flame me! ). Know I''m making light sources and materials... How is light represented in DX? Is it like in OGL with float[4] ? One for each component (diffuse, specular, etc) ? thanx... "No lies of sugar can sweeten the sournes of reality" }+TITANIUM+{ A.K.A. DXnewbie[onMIRC]

Share this post


Link to post
Share on other sites
Advertisement
They seem to us D3DCOLOR and such?...

Should I make a color and a vector class that hides the inplementation in either cDXColor/cOGLColor and cDXVector/cOGLVector ?

Does anyone know of a engine (with docs, tuts?) that have done the same? (hiding away the API specifik stuff to increase compability?)

"No lies of sugar can sweeten the sournes of reality"

}+TITANIUM+{ A.K.A. DXnewbie[onMIRC]

Share this post


Link to post
Share on other sites
While I can''t think of any in specific, I like the way you''re thinking and I think that''s the way you should go about it. In fact, that''s how I''m going to go about it. ;P

Share this post


Link to post
Share on other sites
quote:
Does anyone know of a engine (with docs, tuts?) that have done the same? (hiding away the API specifik stuff to increase compability?)


Yup, take a look at the Ogre engine. It''s written in C++, has separate render systems for DirectX 7, DirectX 8 and SDL/OpenGL, and seems to be fairly well documented.

I can''t recommend trying to abstract both APIs until you''ve hammered down the requirements of your engine. You''ll undoubtedly have to make trade offs that depend on the type of game you''re writing.

You should also read S1CA''s post in this thread. He has some excellent advice on the subject.

Share this post


Link to post
Share on other sites

  • Advertisement