Archived

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

vaneger

dos graphics in MVC C++ 6.0

Recommended Posts

vaneger    100
hi, im trying to figure out how to use dos graphics in c++, unfortuantly my computer science teacher doesnt know so im posting here. Im looking for graphics similar to the basic ones in well BASIC like circle, line etc.Any Help?

Share this post


Link to post
Share on other sites
Palidine    1315
goto google:

search for: DOS Graphics Library

tons of links there

-me

[edited by - Palidine on May 1, 2002 8:12:40 PM]

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
If you''re talking about graphics as in lighting up one pixel at a time, you have to use software interrupts to call BIOS and MSDOS functions - which does get tricky if you''re not familiar with assembly and how interrupts work.

Share this post


Link to post
Share on other sites
Palidine    1315
i''m pretty sure he means things like drawCircle(center_x, center_y, radius). or line(begin_x, begin_y, end_x, end_y).

i did some stuff with that back in high school. the teacher provided us with a DOS graphics API. that''s way to long ago for me to remember so i''d follow that google trail.

-me

Share this post


Link to post
Share on other sites
Martee    476
And that stuff won''t work in VC6 anyway. If you want to do graphics, you''ll need to use GDI, DirectX, or a wrapper lib such as Allegro, SDL, or ClanLib.

Share this post


Link to post
Share on other sites
i8degrees    122
quote:
Original post by Martee
And that stuff won''t work in VC6 anyway. If you want to do graphics, you''ll need to use GDI, DirectX, or a wrapper lib such as Allegro, SDL, or ClanLib.


Actually, I''m pretty sure it WOULD work on VC6, provided that you set it up correctly! Remember, VC6 still can do DOS apps.

To the original poster, this link will provide you with everything you need to get started doing VGA graphics in 13h (320x240x256).

http://www.brackeen.com/home/vga/index.html

"I am governed by none other than the Laws of the Universe."

Share this post


Link to post
Share on other sites
Arild Fines    968
quote:
Original post by i8degrees
[quote]Original post by Martee
Remember, VC6 still can do DOS apps.


Not true. VC++6 can only do 32 bit Windows applications.



Share this post


Link to post
Share on other sites
mmelson    232
quote:
Original post by Arild Fines
Not true. VC++6 can only do 32 bit Windows applications.



I think he''s mixing up DOS and console apps (which VC++ 6 can definately do).

Mike

Share this post


Link to post
Share on other sites
i8degrees    122
Hmm, guess I will actually have to install VC6++ and see myself, I always thought that you could...

"I am governed by none other than the Laws of the Universe."

Share this post


