Board index » delphi » OpenGL flicker

OpenGL flicker

I have a simple scene, a bumpy plane which I rotate
with 3D mouse events. It flickers like mad, although I
use doublebuffering/swap. Is there a command to await the
previous rendering to complete ?
I had the flickering ever since I used the 3D mouse.
It also appears when doublebuffer is disabled and glfinish is used.

I think I should not allow retriggering the mouseevents.

How is that done ? Setting up mouse event queue ?

Rene
--
Ing.Buero R.Tschaggelar - http://www.ibrtses.com

 

Re:OpenGL flicker


I also tried it with lowering the report rate of the mouse.
form 40ms to 320ms, the motion just becomes slower, but the
flicker stays. So it is probably is not the mouse.

TFT's do not a have a trace - do they ? Would I have to sync ?

Rene
--
Ing.Buero R.Tschaggelar - http://www.ibrtses.com

Re:OpenGL flicker


I put a sample app to my page :

http://www.ibrtses.com/opengl/test.zip

the x,y,z keys rotate. If someone could tell me
if and how it flickers ?

Rene
--
Ing.Buero R.Tschaggelar - http://www.ibrtses.com

Re:OpenGL flicker


Oops, it assumes the mouse or nothing on Com1,
not the modem, it then fails.

Rene
--
Ing.Buero R.Tschaggelar - http://www.ibrtses.com

Re:OpenGL flicker


I tried it and it flickers in the sense that the form is grayed before
every paint.

Did you use something like this, to avoid that ?

procedure TForm1.FormPaint(Sender: TObject);
begin
  ControlStyle := ControlStyle + [csOpaque] ; // this avoids flicker
....

KH Brenner

Rene Tschaggelar schrieb:

Quote
> I put a sample app to my page :

> http://www.ibrtses.com/opengl/test.zip

> the x,y,z keys rotate. If someone could tell me
> if and how it flickers ?

> Rene
> --
> Ing.Buero R.Tschaggelar - http://www.ibrtses.com

Re:OpenGL flicker


How about this one:

TForm1 = class(TForm)
private
    procedure WMEraseBkgnd(var Message: TWmEraseBkgnd); message
WM_ERASEBKGND;
    ...
end;

procedure TForm1.WMEraseBkgnd(var Message: TWMEraseBkgnd);
begin
  { Overrides message handler in TWinControl. Prevents background erasion in
    order to reduce screen flickering. }
  Message.Result := 1;
end;

Re:OpenGL flicker


Thanks to both KH and Robin,
both solutions work, I couldn't yet measure the faster one.
I get one rev every 3 seconds with both approaches.
Do they really work the same way internally ?

Rene
--
Ing.Buero R.Tschaggelar - http://www.ibrtses.com

Other Threads