summaryrefslogtreecommitdiff
path: root/2d
Commit message (Collapse)AuthorAgeFilesLines
* Rename guile-2d to Sly!David Thompson2014-06-2828-3802/+0
| | | | Massive find/replace job.
* Fix window-size signal.David Thompson2014-06-221-1/+1
| | | | * 2d/window.scm (window-size): Fix improper use of vector literal.
* Delete transform-position procedure.David Thompson2014-06-201-6/+1
| | | | * 2d/transform (transform-position): Delete it.
* Add support for 3D vectors in translate procedure.David Thompson2014-06-201-6/+19
| | | | * 2d/transform.scm (translate): Support 3D vector as argument.
* Add support for 3D vectors and scalars in scale procedure.David Thompson2014-06-201-6/+25
| | | | * 2d/transform.scm (scale): Support 3D vectors and scalars as arguments.
* Tweak transform API.David Thompson2014-06-101-25/+7
| | | | | | * 2d/transform.scm (make-transform*): Delete it. (transform-translate, transform-scale): Rename. (translate, scale): New procedures.
* Add rotation transformations for x and y axes.David Thompson2014-06-091-5/+17
| | | | | | | * 2d/transform.scm (rotate-x, rotate-y, rotate-z): New procedures. (transform-rotate): Renamed. (make-transform*): Use rotate-z for now.
* Replace vector2 module with a more generic vector module.David Thompson2014-06-0711-179/+232
| | | | | | | | | | | | | | | | | | | | | | | | | * 2d/vector2.scm: Delete it. * 2d/vector.scm: New file. * Makefile.am (SOURCES): s/vector2/vector. * 2d/font.scm: * 2d/keyboard.scm: * 2d/mouse.scm: * 2d/rect.scm: * 2d/shader.scm: * 2d/sprite.scm: * 2d/texture.scm: * 2d/transform.scm: * 2d/window.scm: * examples/2048/2048: * examples/animation.scm: * examples/coroutine.scm: * examples/font.scm: * examples/particles.scm: * examples/simple.scm: * examples/tilemap.scm: Use vectors instead of defunct vector2.
* Add v= procedure.David Thompson2014-05-271-0/+5
| | | | * 2d/vector2.scm (v=): New procedure.
* Add scalar multiplication support to v* and remove vscale.David Thompson2014-05-271-8/+7
| | | | | * 2d/vector2.scm (vscale): Delete it. (v*): Add support for scalar multiplication.
* Add perspective-projection procedure.David Thompson2014-05-261-1/+28
| | | | * 2d/transform.scm (perspective-projection): New procedure.
* Fix embarrassing issue with transform-translate.David Thompson2014-05-251-4/+4
| | | | * 2d/transform.scm (transform-translate): Correct matrix.
* Rename, unexport, and memoize shader-program-attribute-location.David Thompson2014-05-221-5/+7
| | | | | * 2d/shader.scm (shader-program-attribute-location): Rename. (attribute-location): Memoize.
* Memoize uniform-location.David Thompson2014-05-222-7/+23
| | | | | | | * 2d/helpers.scm (memoize): New procedure. * 2d/shader.scm (uniform-location): memoize. (uniform-set!): Pass symbol instead of string.
* Add load-shader-program procedure.David Thompson2014-05-223-14/+15
| | | | | | | * 2d/shader.scm (load-shader-procedure): New procedure. * 2d/font.scm: * 2d/sprite.scm: Use it.
* Add explicit vertex/fragment shader parameters to make-shader-program.David Thompson2014-05-221-3/+18
| | | | | * 2d/shader.scm (make-shader-program): Change parameter list. (vertex-shader?, fragment-shader?): New procedures.
* Add pre-inst-env script.David Thompson2014-05-211-1/+2
| | | | | | | | | | | | | * configure.ac: Add pre-inst-env as config file. * pre-inst-env.in: New file. * 2d/config.scm.in (%pkgdatadir): Use GUILE_2D_PKGDATADIR environment variable, if defined. * README.org: Document pre-inst-env script. * .gitignore: Ignore pre-inst-env.
* Add make-transform*.David Thompson2014-05-151-0/+10
| | | | * 2d/transform.scm (make-transform*): New procedure.
* Make sprites immutable.David Thompson2014-05-071-16/+14
| | | | | | | | | | | | | * 2d/sprite.scm (<sprite>): Make immutable. (set-sprite-drawable!, set-sprite-position!, set-sprite-scale!) (set-sprite-rotation!, set-sprite-color!, set-sprite-anchor!): Delete. (set-sprite-drawable, set-sprite-position, set-sprite-scale) (set-sprite-rotation, set-sprite-color, set-sprite-anchor): New procedures. * examples/coroutine.scm: * examples/particles.scm: Use immutable sprite setters.
* Add live-reload module.David Thompson2014-05-041-0/+54
| | | | | | * Makefile.am (SOURCES): Add it. * 2d/live-reload.scm: New module.
* Add current-agenda parameter.David Thompson2014-05-046-57/+82
| | | | | | | | | | | | | | | | | | | | | | | | | * 2d/agenda.scm (current-agenda): New variable. (with-agenda): New macro. (agenda-time, tick-agenda!, clear-agenda!, schedule) (schedule-interval, schedule-each, wait): Remove agenda parameter. * 2d/game.scm (game-agenda): Delete it. (update): Tick current agenda. * 2d/helpers.scm (define-guardian): Remove agenda argument. * 2d/repl.scm (start-2d-repl): Remove agenda argument to schedule-each. * 2d/signal.scm (signal-sample, signal-delay, signal-throttle): Remove agenda parameter. * 2d/sprite.scm: * examples/common.scm: * examples/coroutine.scm: * examples/font.scm: * examples/particles.scm: Remove mention of game-agenda. * README.org: Update example snippets.
* Allow make-rect to accept two vector2s as arguments.David Thompson2014-05-031-1/+9
| | | | | * 2d/rect.scm (make-rect): Use case-lambda to accept four numbers or two vector2s.
* Add transform-position procedure.David Thompson2014-05-021-0/+6
| | | | * 2d/transform.scm (transform-position): New procedure.
* Prefix matrix operations with "transform-".David Thompson2014-05-021-6/+6
| | | | | * 2d/transform.scm (translate, scale, rotate): Renamed. (transform-translate, transform-scale, transform-rotate): New names.
* Add null-rect variable.David Thompson2014-05-021-0/+3
| | | | * 2d/rect.scm (null-rect): New variable.
* Fix update procedure.David Thompson2014-04-271-3/+3
| | | | | | This is embarrassing. * 2d/game.scm (update): Actually use the iterative inner procedure.
* Ensure that interpolation alpha is clamped to the range [0, 1].David Thompson2014-04-271-1/+2
| | | | * 2d/game.scm (alpha): Clamp value to [0, 1].
* Add max-ticks-per-frame variable.David Thompson2014-04-271-5/+15
| | | | | * 2d/game.scm (max-ticks-per-frame): New variable (update): Limit ticks to the value of max-ticks-per-frame.
* Update commentary for (2d game) module.David Thompson2014-04-241-1/+1
| | | | * 2d/game.scm: Change commentary.
* Rename game loop procedures and remove parameter.David Thompson2014-04-241-22/+21
| | | | | | | | | | | | | | | | | | | | | | * 2d/game.scm (tick-interval): No longer a parameter. (run-game-loop, start-game-loop): Rename. (quit-game, stop-game-loop): Rename. * examples/animation.scm: Use start-game-loop and stop-game-loop. * examples/common.scm: Use start-game-loop and stop-game-loop. * examples/coroutine.scm: Use start-game-loop and stop-game-loop. * examples/font.scm: Use start-game-loop and stop-game-loop. * examples/guile-2048/guile-2048.scm: Use start-game-loop and stop-game-loop. * examples/particles.scm: Use start-game-loop and stop-game-loop. * examples/simple.scm: Use start-game-loop and stop-game-loop. * examples/tilemap.scm: Use start-game-loop and stop-game-loop.
* Sleep when the game loop runs too fast.David Thompson2014-04-241-0/+9
| | | | | * 2d/game.scm (frame-sleep): New procedure. (game-loop): Use frame-sleep.
* Run game loop with a prompt.David Thompson2014-04-241-47/+16
| | | | | | | * 2d/game.scm (game-loop-status, game-running?, game-paused?) (pause-game, resume-game, paused-agenda): Delete. (run-game-loop): Call game loop with prompt. (quit-game): Abort to game loop prompt.
* Remove the accumulator parameter from the game loop.David Thompson2014-04-231-40/+19
| | | | | | | * 2d/game.scm (accumulator, update-and-render, tick) Delete. (run-game-loop): Remove accumulator parameterization. (game-loop): Use lag variable instead of accumulator. (update, alpha): Add lag as formal parameter.
* Add bindings for OpenGL instanced rendering extension.David Thompson2014-04-211-1/+23
| | | | | * 2d/wrappers/gl.scm (glDrawArraysInstanced): New procedure. (glVertexAttribDivisor): New procedure.
* Add shader-program-attribute-location procedure.David Thompson2014-04-211-0/+6
| | | | * 2d/shader.scm (shader-program-attribute-location): New procedure.
* Export shader-program-id procedure.David Thompson2014-04-211-0/+1
| | | | * 2d/shader.scm: Export shader-program-id.
* Rename signal-combine to signal-zip.David Thompson2014-04-211-2/+2
| | | | | * 2d/signal.scm (signal-combine): Renamed. (signal-zip): New procedure.
* Add more texture anchor types.David Thompson2014-03-312-11/+23
| | | | | | | | * 2d/texture.scm (anchor-texture): Add top-right, bottom-left, bottom-right, top-center, and bottom-center anchor types. * 2d/font.scm (make-label): Don't call anchor-texture when there is no texture.
* Add cyan, yellow, and all 27 tango palette colors.David Thompson2014-03-301-2/+67
| | | | | | | | | | | | | * 2d/color.scm (cyan, yellow, tango-light-butter (tango-butter, tango-dark-butter, tango-light-orange) (tango-orange, tango-dark-orange, tango-light-chocolate) (tango-chocolate, tango-dark-chocolate, tango-light-chameleon) (tango-chameleon, tango-dark-chameleon, tango-light-sky-blue) (tango-sky-blue, tango-dark-sky-blue, tango-light-plum, tango-plum) (tango-dark-plum, tango-light-scarlet-red, tango-scarlet-red) (tango-dark-scarlet-red, tango-aluminium-1, tango-aluminium-2) (tango-aluminium-3, tango-aluminium-4, tango-aluminium-5) (tango-aluminium-6): New variables.
* Fix crash when the empty string is used for a label.David Thompson2014-03-301-11/+15
| | | | | | * 2d/font.scm (render-text): Bail when surface is #f. (make-label): Don't make vertices when there is no texture. (draw-label): Don't draw when there is no texture.
* Import math module in (2d color) module.David Thompson2014-03-301-0/+1
| | | | * 2d/color.scm: Import (2d color).
* Expand color API.David Thompson2014-03-301-16/+61
| | | | | | | * 2d/color.scm (color*, color+, color-, color-inverse): New procedures. (use-color): Delete it. (make-color): Clamp channels to the range [0, 1]. (rgba, rgb): Use low-level color constructor.
* Add enable-audio procedure.David Thompson2014-03-291-2/+4
| | | | * 2d/audio.scm (enable-audio): New procedure.
* Improve define-signal macro.David Thompson2014-03-291-17/+35
| | | | | | | * 2d/signal.scm (define-signal): Correctly handle when previous variable holds a non-signal value and coerce non-signal values into signals. (make-signal-maybe): New procedure. (splice-signals!): Assume that inputs are always valid signals.
* Remove vector2-translate and vector2-scale.David Thompson2014-03-291-11/+1
| | | | | * 2d/vector2.scm (vector2-translate): Delete it. (vector2-scale): Delete it.
* Don't load font shaders upon importing (2d font) module.David Thompson2014-03-291-10/+15
| | | | | | | * 2d/font.scm (font-shader): Set to #f initially. (enable-fonts): New procedure. * examples/font.scm: Enable fonts.
* Don't load sprite shaders upon importing (2d sprite) module.David Thompson2014-03-291-7/+13
| | | | | | | * 2d/sprite.scm (sprite-shader): Set to #f initially. (enable-sprites): New procedure. * 2d/common.scm: Enable sprites.
* Don't open window upon importing the (2d window) module.David Thompson2014-03-291-8/+1
| | | | | | * 2d/window.scm (open-window): Remove default argument. * examples/common.scm: Open a window.
* Replace figl with the new guile-opengl official release.David Thompson2014-03-2310-16/+14
|
* Don't start the REPL server upon importing (2d repl).David Thompson2014-03-101-7/+11
| | | | | | * 2d/repl.scm (start-2d-repl): New procedure. * examples/common.scm: Start the REPL server. * sandbox: Start the REPL server.