Newbie needs basic graphics help

Hi everyone,
I'm learning the basics of graphics programming. All I want to do right now is set the video mode, put pixels, and draw lines for fractals. I've got a book on fractals written in 1994 with some Turbo Basic examples. I am fairly conversant in C/C++ and assembly. I haven't really written any assembly on the PC, but I have on several microcontrollers and my old Atari 800 back in the day. I downloaded a nice tutorial on VGA from this site (by Denthor) but it only talks about MCGA (320x200x256). This turorial was last updated in 1994. My Borland C/C++ compiler is of the same vintage. I'm just a weekend programmer searching for very basic info --- any help much appreciated.

Thanks,
Jeff Johnson
jjohnson@csw.L-3com.com

Comments

  • : Hi everyone,
    : I'm learning the basics of graphics programming. All I want to do right now is set the video mode,
    : put pixels, and draw lines for fractals. I've got a book on fractals written in 1994 with some Turbo
    : Basic examples. I am fairly conversant in C/C++ and assembly. I haven't really written any
    : assembly on the PC, but I have on several microcontrollers and my old Atari 800 back in the day.
    : I downloaded a nice tutorial on VGA from this site (by Denthor) but it only talks about
    : MCGA (320x200x256).

    Since you have some tut (Download more of them!!!) I'll talk about svga in brief. The graphics
    principles are the same whatever displaymode you have. In 256 (indexed) modes you need
    1 byte per pixel, Highcolor 2 bytes, Truecolor 3 / 4 bytes depending on your graphics card.
    Putting the right amount of bytes into graphics adapters memoryaddress you get the pixel visible.

    When using linear modes in svga you don't need to worry about segments and page-setting.
    But if you don't have some library to help you you need to set the correct page for drawing
    in modes that take more than 65536 bytes of memory. MCGA = 320*200*1 = 64000bytes so you can use
    that mode without page-setting. All you need is the vga-memoryaddress which is supposedly
    to be A0000:0000 or A000:0000. I can't remember but I think denthor has mentioned that in his/hers
    tut. But if you want to use 320*200*16bit or svgamodes you need the pagesetting function.
    And that has to be done with asm. Graphicsmode has to be set with asm too without libraries.
    See for more info on this sites graphics section.

    i haven't used dos since I changed to linux and I don't know if there are any ports or libraries similar
    to svgalib but I really suggest you get one if you don't want to invent the wheel again( programming
    vesa with assembler... ) This is very IMHO but I think that if you are learning to program
    taking linux as the development platform saves you from getting pissed of so much since linux
    won't crash if your pointer happens to point in the wrong address... Believe me I've been there =D
    I can't tell about windoze and directX, since I never have used it. But you said that you were
    learning basics so...

    : This turorial was last updated in 1994. My Borland C/C++ compiler is of the
    : same vintage. I'm just a weekend programmer searching for very basic info ---
    : any help much appreciated.

    I'd say that your compiler doesn't support protected mode because it's so old, so if you wan't
    to program pmodes (svga) my suggestion is that you get a pmode compiler, like djgpp. It's free.
    http://www.delorie.com/djgpp/ and it links nicely with NASM http://www.web-sites.co.uk/nasm/
    If you learn djgpp switching to unix-variants won't be hard since djgpp in somesort port of GNU
    c-compiler which is available for many platforms. NASM is with intel-syntax and is available to
    unixes too. If you want AT&T syntax I recall there was some compiler for that too... probably it
    was something like as or as86. Djgpp supports for make-files too. They're used to make
    compiling bigger programs easier. Let's say that you have 10 include files and all that stuff
    and you want to compile them simply you can use graphical ide (rhide) or use makefiles. When
    makefile is written correctly all you need to do when you want to compile and link the program you
    just type "make".

    I hope this helps you at least a bit. If it doesn't ... Duh.
    -Hitaki


  • have a look at my (rather old now) page on game programming at http://members.xoom.com/nthom/ it may answer some of your questions.

  • : have a look at my (rather old now) page on game programming at http://members.xoom.com/nthom/ it may answer some of your questions.
    :

    make that members.xoom.com/nthom/f.htm

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion