summaryrefslogtreecommitdiff
path: root/2d
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* Okay, I think I finally got all of the license headers updated.David Thompson2014-03-106-48/+48
|
* Add updated license header to coroutine module.David Thompson2014-03-081-8/+8
| | | | * 2d/coroutine.scm: Update license header.
* Add new license header to agenda and repl module.David Thompson2014-03-082-16/+16
| | | | | * 2d/agenda.scm: Add GPLv3 header. * 2d/repl.scm: Add GPLv3 header.
* Change license to GPLv3+.David Thompson2014-03-0817-126/+143
|
* Delete mvars module.David Thompson2014-03-081-167/+0
| | | | | * 2d/mvars.scm: Delete it. * Makefile.am (SOURCES): Remove '2d/mvars.scm'.
* Integrate cooperative REPL server.David Thompson2014-03-083-415/+34
| | | | | | | | | * 2d/repl.scm: New file. * 2d/repl/repl.scm: Delete it. * 2d/repl/server.scm: Delete it. * Makfile.am (REPL_SOURCES): Delete it. (SOURCES): Add '2d/repl.scm'. * examples/common.scm: Use cooperative REPL module.
* Rename signal-do to signal-tap.David Thompson2014-03-081-2/+2
| | | | | * 2d/signal.scm (signal-do): Delete it. (signal-tap): New procedure.
* Convert FPS counter to a signal.David Thompson2014-02-171-4/+3
| | | | | * 2d/fps.scm (fps): Convert to signal. (accumulate-fps!): Set fps signal.
* Use new signal API for keyboard module.David Thompson2014-02-171-25/+28
| | | | | * 2d/keyboard.scm (key-last-down, key-last-up, key-arrows, key-wasd): Use new signal API.
* Use new signal API for mouse module.David Thompson2014-02-171-27/+41
| | | | | * 2d/mouse.scm (mouse-x, mouse-y, mouse-position, mouse-last-down) (mouse-last-up, mouse-down?): Use new signal API.
* Use new signal API for window module.David Thompson2014-02-171-19/+21
| | | | | | | * 2d/window.scm: (<window>): Don't export. (window-width, window-height, window-position, window-projection): Use new signal API. (open-window): Set 'window-position'.
* Import new signal moduleDavid Thompson2014-02-173-3/+3
| | | | | | * 2d/font.scm: Import (2d signal). * 2d/game.scm: Import (2d signal). * 2d/sprite.scm: Import (2d signal).
* Export alternate spelling of signal-box?.David Thompson2014-02-171-2/+4
| | | | | * 2d/signal.scm (%signal?): New procedure. (signal?): Redefined to be 'signal-box?'.
* Add hook->signal procedure.David Thompson2014-02-171-0/+11
| | | | * 2d/signal.scm (hook->signal): New procedure.
* Move time module inside the signal module.David Thompson2014-02-172-58/+36
| | | | | | | * 2d/signal.scm (make-boxed-signal, %signal-ref, %signal-set!): Don't export. (signal-sample, signal-delay, signal-throttle): New procedures. * 2d/time.scm: Delete file.
* Fix signal propagation.David Thompson2014-02-171-1/+1
| | | | * 2d/signal.scm (signal-propagate!): Dereference the correct signal.
* Add inputs field to <signal>.David Thompson2014-02-171-2/+3
| | | | | * 2d/signal (<signal>): Add inputs field. (%make-signal): Add inputs parameter.
* Rewrite FRP module to be dynamic and REPL friendly.David Thompson2014-02-172-247/+228
| | | | | | | | Signals are now boxed so that their contents can be overwritten at the REPL and the signal graph will magically be updated. * 2d/signal.scm: New module. * 2d/signals.scm: Delete old module.
* Rewrite define-guardian to avoid 'after-cg-hook'.David Thompson2014-02-171-11/+7
| | | | * 2d/helpers.scm (define-guardian): Don't use 'after-gc-hook'.
* Revert "Make agendas thread-safe."David Thompson2014-02-171-37/+32
| | | | This reverts commit 38f9696fed2b55e6f5484433298b7c34141da243.
* Make agendas thread-safe.David Thompson2014-02-171-32/+37
| | | | | | * 2d/agenda.scm (<agenda>): Add mutex field. (make-agenda): Initialize with recursive mutex. (tick-agenda!, clear-agenda!, schedule): Protect using 'with-mutex'.
* Rewrite font module.David Thompson2014-02-162-286/+106
| | | | | | | | | | | | | | FTGL has been dropped in favor of SDL_ttf. * 2d/font: Rewrite everything! * 2d/wrappers/ftgl.scm: Delete it. * configure.ac: Check for SDL_ttf. * data/Makefile.am (shaders_DATA): Add font shaders. * data/shaders/font-fragment.glsl: New shader. * data/shaders/font-vertex.glsl: New shader. * examples/font.scm: Rewrite font example. * examples/fonts/AUTHORS: Delete it. * examples/fonts/Boxy-Bold.ttf: Delete it.
* Add 'top-left as possible anchor value.David Thompson2014-02-161-0/+2
| | | | * 2d/texture.scm (anchor-texture): Add 'top-left condition.
* Move texture anchor procedure.David Thompson2014-02-162-15/+16
| | | | | * 2d/sprite.scm (make-anchor): Delete it. * 2d/texture.scm (anchor-texture): New procedure.
* Formatting cleanup.David Thompson2014-02-161-15/+15
| | | | * 2d/sprite.scm: Reindent file.
* Change sprite-vertex to texture-vertex.David Thompson2014-02-162-47/+49
| | | | | | | | | | * 2d/sprite.scm (sprite-vertex, sprite-vertex-size, x-offset, s-offset, pack-sprite-vertices, draw-sprite-vertices): Delete. (update-sprite-vertices!): Use 'pack-texture-vertices'. (make-sprite): Use 'texture-vertex'. (draw-sprite): Use 'draw-texture-vertices'. * 2d/texture.scm (texture-vertex, texture-vertex-size, x-offset, s-offset, pack-texture-vertices, draw-texture-vertices): New variables.
* Delete draw-texture.David Thompson2014-02-161-24/+0
| | | | * 2d/texture.scm (draw-texture): Delete it.
* Use GLSL shaders for sprites.David Thompson2014-02-161-278/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 2d/sprite.scm: (sprite-vertex): Remove color vertex. (r-offset): Delete it. (pack-sprite-vertices): Remove logic moved to shader. (draw-sprite-vertices): Remove color vertex array rendering. (sprite-shader): New variable. (<sprite>): Remove dirty field and adjust setters. (make-anchor): New procedure. (update-sprite-vertices!): Use new 'pack-sprite-vertices'. (make-sprite): Use 'make-anchor' and 'update-sprite-vertices!'. (dirty-sprite-setter): Delete it. (load-sprite): Formatting. (sprite-animation-texture): Delete it. (drawable-texture): New procedure. (sprite-texture): Extract body to 'drawable-texture'. (sprite-anchor-vector): Delete it. (set-sprite-anchor!): Reimplemented. (update-sprite-animator!): Update vertices. (draw-sprite): Use shader program. (<sprite-batch>, make-sprite-batch, sprite-batch?, sprite-batch-max-size, sprite-batch-size, set-sprite-batch-size!, sprite-batch-texture, set-sprite-batch-texture!, sprite-batch-vertices, sprite-batch-draw, with-sprite-batch): Delete all sprite batch code. * data/Makefile.am (shadersdir, shaders_DATA): New variables. * data/shaders/sprite-fragment.glsl: New shader. * data/shaders/sprite-vertex.glsl: New shader.
* Throw error if shader file does not exist.David Thompson2014-02-161-1/+3
| | | | * 2d/shader.scm (load-shader): Add exception handling.
* Use vec2 instead of vec4 for vector2 uniforms.David Thompson2014-02-161-4/+1
| | | | | * 2d/shader.scm: Use vec2 instead of vec4 when setting a vector2 uniform value.
* Remove calls that change OpenGL matrix mode.David Thompson2014-02-161-6/+1
| | | | * 2d/game.scm (draw): Remove matrix mode calls.
* Don't load default font upon module import.David Thompson2014-02-151-3/+3
| | | | | * 2d/font.scm (default-font): Delete variable. (load-default-font): New procedure.
* Fix schedule-interval.David Thompson2014-02-151-1/+2
| | | | * 2d/agenda.scm (schedule-interval): Actually use the 'delay' parameter.
* Add window-projection signal.David Thompson2014-02-151-0/+8
| | | | * 2d/window.scm (window-projection): New variable.
* Add 4x4 transformation matrix module.David Thompson2014-02-152-0/+178
| | | | | | * 2d/transform.scm: New module. * 2d/shader.scm: Add uniform setter for transforms. * Makefile.am (SOURCES): Add '2d/transform.scm'.
* Add a convenient default font.David Thompson2014-02-111-1/+6
| | | | | | | | | * data/fonts/DejaVuSans.ttf: New file. * data/fonts/AUTHORS: New file. * data/Makefile.am: New file. * configure.ac (AC_CONFIG_FILES): Add 'data/Makefile'. * Makefile.am (SUBDIRS): Add 'data'. * 2d/font.scm (default-font): New variable.
* Add build-time configuration module.David Thompson2014-02-101-0/+27
| | | | | | | * 2d/config.scm.in: New file. * Makefile.am (2d/config.scm): New rule. (SOURCES): Add 2d/config.scm. * .gitignore: Ignore 2d/config.scm.
* Add shader module.David Thompson2014-02-091-0/+268
| | | | | | | | * 2d/shader.scm: New module. * Makefile.am: Add 2d/shader.scm to SOURCES. * examples/shader.scm: New example. * examples/shaders/fragment-shader.glsl: New shader. * examples/shaders/vertex-shader.glsl: New shader.
* Remove silly circular import.David Thompson2014-02-091-1/+0
| | | | * 2d/game.scm: Don't import (2d game), silly.
* Add define-guardian macro.David Thompson2014-02-092-17/+30
| | | | | | * 2d/helpers.scm (define-guardian): New macro. * 2d/texture.scm (reap-textures): Delete it. (texture-guardian): Defined using define-guardian.
* Add new coroutine macro.David Thompson2014-02-061-6/+12
| | | | | | | | * 2d/coroutine.scm (call-with-coroutine): New name for coroutine. (coroutine): New macro. (colambda, codefine, codefine*): Use call-with-coroutine. * examples/coroutine.scm: Use coroutine macro. * README.org: Update coroutine and agenda examples.
* Remove dynamic scoping of agendas.David Thompson2014-02-065-87/+58
| | | | | | | | | | | | | | | | * 2d/agenda.scm: (*global-agenda*, current-agenda, with-agenda): Delete. (agenda?, agenda-time): Export. (schedule-every, schedule-each): Rename schedule-every to schedule-each. (schedule-next): Delete. * 2d/game.scm: (game-agenda): New variable. (update): Tick game-agenda. * 2d/repl.scm: Use new agenda API. * 2d/sprite.scm: Use new agenda API. * 2d/time.scm: (time-every, time-each, time-delay): Change signature and use new agenda API. * examples/coroutine.scm: Use new agenda API. * examples/particles.scm: Use new agenda API.
* Add window-close-hook.David Thompson2014-01-261-1/+9
| | | | * 2d/window.scm: New hook.