From a91f11d5d012053962259cb6c3fd13a7cc9e2a23 Mon Sep 17 00:00:00 2001 From: Javier Sancho Date: Thu, 24 Oct 2019 19:17:45 +0200 Subject: [PATCH] Keywords better than optional --- examples/01.HelloWorld.scm | 16 ++++++++++------ irrlicht.scm | 6 +++--- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/examples/01.HelloWorld.scm b/examples/01.HelloWorld.scm index 45761de..1df5080 100644 --- a/examples/01.HelloWorld.scm +++ b/examples/01.HelloWorld.scm @@ -25,7 +25,10 @@ (use-modules (irrlicht)) ;; start up the engine -(define device (create-device 'software '(640 480) 16 #f #f #f)) +(define device + (create-device + #:device-type 'software + #:window-size '(640 480))) (when (not device) (exit #f)) @@ -36,10 +39,11 @@ (define gui-env (get-gui-environment device)) ;; static text -(add-static-text! gui-env - "Hello World! This is the Irrlicht Software renderer!" - '(10 10 260 22) - #t) +(add-static-text! + gui-env + "Hello World! This is the Irrlicht Software renderer!" + '(10 10 260 22) + #:border #t) ;; load a Quake2 model (define mesh (get-mesh scene-manager "examples/media/sydney.md2")) @@ -58,7 +62,7 @@ ;; draw everything (while (device-run? device) - (begin-scene driver #t #t '(255 100 101 140)) + (begin-scene driver #:color '(255 100 101 140)) (scene-draw-all scene-manager) (gui-draw-all gui-env) (end-scene driver)) diff --git a/irrlicht.scm b/irrlicht.scm index 1863e9a..ce5547b 100644 --- a/irrlicht.scm +++ b/irrlicht.scm @@ -51,7 +51,7 @@ set-md2-animation!)) ;; Device functions -(define* (create-device #:optional +(define* (create-device #:key (device-type 'software) (window-size '(640 480)) (bits 16) @@ -94,7 +94,7 @@ ;; Driver functions (define* (begin-scene driver - #:optional + #:key (back-buffer #t) (z-buffer #t) (color '(255 0 0 0)) @@ -118,7 +118,7 @@ ;; GUI functions (define* (add-static-text! gui-env text rectangle - #:optional + #:key (border #f) (word-wrap #t) (parent %null-pointer) -- 2.39.5