summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* render: sprite: Add draw-sprite-batch* procedure.David Thompson2019-05-221-9/+30
| | | | | * chickadee/render/sprite.scm (draw-sprite-batch*): New procedure. (draw-sprite-batch): Rewrite in terms of 'draw-sprite-batch*'.
* Update copyright year on sprite and buffer modules.David Thompson2019-05-162-2/+2
|
* Ignore emacs temp files.David Thompson2019-05-141-0/+1
|
* Fix 'make distcheck'.David Thompson2019-05-131-7/+3
|
* doc: Remove unicode character for pi because it breaks 'make dvi'.David Thompson2019-05-131-3/+3
|
* README: Update example code.David Thompson2019-05-131-3/+2
|
* render: Replace broken refs to "typed buffer" with "buffer view".David Thompson2019-05-132-51/+51
| | | | | * chickadee/render/asset.scm: s/typed-buffer/buffer-view/ * chickadee/render/particles.scm: Same.
* doc: Remove reference to old hook system.David Thompson2019-05-131-2/+3
| | | | | * doc/api.texi (Agendas): Rewrite example code that used obsolete hook API.
* render: Rename "typed buffer" to "buffer view".David Thompson2019-05-134-220/+220
| | | | | | | * chickadee/render/buffer.scm: s/typed-buffer/buffer-view/ * chickadee/render/shapes.scm: Same. * chickadee/render/sprite.scm: Same. * doc/api.texi: Same.
* doc: Improve texture documentation.David Thompson2019-05-132-3/+84
| | | | | * chickadee/render/texture.scm (list->texture-atlas): Tweak docstring. * doc/api.texi (Textures): Document more procedures.
* render: texture: Stop exporting texture-id.David Thompson2019-05-131-1/+0
| | | | * chickadee/render/texture.scm: Remove texture-id from exports list.
* Update SDL2 game controller database file.David Thompson2019-05-121-1/+38
|
* render: sprite: Rewrite sprite batching API.David Thompson2019-05-125-318/+373
| | | | | | | | | | | | | | | | | | | | | | | | | | | This new version performs better and has a better API. It closely resembles Love2D's sprite batch API. * chickadee/render/sprite.scm (with-batched-sprites, sprite-batch-reset!, sprite-batch-begin!, draw-sprite-batched, *batch?*, %batch): Delete. (draw-sprite-unbatched): Rename to 'draw-sprite*'. (<sprite-batch>)[index-buffer, position-buffer, texture-buffer]: Delete fields. [vertex-buffer]: New field. (init-sprite-batch, double-sprite-batch-size!, sprite-batch-add!, sprite-batch-flush!): Rewrite. (make-sprite-batch): Add 'capacity' and 'blend-mode' arguments. (draw-sprite-batch): New procedure. (draw-nine-patch*): Stop using sprite batches for now. * chickadee/render/font.scm: (<font>)[sprite-batches]: New field. (load-tile-font, load-font): Create a sprite batch for each texture loaded. (draw-text*): Use sprite batches. * chickadee/render/tiled.scm: (<tile>)[batch]: New field. (<tileset>)[batch]: New field. (load-tile-map): Create a sprite batch for each tileset. (draw-tile-layer): Use new sprite batch API. (draw-tile-map*): Remove reference to deleted macro.
* render: buffer: Allow specifying read/write mode when mapping buffer.David Thompson2019-05-101-2/+5
| | | | * chickadee/render/buffer.scm (map-buffer!): Add optional 'mode' argument.
* render: buffer: Fix buffer orphaning for streaming buffers.David Thompson2019-05-101-4/+3
| | | | | * chickadee/render/buffer.scm (map-buffer!): Compare symbols to symbols for checking stream usage. -__-
* render: buffer: Don't attempt to map a buffer that is already mapped.David Thompson2019-05-091-10/+11
| | | | | * chickadee/render/buffer (map-buffer!): Do nothing if buffer is already mapped to avoid throwing an error.
* render: buffer: Add buffer-mapped? procedure.David Thompson2019-05-091-0/+5
| | | | * chickadee/render/buffer.scm (buffer-mapped?): New procedure.
* render: font: Respect newline character when rendering.David Thompson2019-05-081-15/+19
| | | | | * chickadee/render/font.scm (draw-text*): Advance to the next line on screen when \n is encountered.
* render: tiled: Parse out tile flip bits.David Thompson2019-05-081-2/+11
| | | | | * chickadee/render/tiled.scm (load-tile-map): Parse out the 3 flip bits from each tile id.
* render: tiled: Accept map versions 1.1 and 1.2.David Thompson2019-05-081-1/+1
|
* texture: tileset: Fix rows/columns calculation.David Thompson2019-05-081-2/+2
| | | | | * chickadee/render/texture.scm (split-texture): Use ceiling instead of floor when computing number of rows and columns.
* Remove obsolete controller handling code.David Thompson2019-01-091-6/+0
| | | | | * chickadee.scm (run-game): Remove initial iteration over game controller hash table.
* render: sprite: Allow nine patches to be tinted.David Thompson2019-01-082-5/+10
| | | | | | * chickadee/render/sprite.scm (draw-nine-patch*, draw-nine-patch): Add tint keyword argument. * doc/api.texi (Sprites): Document new argument.
* examples: Add sprite batch example.David Thompson2019-01-083-0/+68
| | | | | | * examples/sprite-batch.scm: New file. * examples/images/shot.png: New file. * Makefile.am (EXTRA_DIST): Add them.
* Add SDL2 game controller database file.David Thompson2019-01-083-1/+591
| | | | | | | | | This will allow for lots of controllers to be automatically mapped correctly without the user having to do anything. * data/gamecontrollerdb.txt: New file. * Makefile.am (dist_pkgdata_DATA): Add it. * chickadee.scm (run-game): Load game controller db file.
* examples: game-controller: Add left/right trigger rendering.David Thompson2019-01-061-30/+38
|
* render: sprite: Revamp rendering process.David Thompson2019-01-062-125/+152
| | | | Add support for tinting and simplify batch rendering.
* render: color: Use f32vector under the hood.David Thompson2019-01-061-28/+34
| | | | | | | | | * chickadee/render/color.scm (<color>): Use a single field for storing bytevector. (make-color): Wrap f32vector. (color-r, color-g, color-b, color-a): Fetch channel values from f32vector. (color): New procedure.
* math: matrix: Add transform-x and transform-y procedures.David Thompson2019-01-061-8/+17
| | | | * chickadee/math/matrix.scm (transform-x, transform-y): New procedures.
* examples: Add game controller test.David Thompson2019-01-063-0/+79
| | | | | | * examples/game-controller.scm: New file. * examples/images/controller-buttons.png: New file. * Makefile.am (EXTRA_DIST): Add them.
* Remove redundant open-all-controllers procedure.David Thompson2019-01-061-8/+0
| | | | | | | | | I thought this was necessary to process controllers that were already connected to the computer before a Chickadee-using program was launched, but that doesn't seem to be the case. * chickadee.scm (open-all-controllers): Delete. (run-game): Remove call to open-all-controllers.
* Add controller-name procedure.David Thompson2019-01-061-0/+9
| | | | * chickadee.scm (controller-name): New procedure.
* Fix normalization of game controller axis values.David Thompson2019-01-061-3/+2
| | | | | * chickadee.scm (controller-axis): Fix math so that axis values are actually in the range [0, 1].
* render: texture: Fix error when splitting certain textures.David Thompson2019-01-061-4/+2
| | | | | | | | | | The split-texture procedure would throw an exception in the event that the image width/height could not be divided by tile width/height with 0 remainder. * chickadee/render/texture.scm (split-texture): Floor the results of dividing image dimensions by tile dimensions and ensure they are exact integers.
* guix: Update to latest guile-sdl2 commit.David Thompson2019-01-061-2/+2
|
* Makefile: Install compiled files in the proper location.David Thompson2018-12-161-1/+1
| | | | * Makefile.am (godir): Use "site-ccache", not "ccache".
* render: font: Export a default-font procedure.David Thompson2018-12-141-3/+5
| | | | | * chickadee/render/font.scm (default-font): Change from variable to procedure.
* Credit J-Robot for the pixel explosion image.David Thompson2018-12-141-0/+3
|
* Rename data/CREDITS to data/AUTHORS.David Thompson2018-12-142-1/+1
|
* Add particles example.David Thompson2018-12-143-0/+53
| | | | | | * examples/images/explosion.png: New file. * examples/particles.scm: New file. * Makefile.am (EXTRA_DIST): Add them.
* Fix game controller stuff.David Thompson2018-12-141-5/+5
| | | | | Forgot to prefix imported procedures since I define procedures with the same names.
* doc: Improve Fonts section.David Thompson2018-12-141-36/+13
|
* Add controller query procedures.David Thompson2018-12-141-4/+18
| | | | | | | Not ready to document them at this time since I have not done full tests with a USB controller yet. * chickadee.scm (controller-button-pressed?, controller-axis): New procedures.
* Add mouse query procedures.David Thompson2018-12-131-2/+23
| | | | | * chickadee.scm (mouse-x, mouse-y, mouse-button-pressed?, mouse-button-released?): New procedures.
* Re-add key-pressed? and key-released? procedures.David Thompson2018-12-132-3/+13
| | | | | * chickadee.scm (key-pressed?, key-released?): New procedures. * examples/grid.scm: Remove (sdl2 input keyboard) import.
* Re-hide SDL2 details.David Thompson2018-12-1311-318/+313
| | | | | | | | | | | | | | | | | | | | | 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: Simplify text example.David Thompson2018-12-131-8/+2
|
* Fix automake warning.David Thompson2018-12-131-1/+1
|
* render: font: Include a default font for convenience.David Thompson2018-12-1312-277/+274
| | | | | | | | | | | | | | | | | | | * data/fonts/good-neighbors.fnt: New file. * data/fonts/good-neighbors.png: New file. * data/CREDITS: New file. * examples/fonts/AUTHORS: Delete. * examples/fonts/good_neighbors_starling.png: Delete. * examples/fonts/good_neighbors_starling.xml: Delete. * Makefile.am (dist_pkgdata_DATA, fontsdir, dist_fonts_DATA): New variables. (EXTRA_DIST): Remove examples/fonts files. * chickadee/render/font.scm (draw-text): Make font an optional keyword argument. * doc/api.texi (Fonts): Document it. * examples/grid.scm: Update to use new draw-text API. * examples/nine-patch.scm: Ditto. * examples/text.scm: Ditto. squash! render: font: Include a default font for convenience.
* render: sprite: Use a single buffer for unbatched sprite mesh.David Thompson2018-12-131-36/+46
| | | | | * chickadee/render/sprite.scm (draw-sprite-unbatched): Combine vertices and texcoords into a single packed buffer.