Black art of 3d Game Programming
I just purchased "Black art of 3d game programming in c" and I am wondering how you compile the source in MSVC 4.0. It doesn''t include the proper include files "graph.h" or "bios.h". Why is that?
Remember that this is only dos programs, as such you should compile them as console applications. I''m not sure if that is the problem.
I you tell me which project you are trying to compile I might be able to help you some more. No need to post the actual source code as I have the book myself. (Don''t like it though, too outdated for my taste
)
I you tell me which project you are trying to compile I might be able to help you some more. No need to post the actual source code as I have the book myself. (Don''t like it though, too outdated for my taste

I can''t compile the guess.c or the light.c(I think that''s what it''s called). They are the first examples in the book and I can''t compile them.
I would go get a pure DOS compiler. I haven't used it, but I'm guessing DJGPP would compile that code just fine, and it's free
.
--TheGoop
Edited by - TheGoop on 2/25/00 5:22:20 PM

--TheGoop
Edited by - TheGoop on 2/25/00 5:22:20 PM
Oh man is that some broken code. 
I just fired it up and here''s what I had to do to get guess.c working:
Voila! The program is working...
You might do better with DJGPP as TheGoop suggested but I have never tried that.
My suggestion to you right now, is to read the book and understand the algoritms. Forget the source code as it will probably only work with considerable changes like these.
As I said the book is a bit outdated for my taste

I just fired it up and here''s what I had to do to get guess.c working:
- Start a new Win32 console application
- Add guess.c to the project
- Comment out #include <graph.h>, it is not used in the code.
- Add these includes to get the system time:
#include <windows.h>
#include <mmsystem.h> - Comment out this line, it''s obselete and would probably only work on a 486:
unsigned int far *clock = (unsigned int far *)0x0000046CL; // pointer to clock - Change the seeding of srand() to:
srand(timeGetTime()); - And finally link with winmm.lib.
Voila! The program is working...

You might do better with DJGPP as TheGoop suggested but I have never tried that.
My suggestion to you right now, is to read the book and understand the algoritms. Forget the source code as it will probably only work with considerable changes like these.

As I said the book is a bit outdated for my taste

quote:
5.Comment out this line, it''s obselete and would probably only work on a 486:
unsigned int far *clock = (unsigned int far *)0x0000046CL; // pointer to clock
Actually still works on any PC compatible machine. Problem is that the address 0x0000046C lies in protected memory space. So only if you run DOS or in DOS compatibility mode. That is *not* Win32 console applications, but true blue 16-bit DOS apps.
And the programs compile and run fine on a DOS native compiler. We''re talking Microsoft C 6.00 (not MSVC++ 6.0, but the dinosaur that birthed the VC series), or Borland Turbo C++ 2.0 (another dinosaur).
Oh and, I believe, DJGPP dropped support for "bios.h" so even that wouldn''t work anymore.
My recommendation is return the book and get something more modern. It''s really hard to get your money''s worth when you can''t see any of what it does in action.
If you look past the old 16-bit DOS stuff and get to the meat of the book - the 3D principles & 3D engine, then your money was well spent. I learned quite a bit from that book. I was able to get a basic DOS 3D engine up and running using Allegro''s graphics routines. Then I made another for Windows using DirectX. All the 3D stuff was based on what I learned from that book, and I''ve since been able to expand my knowledge through trial & error and the internet.
But if you really want to get down & dirty with the first half of the book, look around for an older copy of Borland C (3.0 or 4.5). I picked one up a few months ago at an electronics market in Seoul, Korea for about $5 US. Restart your comp in MS-DOS mode with one of those 16-bit compilers and go to town.
But if you really want to get down & dirty with the first half of the book, look around for an older copy of Borland C (3.0 or 4.5). I picked one up a few months ago at an electronics market in Seoul, Korea for about $5 US. Restart your comp in MS-DOS mode with one of those 16-bit compilers and go to town.
--- Official D Blog | Learning D | The One With D | D Bits
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement