Lush Home
News
Screenshots
Downloads
Documentation
FAQs
Project Page
CVS Tree
History/Credits
Links/Contacts
To Do List
SourceForge Logo

Lush Screenshots


Project Page |  Forums |  Tracker |  Bugs |  Support |  Patches |  Tasks |  News |  CVS |  Files | 

Here are a few screenshots of Lush graphics

This shows the documentation browser GUI tool. It provides an "explorer"-like table of content and a text window. The text window shows a simple Lush function with embedded C code (in green between hash-braces).

Documentation is written in standalone files or integrated with the source files as comments using a very simple markup language. HTML and LaTeX versions can be produced from the same source.

Full-window Screendump

This shows a simple Lunar Lander game written in Lush using the SDL interface and the sprite class. The whole game fits in less than 60 lines of Lush.
Full-window screendump

This demonstrates how to write self-executing Lush scripts (just like shell or Perl scripts). This simple photo slideshow application occupies a whopping 9 lines of Lush:

  #!/usr/bin/lush @@
  (libload (concat-fname lushdir "lsh/lushenv"))
  (libload "libimage/image-io")
  (libload "libimage/rgbaimage")
  (setq window (x11-window 1 1 640 480 "Slide Show"))
  (while t
    (each ((f (cdr argv)))
      (rgb-draw-matrix 
       0 0 (rgbaim-resize (image-read-rgba f) (xsize) (ysize) 0))
      (sleep 4)))

This script, when called from the shell prompt with a list of image files as arguments will show each picture for 4 seconds.

Full-window screendump (JPG)

This is the incredible shrinking four-line GUI. It opens a window with two buttons in it, and calls functions (called coucou and ouch in the example below) each time the buttons are clicked:
  (ogre)
  (de coucou (c) (printf "coucou\n"))
  (de ouch (c) (printf "OUCH!\n"))
  (new autowindowobject 10 10 () () "ouch" 
    (new column
      (new stdbutton "click me" coucou)
      (new stdbutton "don't click me" ouch)))

This shows Lush displaying animated OpenGL graphics with shading, lighting, etc. Here is how you draw a teapot in Lush using the OpenGL/OpenGLU/GLUT libraries:
;; draw a teapot at x,y,z with angles theta,phi,rho
(de teapot(x y z theta phi rho)
    ((-float-) x y z theta phi rho)
    (let ((mat (float-matrix 4)))
      (glPushMatrix)
      (glTranslatef x y z)
      (glrotatef theta phi rho 1)
      (mat 0 0.1745) (mat 1 0.01175) (mat 2 0.01175) (mat 3 1.0)
      (glMaterialfv @GL_FRONT @GL_AMBIENT mat)
      (mat 0 0.61424) (mat 1 0.04136) (mat 2 0.04136)       
      (glMaterialfv @GL_FRONT @GL_DIFFUSE mat)
      (mat 0 0.727811) (mat 1 0.626959) (mat 2 0.626959)
      (glMaterialfv @GL_FRONT @GL_SPECULAR mat)
      (glMaterialf  @GL_FRONT @GL_SHININESS (* 0.6 128.0))
      (glColor3f 1 1 1)
      (glut-solid-teapot 1.0)
      (glPopMatrix)))
(Large PNG)

Here is a simple calculator application written in a couple hundred lines of Lush.
(Large PNG)

Real-time edge detection using the Video4Linux frame grabbing interface. Grabbing frames from a v4l device and displaying them in a window is as simple as:
  (libload "video4linux/v4l")
  (new-window)      ; open graphic window
  (setq image (ubyte-matrix 240 320 3))  ; allocate RGB image
  (setq video-device (new v4ldevice "/dev/video" "NTSC" 1 320 240))
  (while t
    (==> video-device grab-into-rgb image)  ; grab frame into image
    (rgb-draw-matrix 0 0 image))            ; display image in window

Demo of spline interpolation using GSL. The code for this is here

Lush