From: Fernando Mato Mira
Subject: GLX from Common Lisp
Date: 
Message-ID: <2gpv27$s3@disuns2.epfl.ch>
How do I go about programming in mixed-mode from Common Lisp?
In the lisp world, CLX (like Xlib, but in lisp) takes care
of talking to the X server. GL commands are done via the
foreign function interface. 
I think that all that is missing are the 4 little GLX functions, 
any new visuals and GLX contexts.

The source code for CLX is available. Solution?

Thanks in advance
-- 
Fernando D. Mato Mira                           
Computer Graphics Lab                           
Swiss Federal Institute of Technology (EPFL)    Phone    : +41 (21) 693 - 5248
CH-1015 Lausanne                                FAX      : +41 (21) 693 - 5328
Switzerland                                     E-mail   : ········@epfl.ch

From: Jason Trenouth
Subject: Re: GLX from Common Lisp
Date: 
Message-ID: <JASON.94Jan10140343@monty.harlequin.co.uk>
>>>>> "Fernando" == Fernando Mato Mira <········@di.epfl.ch> writes:
In article <·········@disuns2.epfl.ch> ········@di.epfl.ch (Fernando
Mato Mira) writes:

Fernando> How do I go about programming in mixed-mode from Common
Fernando> Lisp?  In the lisp world, CLX (like Xlib, but in lisp) takes
Fernando> care of talking to the X server. GL commands are done via
Fernando> the foreign function interface.  I think that all that is
Fernando> missing are the 4 little GLX functions, any new visuals and
Fernando> GLX contexts.

Harlequin has a GL interface for LispWorks (our Unix-based Common Lisp
environment) that is available for evaluation, but it is not yet a
fully supported product. Contact ·················@harlequin for more
information.

--
_____________________________________________________________________________
| Jason Trenouth,                        | EMAIL: ·····@uk.co.harlequin     |
| Harlequin Ltd, Barrington Hall,        | TEL:   (0223) 872522             |
| Barrington, Cambridge CB2 5RG, UK      | FAX:   (0223) 872519             |
From: Fernando Mato Mira
Subject: Re: GLX from Common Lisp
Date: 
Message-ID: <2gu4h4$irv@disuns2.epfl.ch>
I got the following answer from the CLX mailing list:

>
CLX is fundamentally incompatible with GL, and GLX (mixed mode).  CLX windows
and GL windows are two different beasts.  In order for this to work, CLX would
have to be based on using "xlib", whereas it is acutally based on using a plain
i/o socket to talk to hte x server.
>

Is this really like this, or is GLX implemented as a (maybe
undocumented) X extension? If so, it would be possible to
fix CLX without having to go through Xlib..

