Interlisp / medley

The main repo for the Medley Interlisp project. Wiki, Issues are here. Other repositories include maiko (the VM implementation) and Interlisp.github.io (web site sources)
https://Interlisp.org
MIT License
369 stars 19 forks source link

Documentation - Introduction to Rendering #1243

Open RyanBurnside opened 1 year ago

RyanBurnside commented 1 year ago

One of the things that would be of interest to people (especially in a GUI system) is a small demo of rendering a real time system.

My past approach to such things in other systems is keeping a rendering "loop" going while polling the keyboard. I realize this is probably different in the Medley environment.

I think there is a lot of power in just putting rendering knowledge in peoples' hands. For example, I'd very much like to make a little 4th of July fireworks simulation.

I would be happy to write a tutorial for review with the Medley pros once I understand how to keep the window updating without user input and also where to store the program so it's cleared when the window is closed. I had a hack in my last game where I stored the game instance in the window user data but that's probably not correct.

Thanks for all the work on Medley, I will be using it in the future!

nbriggs commented 1 year ago

It's about the same. You can look at, for example the LIFE package. You just loop, drawing what you want to draw, it's polite to put a (BLOCK) in the loop, or not much else will run, and you continue until, say, (KEYDOWNP 'X) or, another example, until (SHIFTDOWNP 'SHIFT)

nbriggs commented 1 year ago

(OPENWP window) will tell you if the window has not been closed. You can put a SHRINKFN and EXPANDFN property on the window (with WINDOWPROP) in order to get control, to, say, suspend/resume (vs. quit) when the user shrinks or expands the window you're running in. If you want to just run from an exec you don't need to worry about adding a process to handle it -- it will run until either it quits on its own (e.g., because you set it up to notice the window closed, or some key was touched) or it gets interrupted by control-E (or forced into a break to debug it, or ...). If you want, you can have the function that starts everything get a window from the user (CREATEW) and then (ADD.PROCESS '(form to be executed)) and just return.

RyanBurnside commented 1 year ago

Thank you for your response, it will give me a starting point.

masinter commented 1 year ago

@RyanBurnside I wonder if the Medley Primer https://interlisp.org/documentation/Medley-Primer.pdf was close as a better starting point?

RyanBurnside commented 8 months ago

@nbriggs I've had some downtime to tackle this and learn a bit more. I'm not quite sure how to gain more information on this PILOTBBT (record?). I'm not sure if it needs to be imported or what. Happy to help out though and maybe write a small tutorial when finished. Screenshot_2023-12-19_19-39-05

masinter commented 8 months ago

We've reorganized the web site and cataloged some of the available documentation; have you looked in

https://interlisp.org/software/using-medley/

A lot of things need updating to 2024. In your screenshot try (FILESLOAD LIFE) (it's an Interilsp NLAMBDA function(from CL point of view, a macro). The (create PILOTBBT) is an indication (a) you're running Life interpreted, which is a lot slower than running compiled, and (b) you need to (FILESLOAD (SOUCE) SYSEDIT) which will load in low-level system declarations.