Double Buffering in mode 12h

This is a discussion on Double Buffering in mode 12h within the C Programming forums, part of the General Programming Boards category; Mode 12h / 640x480 / 16 color VGA Hey, Ive been searching for the past two weeks on a good ...

  1. #1
    Registered User
    Join Date
    Feb 2005
    Posts
    8

    Double Buffering in mode 12h

    Mode 12h / 640x480 / 16 color VGA

    Hey, Ive been searching for the past two weeks on a good resource for mode 12h vga programming information, but they are very few and far between... I've managed to do pretty well with it so far, but when It comes to drawing large objects on the screen it takes a while (very sluggish).. now, I've read a lot about double buffering and I pretty much get how it works, but when I try to implemtent it... I get choppy black and white blocks.... If anyone knows how to do this it would be a great help.... Now, if you need to see some code I will post some.... thanks in advance

  2. #2
    Gawking at stupidity
    Join Date
    Jul 2004
    Location
    Oregon, USA
    Posts
    3,175
    Isn't that kind of programming pretty archaic? I know this doesn't help answer your question, but I was just wondering what OS you're doing this in.
    If you understand what you're doing, you're not learning anything.

  3. #3
    Registered User
    Join Date
    Feb 2005
    Posts
    8
    lol, you are right, but It's just another way for me to gain some experience with memory allocation and basic graphics functions, and as for the operating system I use... I mainly use windows XP for most of my deving, but occasionally I use Redhat 9.

  4. #4
    Registered User Frobozz's Avatar
    Join Date
    Dec 2002
    Posts
    546
    Try drawing everything to an off-screen buffer in memory. Then find a way to draw everything between monitor refreshes (I'm guessing check for a vsynch and after one has happened draw as fast as possible).

  5. #5
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,598
    You will gain 0 experience using that outdated color-plane based crapola mode.

    Try something with at least 256 colors like mode 13h.

  6. #6
    Registered User
    Join Date
    Feb 2005
    Posts
    8
    yah, Frobozz I've thought of trying something like that, and I'll look into it some more, but Bubba.... I have gained a lot of experience form it, I'm not planning on creating any type of meaningful program with it, it is simply for learning, the principles for the most part remain the same... and I'm not planning on sticking with it for long, I've thought about using Vesa instead because of the higher color plane and resolution as you mentioned... the only reason why I chose to play around with with mode 12h is because it was the first thing I was exposed to.

    lol, and I can't stand mode 13h

  7. #7
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,598
    Mode 13h is what rocketed graphics to their current state. Nintendo was all 320x200x256 colors. It was an ingenious color mode and played an important part in the evolution of graphics.

    Using 12h will not give you any information regarding how to access modern types of frame buffers. Using mode 13h you will not only gain insight into video memory, but how memory in general works. Accessing mode 13h screen via a pointer is akin to accessing any memory via a pointer be it video memory or memory that holds some other type of numerical data.

    Almost all modern frame buffers are a derivative of this:

    Code:
    struct RGBA
    {
       BYTE red;
       BYTE green;
       BYTE blue;
       BYTE alpha;
    };
    
    #define RGBA_COLOR  (DWORD)((alpha<<24)+(red<<16)+(green<<8)+(red))
    You will learn much with mode 13h.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 48
    Last Post: 09-26-2008, 04:45 AM
  2. DX Windowed Mode Double Buffering
    By curlious in forum Game Programming
    Replies: 2
    Last Post: 10-10-2003, 09:16 AM
  3. Please HELP!!
    By traz in forum C++ Programming
    Replies: 4
    Last Post: 04-14-2003, 10:20 PM
  4. Double buffering in GDI -- easy?
    By fusikon in forum Game Programming
    Replies: 17
    Last Post: 02-15-2003, 10:03 PM
  5. error message, what does it mean?
    By Shy_girl_311 in forum C++ Programming
    Replies: 5
    Last Post: 11-09-2001, 09:54 PM

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