Jump to content
  • Advertisement

Archived

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

DTMdan

from software to directx - questions!

This topic is 5219 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 have recently been making a software 3d engine, but am wanting to port it to hardware, such as directx... I have some questions as to what can be done with directx. *my 3d engine was originally a dll for the DOS games creation program: DIV games studio...the new version of this that is coming out uses directx and is in windows-any comments on this? *am am pretting new to windows coding in general...but when writing a dll for DIV in dos, DIV dealt with any setup code...i would presume that this would be the same for windows, with DIV dealing with any annoying windows related stuff, leaving me to get down to the 3d-iness...? *I have most of my 3d code in place, is it easy to simply replace my (SLOW!) software poly (triangle) drawer with directx? (of course with things such as zbuffer, texturing and smoothy shading...) *what files etc will i need to start off...i''ve heard of the directx SDK, but thats 200+ mb!? (there''s no way i could download that)...but opengl only requires a few little files... *I already have code for texture loading/poly clipping/rotations etc, and would like to continue using this NOT directx specific commands? *is it possible to draw polygons onto other-than-screen locations-such as textures, for video screen effects....? (as i could do this in software) *i am trying to get by with learning as little directx as possible...all i need are some fast polygons! *any ideas where best to find tutorials...i''ve had a look at some of the XeHe ones... Please give me answers/advice/comments/help, thanks a lot!

Share this post


Link to post
Share on other sites
Advertisement
quote:
Original post by DTMdan
*my 3d engine was originally a dll for the DOS games creation program: DIV games studio...the new version of this that is coming out uses directx and is in windows-any comments on this?


nope, have never used it. But presumably a Windows version would make a direct port easy for you - although you wouldn''t really learn anything about DirectX and hardware 3D programming that way.


quote:
*am am pretting new to windows coding in general...but when writing a dll for DIV in dos, DIV dealt with any setup code...i would presume that this would be the same for windows, with DIV dealing with any annoying windows related stuff, leaving me to get down to the 3d-iness...?


The DirectX SDK comes with the "sample framework" that handles all the Windowsy stuff for you. There''s even a wizard for MSVC 6 and above that will set up a working project with the components you want.


quote:
*I have most of my 3d code in place, is it easy to simply replace my (SLOW!) software poly (triangle) drawer with directx? (of course with things such as zbuffer, texturing and smoothy shading...)


Yes. You can even pass Direct3D a list of (essentially) screen space triangles and do all the transformation and lighting in your own code. Of course that''s would be using less than half the power available in modern graphics cards which can also do the transformation, lighting and clipping for you.

You may need to change a few of your data structures or write a simple bit of code to convert your output data into a D3D friendly form, but it''s not too difficult.


quote:
*what files etc will i need to start off...i''ve heard of the directx SDK, but thats 200+ mb!? (there''s no way i could download that)...but opengl only requires a few little files...


OpenGL is a graphics library. As well as graphics (Direct3D and DirectDraw), DirectX has components for sound (DirectSound), controller input (DirectInput), video/media playback (DirectShow), music (DirectMusic) and networking (DirectPlay).
So straight away you''d expect any DirectX SDK to be 6-7 times larger than an OpenGL one (if you included the sizes of things like OpenAL, SDL, sockets etc, then you''d have a fairer size comparison.

The DirectX SDK doesn''t just contain the header, library and documentation files though. Over half of the package size consists of extremely useful example source code and tutorials for each component in C++, C# and VB. The "common sample framework" code I mentioned earlier is included in this.
For any comparable SDK, if you include the same number of samples you''d have the same size.

Finally the DirectX SDK includes various utilities as well as "debug" versions of all of the components that perform greater parameter validation etc.

Microsoft used to offer DirectX on a CD for the price of duplication and shipping, but AFAIK they''ve stopped doing that.

I know 200Mb+ is a lot if you''re using a modem, but surely there is _someone_ reasonably local to you who has broadband (or better) and a CD writer who would be willing to download it for you. Colleagues at work/college/school, friends, neighbours, a local library, a local college, a computer shop etc - when I was in that situation I was always able to find _someone_ to help (if you don''t ask you don''t get...).


quote:
*I already have code for texture loading/poly clipping/rotations etc, and would like to continue using this NOT directx specific commands?


Yep, you can do that, just use D3DFVF_XYZRHW vertices and the fixed function pipeline. Of course by doing that, you''re ignoring much of the power offered by modern graphics cards.

Depending on how your transformed and clipped vertices and polygons are stored (the data structures etc), the you might need to either modify your output structures OR copy & convert the data after its transormed (etc).


quote:
*is it possible to draw polygons onto other-than-screen locations-such as textures, for video screen effects....? (as i could do this in software)


Yes. IDirect3DDevice*::SetRenderTarget(..) does that.


quote:
*i am trying to get by with learning as little directx as possible...all i need are some fast polygons!


You can do that with Direct3D, but you''re ignoring a whole world of cool stuff if you aren''t willing to learn more.


quote:
*any ideas where best to find tutorials...i''ve had a look at some of the XeHe ones...


The DirectX SDK has some basic Direct3D tutorials -:
- the first demonstrates set up of access to a hardware device;

- the second demonstrates rendering a single untextured and untransformed Gourad shaded triangle;

- the third demonstrates using Direct3D/the hardware to transform your vertices

- the fourth demonstrates using Direct3D/the hardware to perform per-vertex lighting on those vertices

- the fifth demonstrates applying a texture

- the sixth demonstrates using the .X file format at D3DX to make handling of meshes easier.

The other Direct3D samples in the SDK show everything from how to do billboards and shadow volumes to progressive meshes and spherical harmonics.


There are some more tutorials on the DirectX website (msdn.microsoft.com/directx), Robert Dunlop''s X-Zone (http://www.mvps.org/directx/), Drunken Hyena''s site (http://www.drunkenhyena.com) etc



Simon O''Connor
Game Programmer &
Microsoft DirectX MVP

Share this post


Link to post
Share on other sites
quote:

the new version of this that is coming out uses directx and is in windows-any comments on this?



Yeah, that should have happened about 8-10 years ago...

quote:

i''ve heard of the directx SDK, but thats 200+ mb!? (there''s no way i could download that)...



http://www.getright.com

quote:

I already have code for texture loading/poly clipping/rotations etc and would like to continue using this NOT directx specific commands?




Then what''s the point of moving to hardware-based rendering? Rasterization is probably less than a quarter of the graphics card load on modern hardware. Ignoring hardware pipelines (especially the recent programmable ones) is just wasting time.




Share this post


Link to post
Share on other sites
That''s great, thanks! Seems i''ll have to download the SDK... As for thinking that i should move a lot more of my engine into hardware, i think just the polygon drawing will be fine to learn on...When i have some more experience i''ll go all the way, i promise you!
Thanks again...

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!