Menu

[r760]: / trunk / lispbuilder-sdl-gfx / examples / width-height.lisp  Maximize  Restore  History

Download this file

23 lines (18 with data), 783 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
;;;;; Converted from the "Width and Height" Processing example at:
;;;;; "http://www.processing.org/learning/examples/widthheight.html"
;;;;; (C)2006 Luke J Crook
(in-package #:sdl-gfx-examples)
(defun width-height ()
(let ((width 200) (height 200))
(sdl:with-init ()
(sdl:window width height :title-caption "Width and Height, from Processing.org")
(sdl:clear-display (sdl:color :r 127 :g 127 :b 127))
(loop for i from 0 to height by 20
do (progn (sdl-gfx:draw-box (sdl:rectangle :x 0 :y i :w 200 :h 10)
:color sdl:*black*)
(sdl-gfx:draw-box (sdl:rectangle :x i :y 0 :w 10 :h 200)
:color sdl:*white*)))
(sdl:update-display)
(sdl:with-events ()
(:quit-event () t)
(:video-expose-event () (sdl:update-display))))))
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.