Graphics

This is a discussion on Graphics within the C++ Programming forums, part of the General Programming Boards category; I have been out of programming for a few years now, I want to get back into it because cs ...

  1. #1
    Registered User
    Join Date
    Oct 2003
    Posts
    10

    Graphics

    I have been out of programming for a few years now, I want to get back into it because cs is my major, anyways I am trying to figure out how to get into graphics mode. I have tried using the graphic files and libs at cprogramming.com but I always get errors when I try to compile. This is what happens when I try to compile svga.cpp(it is under source code/graphics/libraries.

    39 C:\WINDOWS\Desktop\svga.cpp
    `_AX' undeclared (first use this function)
    and a lot of other errors too, but that is the first one.

    Does anyone know what could be wrong? All I did was download and open the file so its not like I messed up typing.
    I use Dev-C++ and that didn't work so I also tried djgpp and that didn't work either. I also tried compiling some of the other graphic programs and couldn't. Any thoughts? Thanks in advance.
    WOO!

  2. #2
    'AlHamdulillah
    Join Date
    Feb 2003
    Posts
    790
    Well, for graphics tutorial suggestions, i would reccomend this link ;however, i would say you should get back into programming regular(console) C++ based apps, and get a major hand of that before attempting graphics programming(your trips through C++ should teach you advanced problem solving which is vital in graphical programming).

  3. #3
    Registered User
    Join Date
    Oct 2003
    Posts
    10
    True, I should get C++ understood better before I try to program games, but my question is why wont a simple file I downloaded and opened not compile? Is there something wrong with my compiler?
    WOO!

  4. #4
    Hardware Engineer
    Join Date
    Sep 2001
    Posts
    1,398

    _AX is not defined....

    Well, I'm not sure where _AX is supposed to be defined... maybe it's supposed to be in <dos.h>??? Do your compilers have <dos.h>? You might try including <windows.h>, because there are tons of constants defined in windows.h.

    The "problem" with graphics, as you may know, is that graphics are not part of standard-portable C++. So, you have to make sure that your compiler, graphics library, book/tutorial, operating system, and hardware are all compatable.

    Have you done any Windows programming? Because the WinAPI has quite a bit of graphics included, and IMHO it's a good place to start.

  5. #5
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,498
    _AX is a mysterious global variable used as a 'hack' in old DOS compilers.
    If you want graphics in Dev-C++, then I suggest you start with say libsdl, which is IIRC part of the latest dev-c++ distribution
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Turtle Graphics, how does it work?
    By freddyvorhees in forum C++ Programming
    Replies: 15
    Last Post: 08-28-2009, 09:57 AM
  2. Graphics Programming :: Approach and Books
    By kuphryn in forum Windows Programming
    Replies: 4
    Last Post: 05-11-2004, 08:33 PM
  3. egavga.bgi problem
    By sunil21 in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 09-22-2003, 05:06 PM
  4. Graphics Devices and Cprintf clash
    By etnies in forum C Programming
    Replies: 6
    Last Post: 05-09-2002, 11:14 AM

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