delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/07/04/15:00:17

From: Damian Yerrick <Bullcr_pd_yerrick AT hotmail DOT comRemoveBullcr_p>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Using (page-flipping) to speed up a program
Organization: Pin Eight Software http://pineight.8m.com/
Message-ID: <14c4msc79s6thn9rbf4120bue02jc8s2p8@4ax.com>
References: <395e61e0_2 AT spamkiller DOT newsfeeds DOT com> <395fcb12_1 AT spamkiller DOT newsfeeds DOT com> <39622a8e DOT 1248934 AT news DOT wins DOT uva DOT nl>
X-Newsreader: Forte Agent 1.7/32.534
MIME-Version: 1.0
Lines: 69
X-Trace: +LPib9t7+HejzDxZ56dYhrwDUkV7Nc12GLMXIUYvkUuseHQk+av8IZ9Z/VTp9SVGnP8wZPyZx786!bLzOP/yFyTyjISpxO+k0TlohhL/B+W+z+cZmBx32v+vYM4c44dqPk8Wv2UDffdRbjWYHr+VsmbF6!Qagg
X-Complaints-To: abuse AT gte DOT net
X-Abuse-Info: Please be sure to forward a copy of ALL headers
X-Abuse-Info: Otherwise we will be unable to process your complaint properly
NNTP-Posting-Date: Tue, 04 Jul 2000 18:50:27 GMT
Distribution: world
Date: Tue, 04 Jul 2000 18:50:27 GMT
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

On Tue, 04 Jul 2000 18:43:49 GMT, eglebbk AT phys DOT uva DOT nl (Evert Glebbeek)
wrote:

>Newsgroup: comp.os.msdos.djgpp
> From: "23yrold3yrold" <cbarry AT pangea DOT ca>
> On Sun, 2 Jul 2000 10:53:54 -0500
>
>>I found the original program refused to page flip, simply because 640 x 960
>>seems too big for it to handle.
>How much video memory does your card have? I think Allegro comes with
>an `info' program in it's standard distribution that can tell you
>this.

vesainfo.exe
afinfo.exe

>BTW, what version of Allegro are you using?

Should be 3.9.32 (that's the latest version and is already as stable
as the last so-called Stable Release, if not more).

>>No prob compiling, big prob running.
>There are a few problems with your code; see below.
>
>>set_color_depth(16);
>>
>>set_gfx_mode(GFX_MODEX, 320, 240, 320, 480);
>16 bit colour doesn't normally work in VGA modes, such as mode X, so
>you'll need to change to 8 bit colour if you want to do mode X.

Or switch to VESA modes.  But do all video cards support 16-bit color
in 320x240?  Or are they designed for Windows business applications?

>>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;
...
>>  // Move the sprite according to the controls
>>  if(key[KEY_LEFT])
>>    {if(sx > 0)   {sx = sx - 5;} else {sx = 0;};};
>>  if(key[KEY_RIGHT])
>>    {if(sx < 595) {sx = sx + 5;} else {sx = 595;};};
>>  if(key[KEY_UP])
>>    {if(sy > 0)   {sy = sy - 5;} else {sy = 0;};};
>>  if(key[KEY_DOWN])
>>    {if(sy < 425) {sy = sy + 5;} else {sy = 425;};};
>Since you set your resolution to 320x240, any coordinates outside that
>space are outside the screen. Since RLE sprites can't be clipped

RLE sprites _are_ clipped.  Compiled sprites are not guaranteed to be
clipped or even to be supported on some platforms.

>Finally a warning about page flipping. It's a great way for doing
>screen updates, but my own experience shows that it is incompatible
>with the Allegro GUI routines. Maybe that's because I'm doing
>something illegal by setting `page1=screen;'

screen is undefined if you use create_video_bitmap().

What you should do in this case is save `screen' in your init code and
then assign `screen' to whatever page is showing on screen.

-- 
Damian Yerrick
"I refuse to listen to those who refuse to listen to reason."
See the whole sig: http://www.rose-hulman.edu/~yerricde/sig.html

This is McAfee VirusScan. Add these two lines to your signature to
prevent the spread of signature viruses.  http://www.mcafee.com/

- Raw text -


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