From: Javier Sancho Date: Thu, 20 Apr 2017 22:23:04 +0000 (+0200) Subject: Rename bitmap -> image and stretch -> scale X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=e1e0e1c4a98a9b27391eeef40dea40a59d983710;p=gacela.git Rename bitmap -> image and stretch -> scale --- diff --git a/examples/01-hello-world/01-hello-world.scm b/examples/01-hello-world/01-hello-world.scm index 61263f1..2a18040 100644 --- a/examples/01-hello-world/01-hello-world.scm +++ b/examples/01-hello-world/01-hello-world.scm @@ -21,4 +21,4 @@ (display-scene (window ((resolution '(640 480))) - (bitmap "hello-world.bmp"))) + (image "hello-world.bmp"))) diff --git a/examples/02-event-driven-programming/02-event-driven-programming.scm b/examples/02-event-driven-programming/02-event-driven-programming.scm index b151233..a75eddf 100644 --- a/examples/02-event-driven-programming/02-event-driven-programming.scm +++ b/examples/02-event-driven-programming/02-event-driven-programming.scm @@ -31,4 +31,4 @@ (display-scene (window ((resolution '(640 480)) (when-quit counter-quit)) - (bitmap "x.bmp"))) + (image "x.bmp"))) diff --git a/examples/03-key-presses/03-key-presses.scm b/examples/03-key-presses/03-key-presses.scm index 06fa186..ed8a65d 100644 --- a/examples/03-key-presses/03-key-presses.scm +++ b/examples/03-key-presses/03-key-presses.scm @@ -23,11 +23,11 @@ (define get-pressed-scene #f) (set! get-pressed-scene - (let* ((up (bitmap "up.bmp")) - (down (bitmap "down.bmp")) - (left (bitmap "left.bmp")) - (right (bitmap "right.bmp")) - (press (bitmap "press.bmp")) + (let* ((up (image "up.bmp")) + (down (image "down.bmp")) + (left (image "left.bmp")) + (right (image "right.bmp")) + (press (image "press.bmp")) (actived press)) (lambda () (if (any-key-down?) @@ -43,8 +43,6 @@ (set! actived press)))) actived))) -(define press (bitmap "press.bmp")) - (display-scene (window ((resolution '(640 480))) (lambda () diff --git a/examples/04-stretch-images/04-stretch-images.scm b/examples/04-stretch-images/04-stretch-images.scm index e23daef..6676e1d 100644 --- a/examples/04-stretch-images/04-stretch-images.scm +++ b/examples/04-stretch-images/04-stretch-images.scm @@ -21,6 +21,6 @@ (display-scene (window ((resolution '(640 480))) - (stretch - (bitmap "stretch.bmp") + (scale + (image "stretch.bmp") 2))) diff --git a/gacela/image.scm b/gacela/image.scm index 1fa861f..278a7d7 100644 --- a/gacela/image.scm +++ b/gacela/image.scm @@ -23,13 +23,13 @@ #:use-module ((sdl2 render) #:prefix sdl2:) #:use-module ((sdl2 surface) #:prefix sdl2:) #:use-module (gl) - #:export (bitmap + #:export (image move-xy - stretch)) + scale)) -(define (bitmap filename) +(define (image filename) (make-scene - "bitmap" + "image" (let ((image (sdl2:load-image filename)) (texture #f) (w/2 0) @@ -62,9 +62,9 @@ (to-integer (if (procedure? y) (y) y))))) (display-scene scene #:xy xy))))) -(define* (stretch scene x #:optional (y x) (z y)) +(define* (scale scene x #:optional (y x) (z y)) (make-scene - "stretch" + "scale" (lambda () (gl-scale x y z) (display-scene scene))))