Mail Archives: djgpp/1999/08/08/11:51:59
From: | "Tony Friery" <tony AT basoft DOT enta DOT net>
|
Newsgroups: | comp.os.msdos.djgpp
|
References: | <7oiu0a$vqa$1 AT nnrp1 DOT deja DOT com>
|
Subject: | Re: Allegro: scroll_screen problems
|
Date: | Sun, 8 Aug 1999 12:43:58 +0100
|
Lines: | 63
|
X-Priority: | 3
|
X-MSMail-Priority: | Normal
|
X-Newsreader: | Microsoft Outlook Express 5.00.2014.211
|
X-MimeOLE: | Produced By Microsoft MimeOLE V5.00.2014.211
|
NNTP-Posting-Host: | warp8-45.enta-net.co.uk
|
Message-ID: | <37ad6fee.0@energise.enta.net>
|
X-Trace: | 8 Aug 1999 12:54:22 -0100, warp8-45.enta-net.co.uk
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Reply-To: | djgpp AT delorie DOT com
|
Hi,
I am relatively new myself to Allegro, but have used this function so
perhaps can share my experiences...
<don_rogers AT my-deja DOT com> wrote in message
news:7oiu0a$vqa$1 AT nnrp1 DOT deja DOT com...
> Could someone please help me with this problem.
> I am new to Allegro so I decided to keep it
> simple, just draw some shapes on the screen
> (virtual) and then scroll around a bit. So,
>
> set_gfx_mode(GFX_AUTODETECT,800,600,0,0);
As I understood it, the last two 0,0 should really be the size of the
virtual screen, i.e. to make a 1024x4096 virtual, you should use:
set_gfx_mode(GFX_AUTODETECT, 800, 600, 1024, 4096);
> .
> .
> set_pallete(desktop_pallete);
> set_clip(screen,VIRTUAL_W,VIRTUAL_H);
> draw some shapes on 1024x4096 virtual
> screen
> .
> .
> scroll_screen(50,0);
>
> Everything moved over just as I had expected.
> But when,
>
> '
> '
> scroll_screen(0,50)
>
> shapes on the screen move diagonally instead of
> vertically!?
>
[snipped]
I also believe that the scroll_screen specifies an absolute co-ordinate for
the top-left pixel. so to scroll it upwards, one might use:
int a;
for (a=0; a<600; a++)
{
scroll_screen(0, a); /* scroll_screen(a,0); would scroll to the
left instead */
pseudo_delay(50ms); /* Substitute your favourite delay function here!
*/
}
Hope this helps.
Best Regards,
Tony Friery
- Raw text -