I just got Black Art of 3D Programming in C, and i want to know????

This is a discussion on I just got Black Art of 3D Programming in C, and i want to know???? within the C Programming forums, part of the General Programming Boards category; Which compiler should i use to compile the older code, and did the book help you?...

  1. #1
    Registered User
    Join Date
    Aug 2001
    Posts
    35

    I just got Black Art of 3D Programming in C, and i want to know????

    Which compiler should i use to compile the older code, and did the book help you?

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    All of the latest compilers should properly compile old C code without errors, maybe a slew of warnings, but it should work just fine. And I've never read that book, maybe someone else has.

    -Prelude

  3. #3
    Unregistered
    Guest
    I never had any luck getting the old code to compile with the copy of borland I was using (5.02 if I remember right) now I am trying to work my way through using djgpp and allegro but so far no success...please post if it works for you =)

  4. #4
    __C__
    Guest
    If you want to compile the example-code as is the book advices you to use BorlandC4.5 and Tasm4.0 (as you may have read), but you also can use any, older, 16/32 bit compiler. I tried some examples with Symantec and TurboCx.x which you can download for free at e.g.: http://alpha.faikham.com/members/infostud/turbo.html(The link from where I got it died a long time ago).
    But a better alternative would be to use WatcomC/C++ and modify the code so that it works without the 'near' and 'far'-stuff.
    The code will get a lot easier to read and understand...

    far-version...
    'byte far* vga = (byte far*)0xa0000000'
    or
    'far byte* vga = (far byte*)0xa0000000'

    near(Watcom-version)...
    'byte* vga = (byte*)0xa0000'

    When using an older compiler you have to check out if the order is 'data_type far*' or 'far data_type*'.

    DJGPP give you two possibilities to interact with Dos-memory...
    1)
    with functions declared in 'sys/farptr.h' like '_farpokeb()' etc...
    take a look at the include files
    2)
    including 'sys/nearptr' using the nearptr ?trick? which doesn't work on NT-OS.
    ...
    short* mono;

    if (__djgpp_nearptr_enable() > 0)
    {
    mono = (short*)(0xb8000 + __djgpp_conventional_base);

    //some stuff
    mono[80 * 3 + 40] = 0x7 << 8 | 'Q';

    //a grey 'Q' should appear in the center of the 4th screen row

    __djgpp_nearptr_disable();
    }
    ...

    Hope it helps (!!!errors are possible!!!)

  5. #5
    Registered User
    Join Date
    Aug 2001
    Posts
    35
    Well the source from the book works on Borland 3.1 and you can get borland 3.1 from http://www.geocities.com/tvanputten/download.htm

  6. #6
    Anti-Terrorist
    Join Date
    Aug 2001
    Location
    mming, Game DevelopmentCSR >&<>&2Minimization of boolean functions, PROM,PLA design >&0>&WA, USA guitar, dogsCommercial Aviation >&>>&USAProgramming
    Posts
    742
    I have this book. It is not a new book and therefore it's value is not so much related to its code. No new compiler will run that obsolete code, yet the book is worthwhile because it describes how game programming is different than business programs. There are not many game programming books out there using the new technology. I think a lot of it has to do with trade secrets.
    I compile code with:
    Visual Studio.NET beta2

Popular pages Recent additions subscribe to a feed

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