Link to post
Share on other sites
cozman    583
use SDL (they have a MSVC makefile, and i have written a very basic primitives library.. see the post on this board about gfx utilities

Share this post


Link to post
Share on other sites
vaneger    100
i am trying to program a ld dos based game for pratice and experience, thus i want to use the dos graphics, not windows graphics, i will look in to the links posted but if any one has new info any help is welcome

Share this post


Link to post
Share on other sites
robertocarlos    122
I used turbo C++ graphics(bgi).Use the header graphics.h and you can do circles,rect,..etc.Its nice to start with but only 16 colors and slow.All the best !

The sky is the limit !

Share this post


Link to post
Share on other sites
cpp boy    116
Hi people i like vaneger and i too trie to do dos game because it not microsoft ( well not 100 %) i got a litle good news i saw some one load an image fole in dos whit vc++ 6.0 and it was working on my compiller of vc++ 6.0 soo if anyone can help me find this example than we could know how load an image in dos and of course show it on the screen

Kevin

Share this post


Link to post
Share on other sites
barazor    122
quote:
Original post by cpp boy
Hi people i like vaneger and i too trie to do dos game because it not microsoft ( well not 100 %)
you do know that microsoft made dos right?

Share this post


Link to post
Share on other sites
Oh, I just can''t help it! :

No they didn''t, they brought it, and sold it to IBM, since IBM needed an OS for their new computer line, and the current main OS at that time (can''t remeber the name: come on, i wasn''t even alive then!) didn''t suit them for some reason. Microsoft brought the then called "Quick and Dirty OS" , renamed it to MS Dos and sold it to IBM on a contract that allowed them to sell it to other companys as well (Bill knows how to make his money, damnit!). They when edited it, and I think they have just finaly scraped it for MS-DOS-free Windows XP

(Please correct me. I wasn''t even alive then, and these "facts" are based on a book i read!)

Share this post


Link to post
Share on other sites
Oluseyi    2108
quote:
Original post by Jack of Null Pointer
(Please correct me. I wasn''t even alive then, and these "facts" are based on a book i read!)

So why did you bother saying it?

MSVC doesn''t do DOS. Microsoft owns DOS, and even if they bought the original version, they developed it through version 7.0 at least.

It''s better to find a simplified graphics library for Windows - SDL is a good choice.

[ GDNet Start Here | GDNet Search Tool | GDNet FAQ ]
[ MS RTFM [MSDN] | SGI STL Docs | Boost ]
[ Google! | Asking Smart Questions | Jargon File ]
Thanks to Kylotan for the idea!

Share this post


Link to post
Share on other sites
stimarco    1071
quote:
Original post by Jack of Null Pointer
Just becuase it is a quite cool story. I thought someone might be interrested.


It is correct in essence, but you omit the reason why it was called QDOS: it didn''t do diddly. MS-DOS V1. (aka QDOS) only ran on floppy disks -- MS added hard drive support. It didn''t even have a hierarchical file system (i.e. no folders).

MS-DOS was on version 7 or so before MS ditched it entirely prior to XP''s release. That''s seven iterations over twenty years. Sure, MS may only have written 99.999% of the current code, but they sure as hell own the full 100%.

Summary: if you''re [still] running MS-DOS today, you''re using Microsoft code in a Microsoft product. Period.

*

Incidentally, graphics under Windows is a piece of cake and far, far easier than DOS. Using GDI, you can request something called a "DIBSection", which is just a splat of memory you can draw onto to your heart''s content. Better still, GDI includes those very same "DrawCircle()"-type functions you were after as well.

You can, alternatively, switch to something like DJGPP and Allegro if you really, really want to mess with MS-DOS coding. It''s not as much fun as people make it out though.




Share this post


Link to post
Share on other sites
Ed Johnson    122
quote:
Original post by Arild Fines
[quote]Original post by i8degrees
[quote]Original post by Martee
Remember, VC6 still can do DOS apps.


Not true. VC++6 can only do 32 bit Windows applications.


u r so sadly mistaken

Share this post


Link to post
Share on other sites
S1CA    1418
Ed:

I''ll also add a "how so ?"...

...all of the default executable project types available in VC++ 6 create **32-bit** Win32 applications.

All of which will display a startup banner saying "This program cannot be run in DOS mode" if run in *TRUE* DOS mode (i.e. not in a DOS box/console window/Win2k cmd window).

Also note the fact that the project settings no longer contain segmented memory settings etc.

Older versions of VC++ from the Windows 3.1 days did indeed have DOS compilers and they also had a special 32-bit version for use with Win32s prior to the release of Windows 95. (Back in those days the C++ part was on a separate CD to the C part - average C++ compilers back then were simply using CFront).

It''s also true that you can plug true DOS compilers into the Visual Studio/DevStudio IDE (in the same way that you can plug in compilers for non-PC platforms - such as the Pro-DG tools for GameCube and PS2).

I may of course be wrong - I haven''t done any DOS coding since 1994 when the compiler definately did support true DOS. In all the recent versions of VC++ I''ve used I''ve definately not come across DOS compilation.


--
Simon O''Connor
Creative Asylum Ltd
www.creative-asylum.com

Share this post


Link to post
Share on other sites
declspec    126
yes but it does do dos in the 32bit vmachine (chip level). which supports all the dos interupts. which would allow drawing in the window via dos interupts. which allows for a code library for 32 bit dos vmachine drawing. dont believe this? your assembly apps are generally run in the same vmachine. all the msdos interupts you knew and loved are still there.

thos apps if compiled for 32bit vmachine dos only run in that vmachine. the compilier also makes true windows apps that can run outside of it.

again vmachine is an intel chip level concept.

the rub here is in the lingo. its not expressive enough.
16 bit dos runs either in a vmachine or in real mode.
32 bit dos runs in a vmachine.

the push is that any techniques for drawing in a 16 bit dos proggy can be ported to a 32bit dos program no probs.

is this easier then learning to draw with DCs it prolly is. its rewarding too.

you can do the asm__ too and really get screaming. which you could with DCs too but...

then there is various libraries but come on the ramp on those is steep for even someone bright. there is just alot to learn. learning to call dos interupts in a windows 32bit app is much easier to learn as far as speed. a few commands and roar.

DCs arnt much harder though once you get into them.





Share this post


Link to post
Share on other sites
a person    118
it is correct the default vc++ 6.0 compiler does not create dos apps. it only creates 32bit windows apps. in fact the only dos code produced is the "This program will not run under dos mode" stub so if you run the exe in dos you know your not supposed to. furthermore, dos apps a 16bit by nature unless you do some spiffy asm to get protected mode working. this means segmented memory, 640k barrier, no virtual memory, etc. use djgpp for dos if you want. its free, and i am sure a serach on google will prdouce it.

personally i suggest using sdl or directdraw. both allow clean dos like access to vram easily and safly with no asm needed (dos would require some asm code for initing the video mode and such). you get flat memory addressing (ie with dos you need to deal with segments on any memory allocated over 64k) which is TONS eaiser to deal with. plus most things you will want to do in dos can just as easily be done using directdraw, sdl, or dibs and the gdi. furthermore, unless you are running win98 or earlier you cant even access dos correctly (winme requires a hack to reboot to dos, win2k, winnt, winxp all emulate dos to varying degrees with winnt be terrible and win2k,winxp running some graphical apps).

doing graphics in dos, requires you to draw ALL your own graphics by directly accessing vram using a pointer. sdl has some simple functions to draw primitives. so does the gdi.

declspec, windows dont let you access certain interrupts. while in 32bit protected mode, the cpu gauards agains apps that are not at a sufficent ring level to execute certain instructions or touch certain interrupts. this is how an OS like linux or nt can protect direct hardware access from user space apps (ie games). dos is the only os i know of that allowed direct hardware access by all apps. this is mainly because it was 16bit so there was no protected mode during normal operation. if the cpu allowed any app to do anything it wanted, then you could not have a secure os. the whole point of 32 protected mode and the virtual machine was to allow different processes to run without them being able to touch each other or the os. thsi is why dx is kernal level and sdl uses dx on windows platform.

Share this post


Link to post
Share on other sites
incin    205
dont try doing dos interrupts for graphics using vc++, it won''t work. windows wont allow those interrupts to be called from a console app. it wont produce an error, but doesn''t work. sure pissed me off when i changed from borland to vc++ and tried to continue a mode 13h game i was working on. I dont know if someone already expressed all this already, but oh well. Use a different compiler, or ''non-dos'' graphics.

Share this post


Link to post
Share on other sites