Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2008-10

GLScene in Gtk2 - patch

5 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Paulo Malheiros

Hello,

GLScene flickers in GTK2 and the following patch fixes this

Index: lcl/interfaces/gtk/gtkwinapiwindow.pp
=================================================================== --- lcl/interfaces/gtk/gtkwinapiwindow.pp (revision 17040) +++ lcl/interfaces/gtk/gtkwinapiwindow.pp (working copy) @@ -484,7 +484,7 @@

  //@  gtk_widget_set_flags(AWidget, GTK_REALIZED);
    {$IFNDEF GTK1}
-  gtk_widget_set_double_buffered(AWidget, True); // True bites caret => ToDo
+  gtk_widget_set_double_buffered(AWidget, False); // True bites caret => ToDo
    gtk_widget_set_redraw_on_allocate(AWidget, False);
    {$ENDIF}

In Lazarus svn 15362 Mattias changed "gtk_widget_set_double_buffered" from False to True (with decription "gtk2 intf: moved doublebuffering from synedit to gtk2 as this is faster since gtk2.12"), is this really needed?

If Lazarus cannot be changed, does anyone have any idea on how to fix this in GLScene?

Regards,
Paulo

Reply by email

Lord Satan
to Paulo Malheiros
In Lazarus svn 15362 Mattias changed "gtk_widget_set_double_buffered" from False to True (with decription "gtk2 intf: moved doublebuffering from synedit to gtk2 as this is faster since gtk2.12"), is this really needed?

IMHO yes. Speeding up synedit is always a good idea. I think the problem is that OpenGL contexts should not be double buffered by gtk. OpenGL does the buffering (single, double, triple, quad) itself depending on user choice and hardware support. Therefor any OpenGL widgets should only be single buffered by the widget set. I don't know anything about gtk so I cannot help, but it would be nice if you could just disable doublebuffering for single widgets. Does any gtk expert know if this is possible?

A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing in e-mail?

Reply by email

Luiz Americo Pereira Camara
to Lord Satan
Lord Satan wrote 15 lines
On Sat, 18 Oct 2008 17:58:05 +0100 Paulo Malheiros wrote: > In Lazarus svn 15362 Mattias changed "gtk_widget_set_double_buffered" > from False to True (with decription "gtk2 intf: moved doublebuffering > from synedit to gtk2 as this is faster since gtk2.12"), is this really > needed? > IMHO yes. Speeding up synedit is always a good idea. I think the problem is that OpenGL contexts should not be double buffered by gtk. OpenGL does the buffering (single, double, triple, quad) itself depending on user choice and hardware support. Therefor any OpenGL widgets should only be single buffered by the widget set. I don't know anything about gtk so I cannot help, but it would be nice if you could just disable doublebuffering for single widgets. Does any gtk expert know if this is possible?
gtk_widget_set_double_buffered(YourGtkWidgetHandle, False);

Luiz

Reply by email

Reenen Laurie
to Patrick Chevalley

Can you submit a patch?

Patrick Chevalley wrote 11 lines
Tank you Luiz! I put that in GLLinGTKContext.pas at procedure TGLGTKContext.DoCreateContext and no more flickering. Patrick _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
o__ ,_.>/ _ (_)_\(_)_______ ...speed is good _______________ I believe five out of four people have a problem with fractions. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20081019/83d7ded3/attachment.html

Reply by email