Hello,

Here's the first revision of flexi-line:

http://github.com/dharmatech/agave/raw/141e21e5886dd021ce632b83d4730168b2563461/demos/flexi-line.scm

And refactored to use some glamour libraries:

    http://github.com/dharmatech/agave/raw/master/demos/flexi-line.scm

After hacking on a bunch of demos like these, I cooked up a few macros for use with GLUT and GL. One basic one is 'window':

    http://github.com/dharmatech/agave/raw/master/glamour/window.sls

The (glamour mouse) library has a few macros for working with the mouse:

    http://github.com/dharmatech/agave/raw/master/glamour/mouse.sls

These work great in a script where everything is defined at the "top level". However, notice something; each macro expands into definitions followed by non-definition statements. This means that if you want to setup a demo inside of a scope (this easily comes up when you want multiple windows running in the same Scheme instance) then you have to do things like this:

(let ()

  (window (size 500 500)
          (title "abc")
          (reshape (width height)))

  (let ()

    (mouse mouse-button mouse-state mouse-x mouse-y)

    ;; rest of the program follows

    ))

I.e. put each macro at the top of a new 'let' body.

I thought it would be neat to have macros which work and look nice when used at the top level as well as inside 'define' and 'let' bodies. But perhaps the way glut is designed prevents a straightforward path to this.

Suggestions welcome!

Ed

Reply via email to