[Openmcl-devel] The Miracle of opengl-ffi.lisp Astounds Newby!

Gary Byers gb at clozure.com
Fri Nov 12 23:38:48 PST 2004

On Wed, 10 Nov 2004, Kenneth Tilton wrote:

> Platform: Mikel Evins's Lisp in a box, aka OpenMCL and Slime and Emacs
> OK, the good news is that a significant amount of Cello has been ported
> to OS X/OpenMCL. If I could only manage to build ImageMagick and
> crucially the Wand API therein I think we could pop the cork.
> But that is not why I am here. We observe that when the demo in
> opengl-ffi.lisp runs, the menubar changes to "Simple OpenGL Example" or
> some such and some standard menu iems appear.

Unlike X and some other windowing environments, a non-GUI process has
to jump through a few hoops to turn itself into a GUI process on OSX.
GLUT will jump through these hoops for you, but if you don't want to
use GLUT you have to do your own jumping.  OpenMCL's full-blown Cocoa
example calls this function (defined in "ccl:examples;cocoa-window.lisp"):

;; (in-package "CCL")

(defun enable-foreground ()
  (%stack-block ((psn 8))
    (external-call "_GetCurrentProcess" :address psn)
    (external-call "_CPSEnableForegroundOperation" :address psn)
    (eql 0 (external-call "_SetFrontProcess" :address psn :signed-halfword))))

I believe that that's enough to connect you to the window server and
give you your own menubar and dock icon.  (I'm not sure that there'd
be much of anything -on- that menubar.)

More information about the Openmcl-devel mailing list