;;;; examples/11-canvas-geometry.lisp (defpackage #:ww.examples/11 (:use #:cl) (:export #:start)) (in-package :ww.examples/11) (defclass geo-demo (ww:application) ()) (defmethod ww:boot ((app geo-demo)) (let ((canvas (make-instance 'ww:canvas :pixel-width 500 :pixel-height 500))) ;; stretch canvas over the whole app (setf (ww:width canvas) (ww::application-width app) (ww:height canvas) (ww::application-height app)) ;; add it to the display tree (ww:add-unit app canvas) ;; draw a circle (ww::with-grid-circle (x y) (50 50 30) (ww::with-pixel (r g b a) (ww::pixel canvas x y) (setf r (mod (* x y) 255) g x b y))) ;; blit the canvas (ww::blit canvas)))