Jump to content
  • Advertisement

Archived

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

rtr1129

DirectX over DOS? Simple question

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

I''m just curious as to why people program in Windows and use DirectX so that they can have a programming environment that works like DOS programming where you could access the hardware directly. I''ve always been under the assumption that DOS games are faster than Windows games. Is that correct or not? Also, does the fact that DirectX allows for hardware acceleration for just about all types of video cards play a role in why DirectX is better to make games with than just plain old DOS? Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Dos is terrible to interface with hardware. you would have to write all the code to handle it all yourself. directx is hardware independant. it emulates hardware that may or may not be there and as long as anykind of hardware has a dx driver for it, it is gurranteed to work. it is much simplier and less hardware specifically

<(o)>

Share this post


Link to post
Share on other sites
DOS has less overhead, but chances are that anyone running a DOS game will be running in Windows anyway. So you don''t really gain anything.

In DOS you can use Mode 13h, Mode X, or Vesa BIOS Extensions (VBE). VBE gives you high resolution modes and a certain level of hardware independance, but isn''t as capable as DirectDraw (Blting, etc). Also, Windows NT/2000 doesn''t allow programs to access hardware directly... a VBE-based graphics engine I did a couple years ago refused to run under NT.

If you target Windows, you have to deal with the event model (messaging) and DirectX is in COM, which is kind of ugly. Fortunately, you can make wrappers for all these things (or use an already built engine) and then not worry about it.

DirectX will take advantage of hardware acceleration and (usually) provide emulation if the hardware isn''t there.

Also, there is nothing stopping you from doing your own ASM optimized routines under Windows: for software Blting or software 3d engine, etc. You can do inline ASM, or you can get a copy of MASM for free. TASM and NASM are other options.

Another benefit of Windows is the flat memory model (no segments or 64K limits). Unless you are using DOS4GW and Watcom C++ (or similar) you won''t get this advantage under DOS.

Tricks of the Windows Game Programming Gurus by Andre LaMothe is a pretty good book for learning the basics of Windows coding and DirectX (except Direct3D and DirectPlay, which it doesn''t cover).

In the end, DOS has been dead for several years now. It might be a good place to learn some basics, esp. if you have low end hardware. Otherwise, go with Windows... or look into Linux game development if you prefer.

- n8



nathany.com

Share this post


Link to post
Share on other sites
this may just be an aside and kind of off topic, but if i wrote a game or program using opengl in windows, would it run in linux or unix without any changes?

<(o)>

Share this post


Link to post
Share on other sites
this may just be an aside and kind of off topic, but if i wrote a game or program using opengl in windows, would it run in linux or unix without any changes?

<(o)>

oops, ignore this one

Edited by - aDasTRa on May 17, 2000 12:39:32 AM

Share this post


Link to post
Share on other sites
quote:
Original post by aDasTRa
this may just be an aside and kind of off topic, but if i wrote a game or program using opengl in windows, would it run in linux or unix without any changes?



no. i don''t know opengl or linux, but think about it. opengl is graphics, even if that works without changes you also have input, sound, networking, etc. i imagine with experience with both platforms and a bunch of #ifdef''s or something, you could get it working though...

- n8

P.S. there is an option to delete a message when you click Edit.





nathany.com

Share this post


Link to post
Share on other sites
aDasTRa: Yes and no...

All core OpenGL functions MUST work on any OpenGL implementation. I''m assuming you are going to use Mesa for this.

Programing for windows, however, requires a lot of junk: Event handling, Device contexts.... YUK! Linux needs none of that nonesense. So, in order to port your program, you''ll need to get rid of this!

The most simple way would be to create seperate main source file, and link your OpenGL stuff in another file. You could also retain the one file and use #defines to do it, but I think this is a messy option.

So, you won''t need to change much code, but you will need to do some minor changes. IMHO, mesa + GLUT is a great combo under linux / UNIX.

Simon

Share this post


Link to post
Share on other sites
Not forgetting file limitations that are inherrent in a true Dos environment IE not just a Dos box running under windows. Windows has now become a far superior gaming environment over Dos.


Share this post


Link to post
Share on other sites
Hey guys...i have to teel you this:

DOS IS MUCH FASTER THEN WINDOWS....
because
1.There is no overhead with messages/objects and stuff
2.You can use hardware directly
3.16bit code is MUCH faster then 32 bit code
4.You can disable interupts when needed for speed

DOS IS HARDER TO PROGRAMM.....
because
1.Almost all new hardware have drivers only for Windows
2.You must know more about hardware and generaly programs are not compatible with all hardware
3.You dont have 32 bit huge linear memory adress or if you have it *via a dos extender, you have to know things about slectors and Global descriptor tables...so not very easy again
4.Even if its more faster its not commercial anymore to make programms for DOS.... you have to do it for windows or evantualy unix if you want to make money from it

And yes in the Micro$ofts documentation said:
"DirectX is "almost" as fast as DOS"....lol it dosent even compare on same hadware platform....i can outperform it 10x
but you have to write your own drivers...ughhhh

Hope this helps

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!