[Mono-list] GL for Unix or "existing managed C++-librar..."

Mark Crichton crichton@gimp.org
Fri, 2 Aug 2002 13:32:22 -0400


--azLHFNyN32YCQGCU
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Miguel asked me to forward this to the list.  This was about a
discussion for getting OpenGL working on Linux and other Unicies.

Mark

----- Forwarded message from Mark Crichton <crichton@gimp.org> -----

From: Mark Crichton <crichton@gimp.org>
To: Miguel de Icaza <miguel@ximian.com>
Subject: Re: [Mono-list] existing managed C++-libraries for Mono and whats =
with csgl?
Date: Tue, 30 Jul 2002 12:56:37 -0400
Message-ID: <20020730165636.GA23571@odo.ecs.umass.edu>
User-Agent: Mutt/1.3.27i

* Miguel de Icaza (miguel@ximian.com) [020730 01:59]:
> I have not looked at CSGL recently, but Mark had been looking at doing a
> full binding using C#.  Mark mentioned that he wanted to bind not only
> the regular OpenGL stuff, but also the higher level libraries.

It's a little more than that.

The problem coes down to two things.  First, the CSGL stuff focuses on
the wgl side of things.  In OpenGL, we have the "base" OpenGL, which
does much of the heavy lifting, and a little add-on library that taks
to a native windowing system.  For Windows, it's wgl, and on x, it's
glX.  The interfaces are, of course, completely different.  Most people
don't have to deal with wgl/glX since most people try to use glut...

The other is that IMHO, CSGL is inadequate for GL on modern systems.
The code only really supports OpenGL, and none of the extensions.
However, most modern hardware, namely nVidia GeForce hardware, needs
extensions to do any of the work that most games/graphics programmers
use in modern software.  The prime example is vertex shaders (which are
slated for OpenGL 2.0...but it's Not Here Yet).

So what I've been doing is taking the gl, glu, and glut headers, and
trying to autogenerate DllImport stubs for C#  I think, for the most
part, they should, in theory, work.  However, I never tested them at
all, since the code generator was pretty incomplete.  The method for
generating the bindings is a near-copy of the Gtk# bindings, since I
just borrowed the scripts and hacked the code generator.

However, I haven't had much time to play with it recently.  If anyone
wants to play with what I have so far (which is "almost at the point of
working"), I'll be happy to send it along.

> The DLLs are probably not a problem, because we have a remapping
> mechanism in Mono.

It should JustWork.  The only issue I see is in some of the extensions.
The ATI GL libraries might not have glBindProgramNV...  This could be
solved by either the client app Doing The Right GL Thing (querying for
extensions and not using those that are not available), or some glue
code.

Take care,
Mark Crichton



----- End forwarded message -----

--azLHFNyN32YCQGCU
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (SunOS)
Comment: For info see http://www.gnupg.org

iEYEARECAAYFAj1KwiUACgkQOfj2Ja/u/oDP/gCgs7L2FgW+woEya5lO5II/gjoe
ruoAoLDKPxFPdw3gfQoJBO2aPl00Xhio
=6+pA
-----END PGP SIGNATURE-----

--azLHFNyN32YCQGCU--