(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?)
(set! actived press))))
actived)))
-(define press (bitmap "press.bmp"))
-
(display-scene
(window ((resolution '(640 480)))
(lambda ()
#: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)
(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))))