summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* quaternion: Make better use of pattern matching.David Thompson2014-10-191-13/+11
| | | | | * sly/quaternion.scm (axis-angle->quaternion, quaternion->vector, vector->quaternion): Use match-lambda and record destructuring.
* quaternion: Replace quaternion->transform with rotate.David Thompson2014-10-191-19/+21
| | | | | * sly/quaternion.scm (quaternion->transform): Remove. (rotate): New procedure.
* transition: Move interpolation procedures to their relevant module.David Thompson2014-10-034-83/+47
| | | | | | | | | * sly/color.scm (color-lerp): New procedure. * sly/math.scm (make-lerp, lerp): New procedures. * sly/math/vector.scm (vlerp): New procedure. * sly/transition.scm (interpolator, number-interpolate, vector-interpolate, color-interpolate): Delete procedures. (guess-interpolator): Rewrite with 'match-lambda*'.
* color: Use pattern matching.David Thompson2014-10-032-45/+35
| | | | | | | * sly/color.scm (color*): Use pattern matching and allow colors to be multiplied by scalars. (color-scale): Delete it. (color+, color-, color-inverse): Use pattern matching.
* Export vector record type identifiers for destructuring via 'match'.David Thompson2014-10-023-58/+44
| | | | | | | * sly/match/vector.scm: Export <vector2>, <vector3> and <vector4>. (vx, vy, vz): Use 'match' more wisely. * sly/mesh.scm (vertices-bytevector): Destructure vectors. * sly/transform.scm (translate, scale): Ditto.
* Rewrite vector math module.David Thompson2014-10-0121-329/+471
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * .gitignore: Ignore '*.log' files. * sly/vector.scm: Delete file. * sly/math/vector.scm: New file. * tests/math/vector.scm: New file. * Makefile.am: Add new file and remove the old one. * sly/font.scm: Remove import. * sly/game.scm: Change import. * sly/joystick.scm (make-directional-signal-raw, make-directional): Use 'vector2'. * sly/keyboard.scm (key-directions): Use 'vector2'. * sly/mesh.scm (vertices-bytevector): Use new vector procedures. * sly/mouse.scm (mouse-position): Use 'vector2'. * sly/quaternion.scm (axis-angle->quaternion, quaternion->vector, vector->quaternion): Use new vector procedures. * sly/rect.scm (rect-position, rect-top-right, rect-bottom-left, rect-bottom-right, rect-center, rect-size): Use 'vector2'. * sly/scene.scm (make-scene-node): Use 'vector2'. * sly/shader.scm: Change import. * sly/shape.scm (make-cube): Use new vector procedures. * sly/sprite.scm (make-sprite): Use new vector procedures. * sly/texture.scm (anchor-texture): Use 'vector2'. * sly/transform.scm (transform-vector2): Use 'vector2'. (translate, scale): Use new vector procedures. * sly/transition.scm (guess-interpolator): Use new vector procedures. * sly/window.scm (make-window, window-size, open-window): Use 'vector2'.
* scene: Remove messy interpolation/caching for now.David Thompson2014-09-302-61/+11
| | | | | | | | | | | | * sly/game.scm (run-game-loop): Remove scene updating step. * sly/scene.scm (scene-node-prev-position, set-scene-node-prev-position!, scene-node-prev-scale, set-scene-node-prev-scale!, scene-node-prev-rotation, set-scene-node-prev-rotation!, scene-node-transform, set-scene-node-transform!, scene-node-dirty?, update-scene-node, recompute-transform!): Delete procedures. (make-scene-node): Remove transform caching. (draw-scene-node): Re-calculate transforms every frame.
* scene: Decouple cameras from the scene they render.David Thompson2014-09-293-35/+59
| | | | | | | | | | | | * sly/camera.scm (make-camera, orthographic-camera): Remove 'scene' parameter. (draw-camera): Delete. (call-with-camera): New procedure. * sly/game.scm (start-game-loop): Replace 'camera' parameter with 'scene'. * sly/scene.scm (make-scene, scene?, update-scene, draw-scene): New procedures. (scene-root): Replace.
* TODO: Add new item.David Thompson2014-09-281-0/+3
|
* math: Add 2pi constant.David Thompson2014-09-261-1/+2
| | | | * sly/math.scm (2pi): New variable.
* sprite: Add anchor and color parameters to load-sprite.David Thompson2014-09-261-2/+4
| | | | * sly/sprite.scm (load-sprite): Add 'anchor' and 'color' parameters.
* shader: Cache locations of uniforms/attributes at shader compile-time.David Thompson2014-09-222-54/+88
| | | | | | | | | | | | | | | * sly/shader.scm (<uniform>, <attribute>): New data types. (make-uniform, uniform?, uniform-name, uniform-location, make-attribute, attribute?, attribute-name, attribute-location, shader-program-uniforms, shader-program-attributes, shader-program-uniform-location, shader-program-attribute-location): New procedures. (%display-linking-error, %shader-program-linked, uniform-location, attribute-location): Delete procedures. (make-shader-program): Look up locations of uniforms/attributes. (load-shader-program): Add uniforms and attributes parameters. (load-default-shader): Specify uniforms and attributes. (uniform-set!): Use shader-program-uniform-location.
* TODO: Add new item.David Thompson2014-09-221-0/+4
| | | | * TODO.org (Shaders): New item.
* Update sandbox.David Thompson2014-09-221-3/+7
| | | | * sandbox: Update.
* examples: Update 2048.David Thompson2014-09-221-109/+109
| | | | * examples/2048/2048: Update.
* examples: Update simple example.David Thompson2014-09-221-6/+24
| | | | * examples/simple.scm: Update.
* examples: Update tilemap example.David Thompson2014-09-101-52/+54
| | | | * examples/tilemap.scm: Update it.
* examples: Update scene-graph example.David Thompson2014-09-071-58/+62
| | | | * examples/scene-graph.scm: Update to use new scene-node DSL.
* scene: Add simple DSL for creating scene nodes.David Thompson2014-09-071-2/+4
| | | | | * sly/scene.scm (scene-root): Use make-scene-node instead of scene-node. (scene-node): Create a more pleasant syntax for defining scene nodes.
* mesh: Allow uniform values to be signals.David Thompson2014-09-061-1/+3
| | | | * sly/mesh.scm (draw-mesh): Deference uniform values that are signals.
* color: Add transparent color.David Thompson2014-09-061-0/+2
| | | | * sly/color.scm (transparent): New variable.
* sandbox: Make it work again.David Thompson2014-09-061-1/+14
| | | | * sandbox: Fix it.
* examples: Add crate texture.David Thompson2014-09-061-0/+0
| | | | * examples/images/crate.png: New file.
* examples: Update scene graph example.David Thompson2014-09-061-54/+74
|
* shader: Add color uniform to default fragment shader.David Thompson2014-09-061-1/+2
| | | | * data/shaders/default-fragment.glsl: Add color uniform.
* scene: Use GLSL uniforms in scene nodes.David Thompson2014-09-061-3/+6
| | | | | * (draw-scene-node): Add uniforms parameter and use the uniforms when rendering a mesh.
* font: Define labels in terms of sprites.David Thompson2014-09-061-20/+2
| | | | * sly/font.scm (make-label): Create sprite mesh.
* sprite: Add anchor and color parameters to make-sprite.David Thompson2014-09-061-7/+15
| | | | | * sly/sprite.scm (make-sprite): Add anchor and color keyword parameters. Color is currently unused.
* camera: Add before/after draw handlers.David Thompson2014-09-062-22/+39
| | | | | | | | | | | * sly/camera.scm (camera-before-draw-handler, camera-after-draw-handler): New procedures. (make-camera): Add before-draw and after-draw keyword parameters. (orthographic-camera): Use #:allow-other-keys. (run-handler): New procedure. (draw-camera): Enable/disable GL features before/after drawing and run handlers. * sly/window.scm (open-window): Remove calls to GL procedures.
* game: Accept one camera object as well as a list in start-game-loop.David Thompson2014-09-011-14/+20
| | | | | * sly/game.scm (start-game-loop): Support rendering a single camera object instead of just a list of cameras.
* camera: Add orthographic-camera procedure.David Thompson2014-09-011-0/+20
| | | | * sly/camera (orthographic-camera): New procedure.
* scene: Use dirty checking to improve rendering speed for static nodes.David Thompson2014-08-291-13/+38
| | | | | | | * sly/scene.scm (<scene-node>): Add transform field. (make-scene-node): Initialize transform. (scene-node-dirty?, recompute-transform!): New procedures. (draw-scene-node): Don't generate new transform if node isn't dirty.
* scene: Use quaternions for rotations.David Thompson2014-08-281-2/+3
| | | | | | * sly/scene.scm (make-scene-node): Default rotation to identity-quaternion. (draw-scene-node): Convert quaternion to transformation matrix.
* math: Add square procedure.David Thompson2014-08-281-1/+4
| | | | * sly/math.scm (square): New procedure.
* transition: Add quaternion support.David Thompson2014-08-281-0/+3
| | | | * sly/transition.scm (guess-interpolator): Use slerp for quaternions.
* Add quaternion module.David Thompson2014-08-282-0/+132
| | | | | * Makefile.am (SOURCES): Add 'sly/quaternion.scm'. * sly/quaternion.scm: New file.
* Fixup.David Thompson2014-08-281-1/+1
|
* transition: Rewrite in terms of signal-generator.David Thompson2014-08-281-10/+9
| | | | * sly/transition.scm (transition): Use signal-generator.
* signal: Add signal-timestamp.David Thompson2014-08-271-0/+7
|
* signal: Add signal-negate.David Thompson2014-08-271-0/+6
| | | | * sly/signal.scm (signal-negate): New procedure.
* camera: Use signal-let.David Thompson2014-08-271-5/+4
| | | | * sly/camera.scm (draw-camera): Use signal-let.
* signal: Allow non-signal values to be bound in signal-let.David Thompson2014-08-271-1/+1
| | | | * sly/signal.scm (signal-let): Use signal-ref-maybe instead of signal-ref.
* scene: Use signal-let instead of define/signal-ref.David Thompson2014-08-271-33/+27
| | | | | | | | * sly/scene.scm (scene-node-position, scene-node-scale, scene-node-rotation, scene-node-uniforms, scene-node-children): Do not unbox signal value. (define/signal-ref): Delete it. (update-scene-node, draw-scene-node): Use signal-let.
* sprite: Add docstring for make-sprite.David Thompson2014-08-271-0/+3
| | | | * sly/sprite.scm (make-sprite): Add docstring.
* sprite: Add load-sprite procedure.David Thompson2014-08-271-0/+6
| | | | * sly/sprite.scm (load-sprite): New procedure.
* transform: Use pattern matching in translate and scale procedures.David Thompson2014-08-261-33/+23
| | | | * sly/transform.scm (translate, scale): Use match.
* Rewrite anchor-texture to use pattern matching.David Thompson2014-08-251-22/+24
| | | | * sly/texture.scm (anchor-texture): Use match.
* Add linear texture scaling support.David Thompson2014-08-251-7/+16
| | | | | * sly/texture.scm (bitmap->texture, load-texture): Add min-filter and mag-filter parameters.
* Run draw-hook each time a frame is drawn.David Thompson2014-08-251-0/+1
|
* Update scene graph example.David Thompson2014-08-251-28/+57
| | | | * examples/scene-graph: Update.