From: John M. Adams
Subject: X support, gaming concepts
Date: 
Message-ID: <l1d7xu4nnz.fsf@pool-207-205-236-162.dlls.grid.net>
I'm using lisp to explore computer gaming concepts.  I'm primarily
interested in unit ai and system organization.  I'm not researching
how to make excellent game graphics, but I will need to use graphics
to display behavior.

I need a free or inexpensive lisp system for linux that supports X.
My lisp programs need to output X graphics and also respond to
keyboard input.  I'd like the keyboard to be read from the console;
I'm not much interested in fiddling with any sort of text widget.

After fiddling with gcl for several weeks, it seems that cmucl is a
much more complete system.  CMU Common Lisp 18b (www.cons.org).

I've found a large manual (over many .ps files) for CLX, which cmucl
supports.  Does anyone know if this is available as info or html?  The
cmucl manpage refers to some other motif support, but I haven't seen
the doc/motif-toolkit.doc doc/motif-internals.doc files mentioned.

Can anyone comment on these graphics interfaces for cmucl?

One specific cmucl question.  I was able to run some clx demos in the
cmucl source distribution.  However, I had trouble figuring out what I 
needed to load in order to do that.  I ended up just compiling and
loading everything in the src/clx directory.  That seemed a little
unnatural.  There were 23 files.

-- 
John M. Adams

From: R. Matthew Emerson
Subject: Re: X support, gaming concepts
Date: 
Message-ID: <871ze9k8j4.fsf@nightfly.apk.net>
····@mindspring.com (John M. Adams) writes:

> I've found a large manual (over many .ps files) for CLX, which cmucl
> supports.  Does anyone know if this is available as info or html?  The
> cmucl manpage refers to some other motif support, but I haven't seen
> the doc/motif-toolkit.doc doc/motif-internals.doc files mentioned.
> 
> Can anyone comment on these graphics interfaces for cmucl?

Well, we're talking about X here, so pain is inevitable.

CLX is at the same level as C's Xlib.  (It takes about 30 lines of
code to put a window on the screen and draw something in it.)  There
are some examples in the CLX sources to get you started, or I can
mail you a simple one.

MCL, on the other hand, has a nice CLOS-ified interface to the
Macintosh's window system, and needs about five lines of code
to do pretty much the same thing.

As long as you just want to draw things and receive keyboard and mouse
events, CLX should be tolerable, especially if you're already familiar
with using Xlib from C.

-matt
From: Mike McDonald
Subject: Re: X support, gaming concepts
Date: 
Message-ID: <7ml2ql$l6k$1@spitting-spider.aracnet.com>
In article <··············@pool-207-205-236-162.dlls.grid.net>,
	····@mindspring.com (John M. Adams) writes:
> I'm using lisp to explore computer gaming concepts.  I'm primarily
> interested in unit ai and system organization.  I'm not researching
> how to make excellent game graphics, but I will need to use graphics
> to display behavior.
> 
> I need a free or inexpensive lisp system for linux that supports X.
> My lisp programs need to output X graphics and also respond to
> keyboard input.  I'd like the keyboard to be read from the console;
> I'm not much interested in fiddling with any sort of text widget.
> 
> After fiddling with gcl for several weeks, it seems that cmucl is a
> much more complete system.  CMU Common Lisp 18b (www.cons.org).

  You should also check out ACL from Franz (www.franz.com).

> I've found a large manual (over many .ps files) for CLX, which cmucl
> supports.  Does anyone know if this is available as info or html? 

  A HTML version is at http://www.uni-karlsruhe.de/~unk6/clxman/

 The
> cmucl manpage refers to some other motif support, but I haven't seen
> the doc/motif-toolkit.doc doc/motif-internals.doc files mentioned.

  Hmm, the subsystem is called CLM. Maybe there's something like that around.

> Can anyone comment on these graphics interfaces for cmucl?

  If you stick to CLX, then you should be able to move back and forth between
several lisp implementations.

> One specific cmucl question.  I was able to run some clx demos in the
> cmucl source distribution.  However, I had trouble figuring out what I 
> needed to load in order to do that.  I ended up just compiling and
> loading everything in the src/clx directory.  That seemed a little
> unnatural.  There were 23 files.
> 

  Sorry, it's been a long time since I've mucked with the CLX demos.

  Mike McDonald
  ·······@mikemac.com
From: Paolo Amoroso
Subject: Re: X support, gaming concepts
Date: 
Message-ID: <37907aab.148486@news.mclink.it>
On 14 Jul 1999 22:06:24 -0500, ····@mindspring.com (John M. Adams) wrote:

> I need a free or inexpensive lisp system for linux that supports X.
> My lisp programs need to output X graphics and also respond to
> keyboard input.  I'd like the keyboard to be read from the console;
> I'm not much interested in fiddling with any sort of text widget.

John posted this request also to a CMU CL mailing list. In that forum I
suggested him to have a look at SLIK, and offered to contribute a fix to a
bug in one of its demos. Since it seems that SLIK is not widely known, I
provide here some info about it and the bug fix.

SLIK is a user interface toolkit that is part of PRISM, a radiation therapy
planning system developed at Washington University. The PRISM Web site is:

  http://www.radonc.washington.edu/medinfo/prism/

The source code and documentation of SLIK are available at:

  ftp://ftp.radonc.washington.edu:/dist/slik/

Although it was originally developed for Allegro CL, SLIK compiles out of
the box with CMU CL.

From what I understand from the manual, the value cell of symbols in the
SLIK package denoting predefined colors stores an appropriate graphics
context. The DRAWPIC function of the SAMPLE2 demo (file demo.lisp) seems
consistent with this interpretation, but it does not work. The following
forms in DRAWPIC incorrectly try to access the graphics context:

[...]
(let ((bg (symbol-value (sl:bg-color pic)))
      (fg (symbol-value (sl:fg-color pic)))
[...]
  (clx:draw-arc px
                (symbol-value col)
                (+ 256 x -10)
                (- 256 y 10)
                20 20 0.0 (* 2.0 pi) t)
[...]

The value cell of symbols denoting predefined colors contains instead a
list whose first element is the colormap, and whose second one is the
actual graphics context (see clx-support.lisp). The graphics context may be
accessed with the SL:COLOR-GC selector (also defined in clx-support.lisp).
So, to fix the bug just replace the forms above with the following ones:

[...]
(let ((bg (sl:color-gc (sl:bg-color pic)))
      (fg (sl:color-gc (sl:fg-color pic)))
[...]
  (clx:draw-arc px
                (sl:color-gc col)
                (+ 256 x -10)
                (- 256 y 10)
                20 20 0.0 (* 2.0 pi) t)
[...]

The SAMPLE2 demo has another bug I didn't fix because I wasn't interested.
When the needle of the dialbox is turned to an angle greater than 90
degrees, the program crashes.


Paolo
-- 
Paolo Amoroso <·······@mclink.it>