Skip to main content
gamedev.net
🔒 Locked

Microsoft C/C++ 7.0?

Started by thomBligh Mar 9, 2000 at 6:22 PM 10 replies 1.8k views
Original Post
thomBligh
thomBligh
I have been a programming in BASIC for 14 years, (I know, im pathetic!), and in that time I''ve learned all sorts of stuff about graphics. (All the basics of 3d rotations, translation, backface culling, shading, texturing, etc..) I recently, within the past 2 years, started learning C++. I thought i knew just about everything I was gonna know about the dos side of C++, and I''ve not yet moved on to windows programming. I saw a post on this sight talking about the book Black Art Of 3d Game Programming by Andre LaMothe, so I went out and ended up buying it. It looks really awesome, but I ran into a big wall. He uses examples from Microsoft C/C++ 7.0, but I have Microsoft Visual C/C++ 6.0. I NEED to know how to set the video mode using the BIOS interrupt.... Here is an example, something that I cant get running in my version. //My intention is not to offend the author by giving away //his material, this was totally written by Andre LaMothe, //so I cant really say feel free to use it any of your //programs... sorry. void Set_Graphics_Mode(int mode) { union REGS inregs, outregs; inregs.h.ah = 0; inregs.h.al = (unsigned char)mode; _int86(0x10, &inregs, &outregs); } if anyone out there knows how to convert this function to MS Visual C/C++ 6.0, your help would be greatly appreciated! P.S. The errors I get when compiling, say ''inregs'' uses undefined union ''REGS'' ''outregs'' uses undefined union ''REGS'' left of ''.h'' must have union/class/structure type left of ''.ah'' must have union/class/structure type left of ''.al'' must have union/class/structure type
Densun
Densun
As far as I know, it''s not possible to do that in MSVC++ 7 or in other earlier versions.

You''re best bet is to learn DirectX or some other graphics API.
Fredric
Fredric
LOL VC++ 7.0?! Ha! That book was published in 1995! That book is as old as the hills... it''s becoming more useless with every passing minute.

Programming::~Fredric(const Annoy_Ance)
3D Math- The type of mathematics that'll put hair on your chest!
Atavist
Atavist
The answer: (as far as I know)

Visual c++ is 32-bit and works with the operating system. It doesn''t allow you to call interupts with inline asm or otherwise, this could comprimise the operating system. You''ll need a different compiler if you intend on useing vesa or other such nonesense

Directdraw isn''t too much harder than working with interupts, in my opinion.

One person said that the games industry is "a transfer of funds from the rich to the lucky"
Just because the church was wrong doesn't mean Galileo wasn't a heretic.It just means he was a heretic who was right.
thomBligh
thomBligh
thanx for the tips peoples, i tried using the inline assembly a couple of minutes ago to something like this...

_asm
{
mov ax, 3 //text mode after..
int 10h
}

and it totally locked up my computer!

i guess d3d might be the way to go, i guess i should have bought a newer book...

frizb
frizb

Did I miss something? MSVC++ 7.0 ????

Still Learning...
Still Learning...
ARCHIGAMER
ARCHIGAMER
I have no clue where you got that shit. Visual C++ 6 wasn''t even made by 1995 and Visual Studio 7 hasn''t been announced until recently (actaully VB 7 was announced so I am assuming visual studio 7 is coming)
I wish there was a button on my monitor to turn up the intellegince. Theres a button called 'brightness' but it doesn't work
LaughingD
LaughingD
The book uses Microsoft C/C++ 7 which is the last DOS version. MSVC 7 will not be out until later this summer (as I understand it). Confusing, I know, but they are two different products.

So, thomBligh, as another post said, you won''t be able to compile those programs with MSVC6 as it is a pure 32 bit compiler and doesn''t do DOS. You will need to find a 16 bit compiler to compile those apps (I''ve got one if you want to buy it off me MSVC 1.52))

A better solution would be to get a new book that is based around DirectX. I hate to do this (as I think Andre has some strange ideas about several things), but his latest books, Windows Game Programming for Dummies and Tricks of the Windows Game Programming Gurus look to be about the best newbie books available.

After getting around that stuff, you could probably convert the other book to DX (either that or get a book on D3D or OpenGL).



Mark Fassett
Laughing Dragon Entertainment
http:\\www.laughing-dragon.com
CGameProgrammer
CGameProgrammer
VC++ 4.0 was the first 32-bit version of Visual C++. Microsoft''s first 32-bit OS, Windows 95, came out in ''95, of course. So 5.0 didn''t come out until a couple of years later, and 6.0 came out like within the last year.

Also, are you sure you can''t make DOS programs with VC++? If you look under Project... Settings, and click on any tab that shows the compiler parameters (like the "C/C++" tab), you''ll see one of the compiler parameters is "/w". This tells the compiler to create a Windows program. If you delete that parameter, I am pretty sure your code will work.

~CGameProgrammer( );

~CGameProgrammer( ); Developer Image Exchange -- New Features: Upload screenshots of your games (size is unlimited) and upload the game itself (up to 10MB). Free. No registration needed.
thomBligh
thomBligh
Sorry about the confusion everybody, I never wrote MICROSOFT VISUAL C/C++ 7.0, i wrote Microsoft C/C++ 7.0, just to clear things up, thanx for the help, maybe I will take you up on that offer Laughing Dragon!

PS Thank you everyone for helping a newbie C++ programmer like myself, Ive never seen a message board like this one, where you actually get good info from other posters!
LaughingD
LaughingD
With the 32 bit versions of MSVC, you can create a console app, but that is different than a DOS app. There are a bunch of headers that are necessary for true DOS programming (besides the fact that DOS is 16 bit) that do not come with the 32 bit versions of MSVC. This is likely the source of his errors (though I can't say for sure).

One other note... I believe that MSVC 2.0 was the first 32 bit version (might have been 2.1 or something like that). 4.0 was just the first usable version of the IDE. (That 1.52 ide is just nasty ).


Edited by - LaughingD on 3/11/00 4:17:30 AM

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.