Mail Archives: djgpp/1998/04/16/13:32:27
From: | ptwitche AT eznet DOT net (Ryan Twitchell)
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | Page flipping
|
Date: | Thu, 16 Apr 1998 17:15:39 GMT
|
Message-ID: | <35363a37.1602379@news.eznet.net>
|
NNTP-Posting-Host: | dialup07.roc-tc1.eznet.net
|
Lines: | 33
|
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;
}
}
- Raw text -