Board index » delphi » Flicker Free Graphics

Flicker Free Graphics

Sorry if this has been asked a million times before, but I'm new to graphics
programming :/

I'm writing an app to simulate various analogue aircraft instruments
(gauges) and am running into flicker problems even on a fast PC with a
high-spec video card.  Here's what I'm doing...

1. Load gauge background bitmaps into Tbitmaps
2. Draw bitmaps onto form.canvas
3. Draw 'Needles' on gauges.
4. Loop through rest of program...
5. Once a gauge value has changed - goto 3.

I'm using a draw mode of pmXor for needles, but more complex gauges like the
artificial horizon have to be completely re-drawn and hence flicker.

Can anyone help out here?  I did look at a couple of DirectX units but
directx doesn't seem to support the basic drawing methods I need like Lines,
Chords, Arcs etc.

many tia,

Roy.

r...@flightlab.liv.ac.uk

 

Re:Flicker Free Graphics


Create another bitmap and draw the gauge and the needle on it (instead of on
the form canvas) and finally draw this bitmap on the canvas.

"Roy Coates" <r...@camaro.org.uk> schreef in bericht
news:98igbn$f1o$1@news.liv.ac.uk...

Quote
> Sorry if this has been asked a million times before, but I'm new to
graphics
> programming :/

> I'm writing an app to simulate various analogue aircraft instruments
> (gauges) and am running into flicker problems even on a fast PC with a
> high-spec video card.  Here's what I'm doing...

> 1. Load gauge background bitmaps into Tbitmaps
> 2. Draw bitmaps onto form.canvas
> 3. Draw 'Needles' on gauges.
> 4. Loop through rest of program...
> 5. Once a gauge value has changed - goto 3.

> I'm using a draw mode of pmXor for needles, but more complex gauges like
the
> artificial horizon have to be completely re-drawn and hence flicker.

> Can anyone help out here?  I did look at a couple of DirectX units but
> directx doesn't seem to support the basic drawing methods I need like
Lines,
> Chords, Arcs etc.

> many tia,

> Roy.

> r...@flightlab.liv.ac.uk

Other Threads