Board index » delphi » flicker, flicker and pong

flicker, flicker and pong

Hi everybody!
Got a problem with my PONG game (I hope youll remember that oldie!). To move
the ball and the two bars I dont use getimage(that flickers even more!). I use
setviewport and clearviewport. But still it flickers too much. The online help
suggests setactivepage and setvisualpage too avoid flickering, but I just dont
understand how setactivepage could ever help avoiding the damn flickering.
Shoot. Maybe one of you can help me...
Thanks in advance yours       Jan Wittmann
 

Re:flicker, flicker and pong


In article <20000212150610.28593.00000...@ng-cm1.aol.com>,

Quote
HTWittmann <htwittm...@aol.com> wrote:
> The online help
>suggests setactivepage and setvisualpage too avoid flickering, but I just dont
>understand how setactivepage could ever help avoiding the damn flickering.
>Shoot. Maybe one of you can help me...

With Setactivepage and setvisualpage one keeps the image on two pages,
one draws on the hidden one and then shows it immediately with
setvisualpage. This prevents all kinds of flicker and the movement is
smooth provided the drawing can be done fast enough.

The bad thing is that it does not work on the VGA resolution. You need
to limit the resolution to 640x350.

You can avoid flicker also so that you do not first remove and the draw
but simply move the object on screen. One should do this by
manipulating the display directly preferably with ASM.

Osmo

Re:flicker, flicker and pong


How can I change the resolution to 640x430 pixels????? My standard adjustment
is 640x480! Can anyone send me sourcecode how setactivepage works?
Thanks Jan

Re:flicker, flicker and pong


In article <20000212165041.28603.00000...@ng-cm1.aol.com>,

Quote
HTWittmann <htwittm...@aol.com> wrote:
>How can I change the resolution to 640x430 pixels?????

350, not 430.

Quote
>My standard adjustment
>is 640x480! Can anyone send me sourcecode how setactivepage works?

You need to explicitly specify the mode and driver in initgraph. Use the
help to check the value.

SetActivePage just changes on which page the drawing is done. Again,
use help.

Osmo

Quote
>Thanks Jan

Re:flicker, flicker and pong


Hi!
You can try to use the well-known vertical retrace method below to prevent
flickering: (but I don't know if it compatible with GRAPH unit)

<--COPY-->
procedure VerticalRetrace; assembler;
asm
  mov  dx, 03dah
@1:
  in   al, dx
  test al, 8
  jnz  @1
@2:
  in   al, dx
  test al, 8
  jz   @2
end;
<--CUT-->

Boo Khan-Ming

Quote
HTWittmann wrote in message

<20000212150610.28593.00000...@ng-cm1.aol.com>...
Quote
>Hi everybody!
>Got a problem with my PONG game (I hope youll remember that oldie!). To
move
>the ball and the two bars I dont use getimage(that flickers even more!). I
use
>setviewport and clearviewport. But still it flickers too much. The online
help
>suggests setactivepage and setvisualpage too avoid flickering, but I just
dont
>understand how setactivepage could ever help avoiding the damn flickering.
>Shoot. Maybe one of you can help me...
>Thanks in advance yours       Jan Wittmann

Other Threads