Dos Graphics?

This is a discussion on Dos Graphics? within the Game Programming forums, part of the General Programming Boards category; I can't seem to find anyone who will tell me how or even that it is possible to display graphics ...

  1. #1
    Registered User Ranedhel's Avatar
    Join Date
    Jun 2003
    Posts
    34

    Dos Graphics?

    I can't seem to find anyone who will tell me how or even that it is possible to display graphics without using windows commands.
    I am quite sure that it is possible because I have played many games dating before they every had windows, so will someone tell me how it is done?

    -Thanks,
    Ranedhel
    -Elven Forge Software-
    (Lead Designer)

    http://www.geocities.com/elvenforge

    **infected by frenchfry164**
    I am a signature virus. Please add me to your signature so that I may multiply

  2. #2
    Cat
    Cat is offline
    Registered User
    Join Date
    May 2003
    Posts
    1,571
    Yes, they had graphics in DOS days. However, it's not easy to use them anymore.

    In the "old days" you told the video card to enter a certain mode (and hoped the video card HAD that mode). Then you wrote graphics data straight into the video memory.

    This was a Bad Idea. Programs became very hardware dependant, both on audio and video. Old programs wouldn't always work on new cards, you had to know technical properties of the card itself (IRQ, DMA), and it was very difficult for hardware developers to release new hardware.

    Enter the Good Idea of a software abstraction layer. Under modern operating systems, hardware developers create drivers for their hardware. Programmers use operating system calls, and the OS is responsible for using the appropriate driver calls. This means that hardware and end-user software are decoupled; the programmer doesn't need to know about the hardware, and the hardware creators don't need the support of the software market.

    But this has led to legacy software being stuck in limbo. Few people make compilers to handle DOS graphics anymore; most DOS graphics engines are 10 years old or more. Further, DOS itself doesn't even exist on modern Windows systems. Windows 3.1, 95, 98 and Me all were running under DOS, but Windows NT, 2000, and XP are true operating systems, not merely graphical systems running on top of DOS. On WinNT, Win2K, and WinXP, as well as future operating systems, what you see as a command prompt is an emulation of DOS, and it's not perfect. It's hellish to try to get many DOS games working, even under XP which is better at emulation.

    Bottom line, if you want to do it, try looking for compilers from the early 90s; some are even free now. But don't be surprised if you can't get DOS graphics or sound to work under modern operating systems.

    Rather than trying to waste time learning to write code for a system which is now nearly totally obsolete, you may as well learn modern graphics, either Windows GDI, OpenGL, or DirectX. In the long run they'll certainly be more useful to know.

  3. #3
    Registered User Ranedhel's Avatar
    Join Date
    Jun 2003
    Posts
    34

    Re:

    I had hoped it wouldn't come down to this, but I guess it has.
    I'm just sorta daunted by windows programming...but oh well,
    it looks like I don't have much of a choice.

    Which of those three do you suggest? I am inclined to go with DirectX...
    Last edited by Ranedhel; 07-24-2003 at 08:22 PM.
    -Elven Forge Software-
    (Lead Designer)

    http://www.geocities.com/elvenforge

    **infected by frenchfry164**
    I am a signature virus. Please add me to your signature so that I may multiply

  4. #4
    Crazy Fool Perspective's Avatar
    Join Date
    Jan 2003
    Location
    Canada
    Posts
    2,640
    >> Which of those three do you suggest? I am inclined to go with DirectX...

    this question has been (and will be) argued many times. i found openGL along with NeHe's tutorials a good place to start 3D graphics programming.

    check the sticky at the top of this board for links....

  5. #5
    Cat
    Cat is offline
    Registered User
    Join Date
    May 2003
    Posts
    1,571
    Depends on a lot of things. I personally like DirectX, but you will probably need a book or two because it's a complicated area. DirectX has the benefit of exposing you to COM, and it is more similar to the WinAPI than OpenGL, so it can assist you on that front as well.

    Windows GDI is probably the easiest and first place to start, though, if you have any desire to do Win applications.

  6. #6
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,590
    In the "old days" you told the video card to enter a certain mode (and hoped the video card HAD that mode). Then you wrote graphics data straight into the video memory
    ...but there were some standardized VESA and VBE functions that would allow you to parse the available modes for that card. As well you could find out the RGB structure (555, 565, etc.) for the different modes.

    So once you wrote the startup code for the video cards using VESA and VBE most of it was pretty standard from then on - that is once VESA and VBE became 'standardized'.

    The one major downfall I can see with the current setup is that it is harder IMO for a newcomer to learn graphics programming. Before they even begin they are inundated with a lot of C++ code and Windows bloat which can be intimidating. I'm glad I learned in DOS - the 3D knowledge that I gained by having to 'do it all from scratch' has really helped me in DirectX.

    My advice is to learn as much as you can - perhaps even setup a Windows 98SE system simply to learn graphics concepts on. Code a small 3D engine from scratch - then get a book about DirectX and start coding from it. If you don't have the resources to do that, a good book that explains a lot of 3D concepts is Andre Lamothe's Tricks of the Windows Game Programming Gurus. There is DirectX startup code but he makes it pretty easy and he will take you through a lot of the rendering principles since he is not using D3D.

    So if you want to learn graphics concepts then code a software renderer in DirectX - again this might be harder in DX8 and DX9 since DirectDraw has been merged into Direct3D.


    Note to the board members: Perhaps it would be wise for us to code a DirectX startup module for newcomers to graphics. Since DirectX is so universal, it should work on a lot of different graphics cards and configs. This way we could give newbies sort of a DOS setup to mess with. That is, we could setup the Windows crap for them, tell Windows to take a hike, and get into the meat of the code - which is essentially very close to what you would do in DOS with pointers to buffers, etc.(in DirectDraw that is)
    Last edited by VirtualAce; 07-24-2003 at 10:47 PM.

  7. #7
    l'Anziano DavidP's Avatar
    Join Date
    Aug 2001
    Location
    Plano, Texas, United States
    Posts
    2,738
    Bubba has a very good idea, and I would be glad to help develop that module.

    I also learned all my graphics experience from the "old" DOS modes, 13h mainly, and I love DOS graphics. Yes, now I have moved on to such API's as DX, OpenGL, and SDL, but a place will always remain in my heart for the old DOS graphics modes, and I always intend to keep one computer in my house capable of running them.

    I believe it is very important for a person learning graphics to learn the fundemental concepts first, and often times when one starts out with DX or OpenGL (ESPECIALLY OpenGL...it doesnt teach fundementals worth CRAP), fundementals are often left out of the process. That is why starting "from scratch" in the DOS modes is so helpful to the learning process.

    It is very fun to program in 13h mode. One of the best experiences you will have. I suggest going to www.brackeen.com if you have not already visited it, and visit the VGA tutorial that is stored there. It is by far the best DOS graphics tutorial on the internet. I have referenced it for about 3 years now and have yet to find anything better.

    Windows XP is able to do 13h graphics, but yes, DOS is much harder to do in an XP environment than in a Win9x environment. However, 13h should run just fine (just dont try and use any audio while you are working with it in WinXP...it will KILL you). But other than the no audio limitation, 13h should work fine in XP.

    I highly suggest learning 13h to any beginner wanting to learn graphics, and also, Bubba had a great idea too for those beginners, and I would be glad to help with that.
    My Website

    "Circular logic is good because it is."

  8. #8
    Cat
    Cat is offline
    Registered User
    Join Date
    May 2003
    Posts
    1,571
    Originally posted by Bubba
    ...but there were some standardized VESA and VBE functions that would allow you to parse the available modes for that card. As well you could find out the RGB structure (555, 565, etc.) for the different modes.

    So once you wrote the startup code for the video cards using VESA and VBE most of it was pretty standard from then on - that is once VESA and VBE became 'standardized'.
    Yup, I remember. I started programming in the days of VESA VBE 1.2.

    The one major downfall I can see with the current setup is that it is harder IMO for a newcomer to learn graphics programming. Before they even begin they are inundated with a lot of C++ code and Windows bloat which can be intimidating. I'm glad I learned in DOS - the 3D knowledge that I gained by having to 'do it all from scratch' has really helped me in DirectX.
    I dunno, I think WinAPI or at the least, MFC (preferably both) is just something a Win32 programmer should know. Learning to write programs for your OS should just be the logical progression of programming. I think that people that want to "jump the gun" and move to graphics without mastering their OS first aren't following a wise strategy.

    And yes, I too have a fond memory of 320x200x256 DOS graphics (or the 320x240x256 of Mode-X). I also have fond memories of my 386, but memories aside, I don't think the 386 has mainstream use today, and I tend to feel the same about Mode 13/Mode X graphics. Yes, we benefitted from learning them, but I don't think the payoff is as great for beginners today, and using it as a shortcut to avoid learning necessary steps only hurts in the long run.

  9. #9
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,590
    I dunno, I think WinAPI or at the least, MFC (preferably both) is just something a Win32 programmer should know.
    Agreed. However most of DirectX programming is not related to the WinAPI at all. Granted you can call out to it, but save for thread functions and few other useful ones, it will only hurt your program to call the WinAPI from DirectX since it is not optimized for games and/or graphics.

    For keyboard you can use DirectInput which is far better than anything in the Windows API. As for graphics, GDI will not even work within DirectX. So essentially Microsoft has provided us with an API that rarely uses much of the Windows API to accomplish what it needs to. For games to even work well you must have access to the hardware - thus the drivers for DirectX - albeit a bit abstract in how it interfaces with the hardware - transparent to the programmer.

    So I can't support the opinion that one must absolutely learn the WinAPI and/or MFC prior to getting into DirectX. One must only learn enough to get the main windows up and running, the main message loop, and later perhaps some threads here and there. Other than that, you really don't need the Win32 API at all. Granted we understand what callback functions are and what they do, but is that essential to a new coder who just wants to dive in and do graphics on-screen? IMO no.

    But I can support the opinion that new coders should learn as much about graphics before they jump into DirectX - and also they should learn as much about C and/or C++ prior to programming graphics and games. Perhaps a little bit of assembly wouldn't even hurt, but definitely not necessary.

    If you can't code in C, then you won't be able to make a game.
    If you can't code for the API, you won't be able to make robust business application - but you should be able to make games by getting some startup code for DX up and running. There is a huge difference between learning C and the Windows API. Should you learn WinAPI - yes, eventually you should. Is it absolutely necessary to do DirectX? I don't think it is.

    Just my opinion for what its worth.
    Last edited by VirtualAce; 07-25-2003 at 07:10 AM.

  10. #10
    Cat
    Cat is offline
    Registered User
    Join Date
    May 2003
    Posts
    1,571
    I agree that WinAPI isn't AS needed for games (you still, as you said, need to know the basics), but I think it's a logical progression of difficulty levels, and you should at least know the fundamentals of how the API works.

  11. #11
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,590
    Agreed.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. DOS graphics help!!
    By kiss_psycho in forum C Programming
    Replies: 2
    Last Post: 02-21-2003, 01:28 PM
  2. Graphics for DOS under Dev-C++
    By bubux in forum C Programming
    Replies: 16
    Last Post: 07-08-2002, 01:24 PM
  3. Dos graphics header
    By Vicious in forum A Brief History of Cprogramming.com
    Replies: 7
    Last Post: 05-14-2002, 12:24 PM
  4. Extremely Simple Graphics In Dos
    By Unregistered in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 03-07-2002, 06:25 PM
  5. VC++ graphics in dos.
    By StormySpike in forum C++ Programming
    Replies: 5
    Last Post: 09-28-2001, 10:24 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21