GLX extension for CLX

GLX is an X protocol extension that provides access to OpenGL rendering. OpenGL commands are encapsulated in X protocol stream. Thus, one can run their OpenGL applicaion on a machine that does not even have a video card (if they manage to boot it), by just remotely connecting to it and launching the CLX+GLX application, which in turn will connect to the specified X server. Needless to say, the server should support the GLX extension.

Here you can get a diff against CLX package available in CLiki (version 0.6 at the moment). To apply the patch, go to the folder where your CLX is, and do the

  patch < path/to/glx.diff
command. Then compile and load the source as usual, using the .asd system definition. The code for float-decomposition is CMUCL and SBCL specific so it runs only on these implementations at the moment.

When you have it loaded, do this to try out the super-duper rotating-square:

  CL-USER> (in-package :gl-test)
  GL-TEST> (test 'anim :host "" :display 0)
(Substitute the host and display value as you need. Passing "localhost" as HOST parameter might be required.)

The code is in a very early stage of developement (actually it is more like a proof-of-concept implementation to check if it can be done at all) so I suggest you use nested X server for experimenting. If you have any questions, suggestions, patches or anything else to offer, contact me by email.

There's also some media I have created to show off: a screenshot and a movie and another movie.


Proof-of-concept release. Created this page.
Added all (177) rendering commands that do not require large requests. Well, almost all: some of the requests use variable length list arguments, but my rendering command definer does not yet support that.
Added support for CMUCL (good that SBCL is a fork from CMUCL :).
Started converting glxgears, implementing all commands required to run it.
Rendering command definer now can deal with sequence arguments. Definitions like this:
  (define-rendering-command tex-env-fv 112
    (target       card32)
    (pname        card32)
    (param        (list float32 (ecase pname
                                  (#.+texture-env-mode+ 1)
                                  (#.+texture-env-color+ 4)))))
now work. The sequence argument must be of required length and contain elements of specified type and can be one of:
Implemented all commands required for glxgears. Got a rotating gear. Have some problems, thought:
A bright person from the other side of the globe Ryohei Ueda fixed the lighting/materials issue with gears: the issue was that for some unknown reason I had implemented the gl:enable as a non-rendering command. Making it an ordinary rendering command makes the
  (test 'gears*)
example work just fine (except the skewed geometries, which I think are due to a transcription error).
Recently discovered that Alastair Bridgewater has done some fixes/improvements (including the gl:enable problem mentioned above) in his CLX fork, which might soon find their way into the official repository.