Results 1 to 10 of 33

Thread: Asphyre Sphinx 3.0.0 has been released.

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #8
    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}
    Last edited by Andru; 29-08-2012 at 02:55 PM.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •