summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* guix: Update guile-sdl2 to latest commit in master.David Thompson2018-08-231-2/+2
|
* Update README.David Thompson2018-08-231-19/+34
|
* Move SDL game loop implementation to its own module.David Thompson2018-08-2312-502/+220
|
* math: vector: Add read syntax.David Thompson2018-08-236-8/+34
| | | | | | | | | * chickadee/math/vector.scm (read-vec): New procedure. Extend reader. * examples/lines.scm: Use new vector read syntax. * examples/nine-patch.scm: Ditto. * examples/sprite.scm: Ditto. * examples/text.scm: Ditto. * examples/tiled.scm: Ditto.
* window: Fix procedure export.David Thompson2018-08-231-1/+1
| | | | * chickadee/window.scm: Export close-window! for real this time.
* Make the game loop modular!David Thompson2018-08-236-207/+195
| | | | | | | | | | | | | | | This is really cool! Now users can plug in whatever backend they'd like and are not forced to use SDL and OpenGL. Thanks to Chris Webber for showing me the Lux library for Racket that does exactly this. * chickadee.scm (run-game): Remove all SDL/OpenGL code, replace with generic render/update keyword arguments. (run-game/sdl): New procedure. * examples/lines.scm: Update for API breakage. * examples/nine-patch.scm: Ditto. * examples/sprite.scm: Ditto. * examples/text.scm: Ditto. * examples/tiled.scm: Ditto.
* Bump to version 0.3.0.David Thompson2018-07-111-1/+1
|
* README: Update guile-sdl2 requirement.David Thompson2018-07-111-1/+1
|
* render: Replace keyword->string from SRFI-88.David Thompson2018-07-111-1/+3
| | | | | | | | | | SRFI-88 introduces a problematic global reader macro that I didn't know about until Ricardo Wurmus reported some strange behavior that was traced back to this SRFI. Thanks to Ludovic Courtes for pointing it out. * chickadee/render.scm: Remove (srfi srfi-88) import. (keyword->string): New procedure.
* guix: Update guile-sdl2 commit.David Thompson2018-07-111-10/+4
|
* guix: Upgrade to Guile 2.2.4.David Thompson2018-07-081-3/+3
|
* Fix Makefile.am.David Thompson2018-06-261-2/+2
| | | | Accidentally removed the wrong buffer.scm!
* Remove problematic OpenGL requirements.David Thompson2018-06-253-16/+6
| | | | | | | | | | | Trying to force certain GL versions and other attributes has only caused problems for potential users thus far. Let's see how far we get by just removing this stuff. * chickadee/window.scm (open-window): Remove OpenGL settings. * chickadee/render/shapes.scm (draw-filled-rect, draw-line): Drop shader version from 330 to 130. * chickadee/render/sprite.scm (default-shader): Same.
* Remove experimental buffer API.David Thompson2018-06-254-470/+15
|
* doc: Add framebuffer docs.David Thompson2018-06-251-0/+38
| | | | * doc/api.texi (Framebuffers): Add basic API documentation.
* Display proper backtraces when there is no game loop error handler.David Thompson2018-06-241-11/+10
| | | | | * chickadee.scm (call-with-error-handling): Do not catch errors when the error hook has nothing in it.
* render: tiled: Add support for external tilesets.David Thompson2018-06-241-3/+13
| | | | | * chickadee/render/tiled.scm (load-tile-map): Handle both internal and external tilesets.
* guix: Use Guile 2.2.2 for now.David Thompson2018-06-241-3/+3
|
* error: Pass error key and args to error hook.David Thompson2018-05-031-2/+2
| | | | | * chickadee.scm (call-with-error-handling): Run hook with error key and args.
* Add game loop error hook.David Thompson2018-05-031-47/+75
| | | | | | | * chickadee.scm (error-hook): New variable. (display-game-loop-error, call-with-error-handling): New procedures. (run-hook*): New syntax. (run-game): Wrap all hooks with error handling.
* render: font: Allow rendering of substrings.David Thompson2018-04-302-4/+12
| | | | | | * chickadee/render/font.scm (draw-text*, draw-text): Add start and end arguments. * doc/api.texi (Fonts): Document new arguments.
* render: tiled: Export draw-tile-map*.David Thompson2018-04-301-1/+2
| | | | * chickadee/render/tiled.scm: Export draw-tile-map*.
* render: tiled: Invert Y coordinates of objects.David Thompson2018-04-291-8/+12
| | | | | * chickadee/render/tiled.scm (load-tile-map): Invert Y coordinate for objects.
* render: tiled: Add tile-map-layer-ref.David Thompson2018-04-291-0/+17
| | | | * chickadee/render/tiled.scm (tile-map-layer-ref): New procedure.
* render: font: Fix bug in font-line-width.David Thompson2018-04-271-1/+1
| | | | | * chickadee/render/font.scm (font-line-width): Fix addition of number with vector, use X coordinate instead.
* Invert Y coordinate in mouse motion event.David Thompson2018-04-211-1/+1
| | | | | | | Reported-By: Christopher Howard <christopher.howard@qlfiles.net> * chickadee.scm (run-game): Invert the Y coordinate received from SDL's mouse motion event.
* render: font: Add font-line-width procedure.David Thompson2018-04-211-0/+12
| | | | * chickadee/render/font.scm (font-line-width): New procedure.
* render: font: Print "?" instead of crashing when character is missing.David Thompson2018-04-211-1/+2
| | | | | * chickadee/render/font.scm (draw-text*): Default to "?" character when the desired character isn't present in the font.
* Update .dir-locals.el.David Thompson2018-03-131-1/+2
|
* Add tile map example.David Thompson2018-01-295-1/+135
| | | | | | | | * examples/images/tiles.png: New file. * examples/map/example.tmx: New file. * examples/tiled.scm: New file. * Makefile.am (EXTRA_DIST): Add them. * examples/images/AUTHORS: Credit the author of the tileset.
* render: Add Tiled map renderer.David Thompson2018-01-293-0/+472
| | | | | | * chickadee/render/tiled.scm: New file. * Makefile.am (SOURCES): Add it. * doc/api.texi (Tile Maps): New subsection.
* render: texture: Define custom record type printer for texture atlas.David Thompson2018-01-291-0/+8
| | | | * chickadee/render/texture.scm (display-texture): New procedure.
* guix: Switch back to Guile 2.2.2.David Thompson2018-01-291-3/+3
| | | | 2.2.3 has a bad performance regression. :(
* window: Display warning when vsync is not supported.David Thompson2018-01-271-1/+7
| | | | | | | | | A lot better than crashing, I'd say. :) Reported-By: Christopher Howard <christopher.howard@qlfiles.net> * chickadee/window.scm (open-window): Catch errors thrown by set-gl-swap-interval! and emit warning.
* math: matrix: Fix typos in matrix4-2d-transform!David Thompson2018-01-171-2/+2
| | | | * chickadee/math/matrix.scm (matrix4-2d-transform!): Fix bad typos!
* render: texture: Keep a rect for use with draw-sprite and friends.David Thompson2018-01-172-27/+34
| | | | | | | | | | Easier to calculate it once and hang onto it than to generate it each time draw-sprite is called. * chickadee/render/texture.scm (<texture>)[rect]: Delete field. [x y width height gl-tex-rect]: New fields. * chickadee/render/sprite.scm (draw-sprite*, draw-sprite, draw-nine-patch*): Use proper accessors for texture rects.
* render: font: Fix typo.David Thompson2018-01-171-1/+1
| | | | | * chickadee/render/font.scm (%null-vec): Rename to... (%null-vec2): ...this.
* render: sprite: Fix bug in rendering texture regions.David Thompson2018-01-171-3/+9
| | | | | | | | | | The texture-rect procedure contains the pixel location of the texture region, so if you use that rect to render a sprite the result is a sprite offset by its location in the greater texture, which is very very very wrong. * chickadee/render/sprite.scm (draw-sprite): Dynamically configure rendering rect based on the texture region's width and height.
* render: texture: Fix split-texture.David Thompson2018-01-171-2/+2
| | | | | * chickadee/render/texture.scm (split-texture): Width and height variables need to contain exact numbers.
* Revert "Add error handling to game loop."David Thompson2018-01-171-73/+65
| | | | This reverts commit 8cbb7eed56c4b5edd780c2d51aaa0a4c3eab7350.
* render: Refactor sprite rendering.David Thompson2018-01-174-245/+228
| | | | | | | | | | | | | | | | | | | * chickadee/render/texture.scm (<texture-region>): Delete type. (<texture>)[width, height, gl-size]: Delete fields. [parent, rect, gl-rect]: Add fields. (texture-region?): Rewrite. (make-texture, null-texture): Use new texture constructor. (make-texture-region): Rewrite in terms of <texture> type. (list->texture-atlas, split-texture): Use new texture region constructor. * chickadee/render/sprite.scm (draw-sprite*): New procedure. (draw-sprite): Rewrite in terms of draw-sprite*. (draw-nine-patch*): New procedure. (draw-nine-patch): Rewrite in terms of draw-nine-patch*. * chickadee/render/font.scm (draw-text*): New procedure. (draw-text): Rewrite in terms of draw-text*. * doc/api.texi: Update draw-sprite, draw-nine-patch, and draw-text docs.
* math: matrix: Add matrix4-2d-transform! procedure.David Thompson2018-01-171-0/+42
| | | | * chickadee/math/matrix.scm (matrix4-2d-transform): New procedure.
* Add error handling to game loop.David Thompson2018-01-121-65/+73
| | | | | | * chickadee.scm (error-handler): New procedure. (with-error-handling): New syntax. (run-game): Handle errors caught when running hooks.
* Fix broken mouse Y coordinate inversion.David Thompson2018-01-091-1/+1
| | | | * chickadee.scm (run-game): window-height is not a procedure!
* audio: Use values between 0 and 1 for volume.David Thompson2018-01-091-9/+12
| | | | | | | Hide the weird SDL usage of 0 to 128. * chickadee/audio.scm (set-sample-volume!, music-volume, set-music-volume!): Translate to/from SDL's volume range.
* render: shapes: Add draw-filled-rect procedure.David Thompson2018-01-081-2/+74
| | | | * chickadee/render/shapes.scm (draw-filled-rect): New procedure.
* render: color: Add color-lerp procedure.David Thompson2018-01-081-2/+5
| | | | * chickadee/render/color.scm (color-lerp): New procedure.
* render: sprite: Allow passing custom transformation matrices.David Thompson2018-01-052-129/+180
| | | | | | | | | | | | | | * chickadee/render/sprite.scm (draw-sprite-unbatched, draw-sprite-batched): Replace 'scale' and 'rotation' arguments with a 'matrix' argument. (sprite-batch-add!): Ditto. Also, correctly transform sprite vertices. This was previously not handling rotations properly. (%default-offset): New variable. (draw-sprite, draw-nine-patch): Change default values for 'rotation' and 'scale'. Add 'matrix' and 'offset' arguments. * chickadee/render/font.scm (%default-offset): New variable. (draw-text): Change default values for 'rotation' and 'scale'. Add 'offset' and 'matrix' arguments.
* Fix inverted Y coordinates in mouse events.David Thompson2018-01-051-3/+7
| | | | * chickadee.scm (run-game): Invert all Y coordinates received from SDL.
* math: matrix: Allow translation by rect as if it were a vector.David Thompson2018-01-051-0/+7
| | | | * chickadee/math/matrix.scm (matrix4-translate!): Add rect support.