A Real Beginner Problem

Started by
10 comments, last by XELON 20 years, 1 month ago
quote:Original post by XELON
quote:Original post by Oxyd
Well - the answer is simple: You can''t do ANY graphics (except ascii-art) on the console (DOS screen).

Oxyd.


How did programmers make games before windows?

Spudder : Do I have to use an API? And SDL or others work on DOS or WINDOWS?


You can''t do bitmapped graphics in Console Applications, duh.
-----------------------------Language: C++API: Win32, DirectXCompiler: VC++ 2003
Advertisement
I think I found how to show the image.And it can run on console

#include <dos.h>#include <conio.h>// Global Variablesint OldMode;                       // variable to save user''s original modeunsigned char far *VgaScreen;      // variable to point to screen// Function Declarationsvoid OpenGraph();void CloseGraph();// Main Programvoid main(){     OpenGraph();                  // open graphics mode 0x13     *VgaScreen = 1;               // display a blue dot     getch();                      // wait for a keypress     CloseGraph();                 // back to user''s original mode}////////////////////////////////////////////////////// OPENGRAPH                                      //// Gets into graphics mode 0x13 (320x200x256)     //////////////////////////////////////////////////////void OpenGraph(){     union REGS regs;     VgaScreen = MK_FP(0xA000, 0x0000); // set pointer to screen address     OldMode = peekb(0x0040, 0x0049);   // save user''s video mode first     regs.h.ah = 0x00;             // service 0, Set Video Mode     regs.h.al = 0x13;             // set graphics mode to 320x200x256     int86(0x10, &regs, &regs);    // execute BIOS call}////////////////////////////////////////////////////// CLOSEGRAPH                                     //// Restores user''s original video mode            //////////////////////////////////////////////////////void CloseGraph(){     union REGS regs;     regs.h.ah = 0x00;             // service 0, Set Video Mode     regs.h.al = OldMode;          // set graphics mode back to user''s     int86(0x10, &regs, &regs);    // execute BIOS call}

Thanks for your help...
Ýstanbul-Türkiye

This topic is closed to new replies.

Advertisement