#:use-module ((sdl2 render) #:prefix sdl2:)
#:use-module ((sdl2 surface) #:prefix sdl2:)
#:export (bitmap
- move-xy))
+ move-xy))
(define (bitmap filename)
(make-scene
"bitmap"
(let ((image (sdl2:load-image filename))
- (texture #f))
+ (texture #f))
(let ((a 0))
(lambda* (#:key (xy '(0 0)))
- (if (not texture)
- (set! texture (sdl2:surface->texture %sdl-renderer image)))
- (sdl2:clear-renderer %sdl-renderer)
- (sdl2:render-copy %sdl-renderer texture #:dest-rect (sdl2:make-rect (car xy) (cadr xy) (sdl2:surface-width image) (sdl2:surface-height image)))
- (sdl2:present-renderer %sdl-renderer))))))
+ (if (not texture)
+ (set! texture (sdl2:surface->texture %sdl-renderer image)))
+ (sdl2:clear-renderer %sdl-renderer)
+ (sdl2:render-copy %sdl-renderer texture #:dest-rect (sdl2:make-rect (car xy) (cadr xy) (sdl2:surface-width image) (sdl2:surface-height image)))
+ (sdl2:present-renderer %sdl-renderer))))))
(define (move-xy x y scene)
(define (to-integer n)
"move-xy"
(lambda ()
(let ((xy (list (to-integer (if (procedure? x) (x) x))
- (to-integer (if (procedure? y) (y) y)))))
+ (to-integer (if (procedure? y) (y) y)))))
(display-scene scene #:xy xy)))))
#:use-module (srfi srfi-9)
#:use-module (srfi srfi-9 gnu)
#:export (make-scene
- display-scene
- run-scene))
+ display-scene
+ run-scene))
;;; Scene Type
(define (run-scene scene . args)
(apply start-game
- (cons
- (if (scene? scene)
- (scene-procedure scene)
- scene)
- args)))
+ (cons
+ (if (scene? scene)
+ (scene-procedure scene)
+ scene)
+ args)))