www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/04/17/06:03:18

From: qballlives AT aol DOT com (QBallLives)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Page flipping
Lines: 64
Message-ID: <1998041708550901.EAA04926@ladder01.news.aol.com>
NNTP-Posting-Host: ladder01.news.aol.com
Date: 17 Apr 1998 08:55:09 GMT
Organization: AOL http://www.aol.com
References: <35363a37 DOT 1602379 AT news DOT eznet DOT net>
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

>
>I've looked through some of the examples that came with Allegro, but I
>still don't understand how page flipping works. I know that it
>involves the virtual screen and switching between different areas of
>it, but the code in ex9 has me confused. Specifically the part where
>page2 is made into a sub-bitmap of the screen, and it's start y
>position and height are the same. Could someone please explain this to
>me?
>
>	Ryan Twitchell
>
>
>(ex9)
>
>   page1 = create_sub_bitmap(screen, 0, 0, SCREEN_W, SCREEN_H);
>   page2 = create_sub_bitmap(screen, 0, SCREEN_H, SCREEN_W, SCREEN_H);
>   active_page = page2;
>
>   /* do the animation using page flips... */
>   for (c=-32; c<=SCREEN_W+32; c++) {
>      clear(active_page);
>      circlefill(active_page, c, SCREEN_H/2, 32, 255);
>      textout(active_page, font, "Page flipping (mode-X)", 0, 0, 255);
>
>      if (active_page == page1) {
>	 scroll_screen(0, 0);
>	 active_page = page2;
>      }
>      else {
>	 scroll_screen(0, SCREEN_H);
>	 active_page = page1;
>      }
>   }
>
>

Well... when you say "virtual screen" that's what tends to be used to describe
a double_buffer -> in page flipping you're writing to ACTUAL video memory....
just at an area where the video hardware ISN"T scanning pixels (until you tell
it to start scanning somewhere else in video ram)

Basically, in my non-allegro stuff... I've done pageflipping in a mode x mode
called mode Y (same resolution and colors as mode 13h...)

Here's how it worked for me:

I have different starting offsets for video ram...

I set a working page - (i.e.: the page I will draw to) - actually an area of
video ram - NOT a virtual screen.

I draw on the "page"

Then... I reset the "visual page" - telling the hardware to start scanning
pixel info from another area of video ram (hint: the area I drew on...)

I have  some mode y stuff at my site.... I try to explain it as best I could at
the time - check it out...


Jim the loiterer
aloiterer AT juno DOT com
http://members.xoom.com/JimMcCue/index.htm

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019