Cool! Finally one more great Pascal library got an real cross-platfom, I will definitely take a look how it works under GNU/Linux
Cool! Finally one more great Pascal library got an real cross-platfom, I will definitely take a look how it works under GNU/Linux
Lifepower as you say Freepascal/Lazarus you mean 32/64 Windows 32/64 Linux and MacOsX.... ?
Finally Linux support. I'll have to try it this evening. Thanks in advance for that!
- Platforms supported: 32-bit and 64-bit Windows, 32-bit and 64-bit Linux and Mac OS X.
Best regards,
Cybermonkey
Yes. Examples on Windows have been precompiled in 32-bit, but on Linux they have been precompiled in 64-bit.
Linux support relies on TOpenGLControl from Lazarus components for creating GLX context. This means that multisampling settings don't work there yet and there could be some key weirdness when using GUI interfaces. 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 ):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.
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.
Andru, thanks a lot for this! I'm going to try using it.
So far GNU/Linux version works fine But demos can't be compiled out of the box. First of all - path like /Develop/Asphyre... are you serious? GNU/Linux is not a MacOS X Better to use relative paths, or ask programmers to move Asphyre source code into home directory and use paths like $Env(HOME)/Asphyre, where is $Env(HOME) is a standard macros supported by Lazarus. Also I didn't notice dependency to LazOpenGLContext package(adding it manually solves the problem), which is needed for compilation.
Regarding that specific path: it's just a path, which you can always change. There is also no pleasing everyone as one way or another people will have to change paths to accommodate for their environment. If you use relative paths, and then move example application to a different folder, the parental structure will change and path won't work. If you set for home folder, and move application to somewhere else, the path won't work.
Therefore, "/Develop/Asphyre" was chosen as a supposedly intuitive illustration referring to Asphyre installation path, which most likely will be changed. Besides, if you use "Basic" as a startup sheet, you'll most likely put it anywhere you like, so you may end up using absolute paths after all.
Your code worked and native Linux provider is now complete! Therefore, I'm going to ditch LGLProvider and dependency on Lazarus TOpenGLContext. It looks like an update to Asphyre Sphinx 3 will follow soon.
You are right, sorry. There are 5 different example sets, 3 for Lazarus on all three platforms and 2 for Delphi. Delphi executables are 32-bit, Lazarus executables are 64-bit except those on Mac OS X. I've updated examples to use relative paths in the trunk, along with some other features. An update will be released soon.
Bookmarks