GtkGL#
GtkGL# is a managed .NET assembly for using the OpenGL graphics library together with the Gtk# windowing toolkit. GtkGL# is free software, and is licensed under a permissive 3-clause BSD license. See COPYING for license details.
I needed to draw 2D network graphs and animations of the Simetron simulator. OpenGL is supported by graphic hardware vendors, so it basically cannot get any faster! I found no support for OpenGL in Gtk#, which is the widget toolkit we use in Simetron. I needed something like CsGL, which allows you to use OpenGL in System.Windows.Forms, but for Gtk#.
GtkGL# has been tested to work on Linux. I don’t have access to Windows, so you should not expect it to work on Windows without modifications.
OpenGL is a royalty-free platform-independent rendering API. OpenGL is supported by most of the graphic card manufacturers, and when hardware accelaration is available, OpenGL provides one of the best performance for 3D/2D graphics. For Linux, you can get free OpenGL libraries from XFree86/Mesa.
Gtk# is an open source .NET language binding for the Gtk+ toolkit and assorted GNOME libraries.
Mono is an open source implementation of the .NET framework.
Dependencies
The only native libraries that GtkGL# depends on are XLib/X11 and OpenGL/Mesa. GtkGL# uses glX functions, meaning that you need X11 to be installed. X11 is normally installed on most Linux boxes, and it is available both for Linux and for Cygwin on Windows (not tested).
For the managed side of things, you will to have Mono and Gtk# installed. GtkGL# has been tested against Gtk# 0.13 and Mono 0.28 releases.
Configuration
GtkGL# uses the GNU auto* tool chain. To ensure that Mono picks up the shared libraries while loading you will need to pass the path where Mono is installed to the autogen.sh or configure script (depends whether you checked out the code from CVS or got a tarball). For example, given that Mono is intalled in /opt/mono and that you are using a CVS checkout:
$ ./autogen.sh --prefix=/opt/mono
$ make
$ make install
Among others, install will copy the following files into your Mono installation:
$prefix/lib/libgtkgl_sharp.so
$prefix/lib/gtkglsharp.dll
Usage and Samples
You can find GtkGL# samples under the samples directory.
Known Bugs
On some versions of OpenGL/Mesa, the double buffer does not seem to work always correctly, and the widget may become blank. Resizing the widget fixes the problem.
Download
You can download the latest binary release of GtkGL# from the Novell project page. Alternatively, you can obtain the sources from the CVS repository.
Screenshots
Getting the traditional GL gears example to work was straight forward. You can find the C# sources under the sample directory in the release tarball.

Gears using GtkGL#
Bugs
You can send questions, bugs and patches to brunofr at olympum dot com.