Dev-C++ VGA mode problems...

This is a discussion on Dev-C++ VGA mode problems... within the C++ Programming forums, part of the General Programming Boards category; I read a tutorial on entering VGA mode without a BGI file (I don't really know what that is or ...

  1. #1
    Ace Bowers
    Guest

    Dev-C++ VGA mode problems...

    I read a tutorial on entering VGA mode without a BGI file (I don't really know what that is or if I have one so I read it) and it said to enter VGA mode put this in the code:

    Code:
    void SetMCGA() {
      _AX = 0x0013;
      geninterrupt (0x10);
    }
    And i'm wondering if I need to include a header file (like iostream or something) because it gives me the error: "_AX undeclared (first use this function)" If so, where can I get it or does it come with Dev-C++?

    I don't know really what to do about it. I've been coding in C++ for about... 1 1/4 days now, and I can make simple text based games and understand functions ok. I want to do graphical programming, though. I used to code in BASIC and DiNGS Game Basic. I use Dev-C++ with a standard Hewlett Pakard Pavilion with windows 98, if it makes any difference. Any help would be great, thanks in advance.

  2. #2
    Just because ygfperson's Avatar
    Join Date
    Jan 2002
    Posts
    2,493
    I think you need a library, or inline assembly. (With 1.25 days experience, inline assembly will be hell.) _AX was undefined because all variables need to be defined by you or a header file you include.

    As for doing graphics in Dev-C++ (under DOS), I don't know how. You can write windows programs with Dev-C++, though.

  3. #3
    Ace Bowers
    Guest
    Great... now I have to go to google.com and search for inline assembely. I've seen games that look like they run in DOS, oh well. If I do that in a windows aplication instead will it work if I include windows.h, or am I still screwed, lol. Thanks for the help, man Game Basic was easy (in comparison) if only they a freeware 3d version.

  4. #4
    Registered User
    Join Date
    Jul 2003
    Posts
    17
    Dev-C++ cannot use interrupts, and I think getting into mode13h is impossible with Dev-C++ since this is not a Dos compiler.

  5. #5
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    Both are correct. If you want to write Dos games, get DJGPP.

    But I suggest you rather learn windows programming and then DirectX or OpenGL, it's more, uh, future-oriented
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  6. #6
    Ace Bowers
    Guest

    Wah???

    Thanks, but I thought a console application was a DOS program. Hmmm, I don't think it matters now, though, because I've decided to use Allegro. It has lots of good functions for GFX, or so I've heard, but I haven't goten it to work yet. Anyway, thanks for the help.

  7. #7
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    No, the Win32 console is a window that provides a method to use stdin, stdout and stderr by displaying the text and reading from the keyboard. Nothing more.

    cmd.exe in WinNT is a console application that provides a DOS-like interface by supporting the same commands as the DOS command line (e.g. "dir").

    However, while a DOS application is also run in a console window, the "console application" you can create by linking as subsystem:console is still a real Win32 exe file. It runs as a real 32-bit application, fully controlled by the OS.

    Win32 exes all start with a header that looks like a complete DOS exe that prints "This application requires Win32" or something and exits. This is why they can't even do bad things in DOS
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  8. #8
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,598
    And when you do get a DOS compiler, please, please, please do not use geninterrupt.

    It leaves the registers in very unpredictable states which can cause loads of problems. Use the int86() and int86x() set of functions. I don't remember if DJGPP uses these or not.

    I'm so rusty on this DOS stuff cuz I've almost totally switched over to DirectX. Sorry fellow DJGPPers. I've failed you again.





  9. #9
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    DJGPP uses
    _go32_set_interrupt_handler()
    or something like that. In the DPMI32 mode anyway.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  10. #10
    Registered User Ace Bowers's Avatar
    Join Date
    Jul 2003
    Posts
    23
    I use Dev-C++, and I'm pretty sure that Allegro will work good, but I can't get it to work, it gives me errors... About 118 errors. I can't fix it, or I don't know how I mean. If anyone knows how to set up Allegro for Dev-C++ (I have the latest stable beta versoin) please explain it to me. I installed it (it being Allegro) correctly and put the "-lellag" or whatever in the linker list, but it still won't work. Thanks, once again.

    edit:

    Never mind. I decided to download SDL instead, and so far it works great, I got the fullscreen thing going and it compiles fine. Which is farther than I ever got with Allegro; not putting down Allegro of course, I'm sure it works good, I'm pretty sure it was all my fault. Anyway, thanks for all the help.
    Last edited by Ace Bowers; 07-17-2003 at 01:19 PM.
    "I have read about a hill in a book, so the hill must exist." -a Christian quote
    "I have not seen this hill, so it must not exist." -an Athiest quote
    "Well, I've heard of this hill, so lets bomb it." -a George Bush quote

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Serial port communcation and computer standby mode
    By MWAAAHAAA in forum Windows Programming
    Replies: 0
    Last Post: 07-09-2009, 11:38 AM
  2. Results in Debug and Release mode are different
    By jaro in forum C Programming
    Replies: 11
    Last Post: 05-27-2006, 12:08 PM
  3. Linking OpenGL in Dev-C++
    By linkofazeroth in forum Game Programming
    Replies: 4
    Last Post: 09-13-2005, 11:17 AM
  4. Pong is completed!!!
    By Shamino in forum Game Programming
    Replies: 11
    Last Post: 05-26-2005, 11:50 AM
  5. WAV file problems...
    By snerl in forum C Programming
    Replies: 4
    Last Post: 06-11-2003, 04:00 PM

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