Now, if GLX is indeed implemented as an X extension:

  (if (documented-p 'GLX)
      "Where do I find the documentation?"
    (unless (SGI-makes-GLX-protocol-available-p) 
       (sell 'SGI)
       (buy 'HP)
       (setq GL nil)
       (gc t)
       (use-package :PEX)))

-- 
Fernando D. Mato Mira                           
Computer Graphics Lab                           
Swiss Federal Institute of Technology (EPFL)    Phone    : +41 (21) 693 - 5248
CH-1015 Lausanne                                FAX      : +41 (21) 693 - 5328
Switzerland                                     E-mail   : ········@epfl.ch
From: Fernando Mato Mira
Subject: Re: GLX from Common Lisp
Date: 
Message-ID: <2h0t3t$s0l@disuns2.epfl.ch>
In article <··········@disuns2.epfl.ch>, ········@di.epfl.ch (Fernando Mato Mira) writes:

> Is this really like this, or is GLX implemented as a (maybe
> undocumented) X extension? If so, it would be possible to
> fix CLX without having to go through Xlib..

OK, I just looked today in a machine running 5.1.1:
It IS an X extension and the protocol include files
are there. 

Does this mean I'll have to upgrade to 5.1.1 now
(if I only had 16Mb more memory!)
or the GLX subset in 4.0.5 is implemented 
in the SGI-SUNDRY-NONSTANDARD extension
with the same requests, opcodes, etc.
as the full-blown one?

Again, is there any documentation besides
the header files?

Thanks.

-- 
Fernando D. Mato Mira                           
Computer Graphics Lab                           
Swiss Federal Institute of Technology (EPFL)    Phone    : +41 (21) 693 - 5248
CH-1015 Lausanne                                FAX      : +41 (21) 693 - 5328
Switzerland                                     E-mail   : ········@epfl.ch
From: Allan Schaffer
Subject: Re: GLX from Common Lisp
Date: 
Message-ID: <2h0vrb$25r@fido.asd.sgi.com>
········@di.epfl.ch (Fernando Mato Mira) said..
>
>CLX is fundamentally incompatible with GL, and GLX (mixed mode).  
>CLX windows and GL windows are two different beasts.  In order for 
>this to work, CLX would have to be based on using "xlib", whereas 
>it is acutally based on using a plain i/o socket to talk to hte x server.
>
>Is this really like this, or is GLX implemented as a (maybe
>undocumented) X extension? If so, it would be possible to
>fix CLX without having to go through Xlib..

In a nutshell..

GLX and GLX are not the same thing.  :-)

There is the old mixed-model Motif-and-IRIS-GL, also (unfortunately)
called GLX but meaning GL+X.  It is not an X extension and is somewhat
related, in spirit, to...

OpenGL communicates to remote X servers via the GLX extension.  It also
interacts just fine with Xlib or Motif.  GLX is what you'll notice if
you query the extensions to the IRIX 5.x server.  See the newsgroup
comp.graphics.opengl for all the details.

Allan
-- 
Allan Schaffer
Silicon Graphics
········@sgi.com
From: Fernando Mato Mira
Subject: Re: GLX from Common Lisp
Date: 
Message-ID: <2h13p9$cul@disuns2.epfl.ch>
In article <··········@fido.asd.sgi.com>, ········@holodeck.asd.sgi.com (Allan Schaffer) writes:

> OpenGL communicates to remote X servers via the GLX extension.

So that's why there are all those GL operation codes in 
GLXproto.h . The OpenGL library will talk straight to
the hardware when the display is on the same machine
but go through the X server otherwise?

-- 
Fernando D. Mato Mira                           
Computer Graphics Lab                           
Swiss Federal Institute of Technology (EPFL)    Phone    : +41 (21) 693 - 5248
CH-1015 Lausanne                                FAX      : +41 (21) 693 - 5328
Switzerland                                     E-mail   : ········@epfl.ch
From: John R. Dennis
Subject: Re: GLX from Common Lisp
Date: 
Message-ID: <1994Jan12.152815.26257@peavax.mlo.dec.com>
In article <··········@disuns2.epfl.ch>, ········@di.epfl.ch (Fernando Mato Mira) writes:
From: ········@di.epfl.ch (Fernando Mato Mira)
Subject: Re: GLX from Common Lisp
Date: Wed, 12 Jan 94 10:08:25 GMT-0:06
Organization: Ecole Polytechnique Federale de Lausanne

In article <··········@fido.asd.sgi.com>, ········@holodeck.asd.sgi.com (Allan Schaffer) writes:

> OpenGL communicates to remote X servers via the GLX extension.

Fernando> So that's why there are all those GL operation codes in 
Fernando> GLXproto.h . The OpenGL library will talk straight to
Fernando> the hardware when the display is on the same machine
Fernando> but go through the X server otherwise?

Not quite. The OpenGL library will only go straight to the hardware if direct
rendering is supported and requested (glXCreateContext). Not all
implementations of OpenGL support direct rendering. You can query whether or
not you have a direct connection with glXIsDirect.

--
John Dennis - OpenGL Project Lead
·······@mlo.dec.com (508)493-3169
From: Fernando Mato Mira
Subject: Re: GLX from Common Lisp
Date: 
Message-ID: <2h3u9u$25g@disuns2.epfl.ch>
In article <······················@peavax.mlo.dec.com>, ·······@.mlo.dec.com (John R. Dennis) writes:

> Not quite. The OpenGL library will only go straight to the hardware if direct
> rendering is supported and requested (glXCreateContext). 

Now, let's say that I reprogram the glx functions in lisp
talking straight to the server (so that I do not need to create
Xlib Display or Window structures) but that I use the C OpenGL
library otherwise. Will that work properly?

Thanks
-- 
Fernando D. Mato Mira                           
Computer Graphics Lab                           
Swiss Federal Institute of Technology (EPFL)    Phone    : +41 (21) 693 - 5248
CH-1015 Lausanne                                FAX      : +41 (21) 693 - 5328
Switzerland                                     E-mail   : ········@epfl.ch
From: John R. Dennis
Subject: Re: GLX from Common Lisp
Date: 
Message-ID: <1994Jan14.193541.24859@peavax.mlo.dec.com>
John> Not quite. The OpenGL library will only go straight to the hardware if
John> direct rendering is supported and requested (glXCreateContext).

Fernando> Now, let's say that I reprogram the glx functions in lisp
Fernando> talking straight to the server (so that I do not need to create
Fernando> Xlib Display or Window structures) but that I use the C OpenGL
Fernando> library otherwise. Will that work properly?

I doubt it. In an X environment all the gl entry points have some interaction
with the X environment in some fashion. It might be as simple as checking the
direct rendering flag. Also the glX entry points caches certain data that is
used by the other gl entry points (pixel modes, context tags, etc.). Also the
glX entry points for creating and managing rendering contexts have a very
tight relationship with the X server. I don't think you can circumvent the
existing mechansism successfully.

--
John Dennis - OpenGL Project Lead
·······@mlo.dec.com (508)493-3169