Mail Archives: djgpp/1997/11/19/11:33:20
Ville Lundberg wrote:
>
> Hi!
> When I found DJGPP and Allegro, I thought that NOW is the time to move
> on to C from QBasic, so I'm quite new at this. But now I have a really
> basic problem I just can't find an answer to anywhere else, so now I try
> here:
> In my game, the playground have to scroll while ca 15 sprites moves
> around it. But when I do this, by mixing double buffering and Allegros
> scroll_screen, the sprites flicker; they create "ghost" images, when
> running across the scrolling screen. It'looks terrible. My game uses
> ModeX and I use the following logic:
> move sprites co-ordinates;
> scroll_screen;
> blit(background to buffer);
> blit(sprites to buffer);
> blit(buffer to screen);
> This is how someone told me how to do it, but it still doesn't work.
> I would be really glad if someone could help me, because the game is
> almost ready otherwise.
>
> Thanks,
> Ville Lundberg
>
> =-----=
> Ville Lundberg @ Helsinki University of Technology, Department of
> Materials Science and Rock Engineering.
> vlundber AT cc DOT hut DOT fi www.hut.fi/~vlundber
It seems to me that you are re-drawing the whole screen every frame
anyway, but are also using ModeX hardware scrolling. This would be
causing the flicker, because for a short time the old image would appear
shifted & then the new image would appear. Try doing it without the
hardware scrolling, else try vsync-ing.
-- Joshua Heyer
- Raw text -