From 75c5cdef5c72b4f88ae71ba37e7a94b609996279 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Thu, 13 Dec 2018 21:20:42 -0500 Subject: Re-hide SDL2 details. I know I'm backpedaling here, but I think it was a mistake to expose SDL2 as much as I have here. I think it's better for people just getting started to not have to wonder what SDL means. Making things as usable as possible for beginners is an important goal, and abstracting SDL2 + OpenGL things from the core game loop implementation shouldn't require sacrificing that goal. * chickadee.scm: Switch code with... * chickadee/game-loop.scm: ...this! Which is copied straight from... * chickadee/sdl.scm: ...this! Which is now deleted. * Makefile.am (SOURCES): Add game-loop.scm, remove sdl.scm. * examples/grid.scm: Update due to API breakage. * examples/lines.scm: Ditto. * examples/nine-patch.scm: Ditto. * examples/sprite.scm: Ditto. * examples/text.scm: Ditto. * examples/tiled.scm: Ditto. * doc/api.texi (Kernel): Update. --- examples/grid.scm | 3 +-- examples/lines.scm | 5 ++--- examples/nine-patch.scm | 5 ++--- examples/sprite.scm | 5 ++--- examples/text.scm | 8 ++++---- examples/tiled.scm | 13 ++++++------- 6 files changed, 17 insertions(+), 22 deletions(-) (limited to 'examples') diff --git a/examples/grid.scm b/examples/grid.scm index 6fab47a..0234746 100644 --- a/examples/grid.scm +++ b/examples/grid.scm @@ -7,7 +7,6 @@ (chickadee render font) (chickadee render shapes) (chickadee render sprite) - (chickadee sdl) (sdl2 input keyboard)) (define grid (make-grid)) @@ -82,4 +81,4 @@ (draw-filled-rect rect item-color))) grid))) -(run-game/sdl #:load load #:draw draw #:update update) +(run-game #:load load #:draw draw #:update update) diff --git a/examples/lines.scm b/examples/lines.scm index f24ec25..b7a551a 100644 --- a/examples/lines.scm +++ b/examples/lines.scm @@ -3,8 +3,7 @@ (chickadee) (chickadee math vector) (chickadee render color) - (chickadee render shapes) - (chickadee sdl)) + (chickadee render shapes)) (define lines (list-tabulate 48 @@ -26,4 +25,4 @@ #:thickness thickness))) lines)) -(run-game/sdl #:draw draw) +(run-game #:draw draw) diff --git a/examples/nine-patch.scm b/examples/nine-patch.scm index d20ba06..ff5b9a8 100644 --- a/examples/nine-patch.scm +++ b/examples/nine-patch.scm @@ -3,8 +3,7 @@ (chickadee math vector) (chickadee render font) (chickadee render sprite) - (chickadee render texture) - (chickadee sdl)) + (chickadee render texture)) (define image #f) @@ -15,4 +14,4 @@ (draw-nine-patch image (make-rect 192.0 192.0 256.0 96.0) #:margin 6) (draw-text "I am error." #v(200.0 266.0))) -(run-game/sdl #:load load #:draw draw) +(run-game #:load load #:draw draw) diff --git a/examples/sprite.scm b/examples/sprite.scm index ed968fb..0e8b4b3 100644 --- a/examples/sprite.scm +++ b/examples/sprite.scm @@ -1,8 +1,7 @@ (use-modules (chickadee) (chickadee math vector) (chickadee render sprite) - (chickadee render texture) - (chickadee sdl)) + (chickadee render texture)) (define sprite #f) @@ -12,4 +11,4 @@ (define (draw alpha) (draw-sprite sprite #v(256.0 176.0))) -(run-game/sdl #:load load #:draw draw) +(run-game #:load load #:draw draw) diff --git a/examples/text.scm b/examples/text.scm index d181889..4758782 100644 --- a/examples/text.scm +++ b/examples/text.scm @@ -1,8 +1,8 @@ -(use-modules (chickadee math vector) - (chickadee render font) - (chickadee sdl)) +(use-modules (chickadee) + (chickadee math vector) + (chickadee render font)) (define (draw alpha) (draw-text "Hello, world!" #v(260.0 240.0))) -(run-game/sdl #:draw draw) +(run-game #:draw draw) diff --git a/examples/tiled.scm b/examples/tiled.scm index 19332bb..5ff2b7f 100644 --- a/examples/tiled.scm +++ b/examples/tiled.scm @@ -2,7 +2,6 @@ (chickadee math vector) (chickadee math rect) (chickadee render tiled) - (chickadee sdl) (ice-9 match)) (define map #f) @@ -24,9 +23,9 @@ ('q (abort-game)) (_ #t))) -(run-game/sdl #:window-width 320 - #:window-height 240 - #:window-title "tile map demo" - #:load load - #:draw draw - #:key-press key-press) +(run-game #:window-width 320 + #:window-height 240 + #:window-title "tile map demo" + #:load load + #:draw draw + #:key-press key-press) -- cgit v1.2.3