The problem was that I couldn't find a way to extract X-window ID from Lazarus window handle to use proper GLX device. If someone knows how to do that, I can implement direct OpenGL context creation in native fashion.
For ZenGL I use this solution(but works only with GTK version of LCL, I didn't try to use Qt version of Lazarus, so ):
Code:
uses
{$IFDEF LINUX}
{$IFDEF LCLGTK}
GLib, GTK, GDK,
{$ENDIF}
{$IFDEF LCLGTK2}
GLib2, GTK2, GDK2, GDK2x,
{$ENDIF}
{$ENDIF}
// ..
{$IFDEF LINUX}
var
widget : PGtkWidget;
socket : PGtkWidget;
glist : PGlist;
{$ENDIF}
begin
{$IFDEF LINUX}
glist := gtk_container_children( GTK_CONTAINER( PGtkWidget( Panel1.Handle ) ) );
widget := PGtkWidget( glist.data );
socket := gtk_socket_new();
gtk_container_add( GTK_CONTAINER( widget ), socket );
gtk_widget_show( socket );
gtk_widget_show( widget );
gtk_widget_realize( socket );
{$IFDEF LCLGTK}
YourTWindow := PGdkWindowPrivate( widget.window ).xwindow;
{$ENDIF}
{$IFDEF LCLGTK2}
YourTWindow := GDK_WINDOW_XID( widget.window );
{$ENDIF}
{$ENDIF}
Bookmarks