summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* render: Move texture module to sly/render directory.David Thompson2014-11-0716-16/+16
| | | | | | | | | | | | | | | | | | | | * sly/texture.scm: Delete. * sly/render/texture.scm: New file. * Makefile.am (SOURCES): Add it. * sly/animation.scm: Use (sly render texture). * sly/font.scm: Likewise. * sly/mesh.scm: Likewise. * sly/render/context.scm: Likewise. * sly/render/framebuffer.scm: Likewise. * sly/render/renderer.scm: Likewise. * sly/shape.scm: Likewise. * sly/sprite.scm: Likewise. * sly/tileset.scm: Likewise. * examples/coroutine.scm: Likewise. * examples/joystick.scm: Likewise. * examples/particles.scm: Likewise. * examples/tilemap.scm: Likewise. * examples/transition.scm: Likewise.
* configure: Correct version number.David Thompson2014-11-071-1/+1
| | | | * configure.ac: Change version to 0.1.
* configure: Check for freeimage.David Thompson2014-11-071-2/+5
| | | | * configure.ac: Perform a primitive check for libfreeimage.
* configure: Check for guile-sdl and guile-opengl.David Thompson2014-11-071-3/+5
| | | | | * configure.ac: Check for (sdl sdl), (sdl mixer), (sdl ttf), and (gl) modules.
* configure: Check for Guile >= 2.0.11.David Thompson2014-11-071-9/+2
| | | | * configure.ac: Test for Guile 2.0.11.
* configure: Test for GSL.David Thompson2014-11-071-0/+1
| | | | * configure.ac: Test for gsl pkg-config module.
* Rename (sly helpers) module to (sly utils).David Thompson2014-11-077-7/+7
| | | | | | | | | | | | | * sly/helpers.scm: Delete. * sly/utils.scm: New file. * Makefile.am (SOURCES): Remove old file. Add new one. * sly/render/camera.scm: s/helpers/utils/ * sly/scene.scm: Likewise. * sly/shader.scm: Likewise. * sly/sprite.scm: Likewise. * sly/texture.scm: Likewise. * sly/transform.scm: Likewise. * examples/tilemap.scm: Likewise.
* render: Add rendering context record type.David Thompson2014-11-076-35/+147
| | | | | | | | | | | | | | | | | * sly/render/context.scm: New file. * Makefile.am (SOURCES): Add it. * sly/render/renderer.scm (with-texture-maybe): Delete. (apply-render-op): Use render context. (<renderer>) [context]: New field. (%make-renderer): New syntax. (make-renderer): Was syntax, now a procedure. (render): Use render context. * sly/render/vertex-array.scm (apply-vertex-array): New procedure. (with-vertex-array): Use it. * sly/shader.scm (apply-shader-program): New procedure. (with-shader-program): Use it. * sly/texture.scm (apply-texture): New procedure. (with-texture): Use it.
* transform: Use GSL for much faster matrix multiplication.David Thompson2014-11-071-11/+12
| | | | | * sly/transform (transform->pointer): New procedure. (transform*): Use GSL.
* wrappers: Add GSL wrapper.David Thompson2014-11-072-0/+50
| | | | | * Makefile.am (WRAPPER_SOURCES): Add it. * sly/wrappers/gsl.scm: New file.
* scene: Decouple draw method from scene graph.David Thompson2014-10-303-4/+14
| | | | | | | * sly/render/renderer.scm (transform-render-op): New procedure. * sly/scene.scm (scene->renderer): Don't pass transform to draw method. Instead, transform the resulting render op afterwards. * sly/mesh.scm (draw): Remove 'transform' parameter.
* render: Remove knowledge of cameras from renderer.David Thompson2014-10-292-23/+22
| | | | | | | | | | | * sly/render/renderer.scm (renderer-cameras): Delete. (apply-render-op): Remove 'view' parameter. (make-renderer): Remove 'cameras' parameter. (render): Remove camera logic. * sly/scene.scm (scene->render-list): Renamed. (scene->renderer): New procedure. Return a renderer instead of a list of render ops. (draw-scene): New procedure.
* viewport: Memoize clear-buffer-mask.David Thompson2014-10-281-9/+12
| | | | * sly/render/camera.scm (clear-buffer-mask): Memoize.
* viewport: Define standard clear flags.David Thompson2014-10-281-2/+4
| | | | * sly/render/camera.scm (%standard-clear-flags): New variable.
* renderer: Apply camera viewport before rendering.David Thompson2014-10-281-0/+1
| | | | * sly/render/renderer.scm (render): Apply camera viewports.
* font: Embrace the bottom-left origin.David Thompson2014-10-281-4/+24
| | | | | * sly/font.scm (flip-pixels-vertically): New procedure. (render-text): Flip surface vertically before creating a texture.
* texture: Embrace the bottom-left origin.David Thompson2014-10-281-2/+0
| | | | * sly/texture.scm (load-bitmap): Do not flip y-axis.
* Remove unneeded (sly camera) imports.David Thompson2014-10-282-2/+0
| | | | | * sly/game.scm: Remove (sly camera) import. * sly/scene.scm: Likewise.
* render: Add framebuffer module.David Thompson2014-10-282-0/+119
| | | | | * sly/render/framebuffer.scm: New file. * Makefile.am (SOURCES): Add it.
* gl: Add wrappers for framebuffer/renderbuffer functions.David Thompson2014-10-281-0/+73
| | | | | | | * sly/wrappers/gl.scm (glGenFramebuffers, glDeleteFramebuffers, glBindFramebuffer, glFramebufferTexture2D, glCheckFramebufferStatus, glGenRenderbuffers, glDeleteRenderbuffers, glBindRenderbuffer, glRenderbufferStorage, glFramebufferRenderbuffer): New procedures.
* camera: Rewrite module.David Thompson2014-10-264-142/+108
| | | | | | | * Makefile.am (SOURCES): Update camera module file name. * sly/camera.scm: Delete. * sly/render/renderer.scm: Import new camera module. * sly/render/camera.scm: New file.
* render: Add blend-mode field to render operations.David Thompson2014-10-261-5/+16
| | | | | | * sly/render/renderer.scm (render-op-blend-mode): New syntax. (make-render-op): Add 'blend-mode' parameter. (apply-render-op): Set blending mode.
* render: Add blending data type.David Thompson2014-10-261-1/+58
| | | | | | | | | * sly/render/utils.scm (<blend-mode>): New record type. (make-blend-mode, blend-mode?, blend-mode-source, blend-mode-destination): New syntax. (default-blend-mode): New variable. (source-blend-function, destination-blend-function, apply-blend-mode): New procedures.
* transform: Add transform-position procedure.David Thompson2014-10-261-0/+9
| | | | * sly/transform.scm (transform-position): New procedure.
* mesh: Remove accidentally exported symbols.David Thompson2014-10-261-3/+1
| | | | | * sly/mesh.scm: Remove 'mesh-length' and 'mesh->render-op' from export list.
* mesh: Use new renderer API.David Thompson2014-10-263-242/+108
| | | | | | | | | | | | | | | | | * sly/mesh.scm (<vertex-buffer>, %make-vertex-buffer, vertex-buffer?, vertex-buffer-id, vertex-buffer-type, vertex-buffer-attr-size, vertex-buffer-length, generate-vertex-buffer, bind-vertex-buffer, with-vertex-buffer, vertices-bytevector, attribute-size, gl-buffer-type, make-vertex-buffer, generate-vertex-array, with-vertex-array, vertex-attrib-pointer): Remove old vertex buffer/array procedures. (mesh-length, draw-mesh): Delete. (mesh-shader): New procedure. (make-mesh): Reimplement. (draw): New method. * sly/shape.scm (make-cube): Decouple from scene node. Use new mesh constructor. * sly/sprite.scm (make-sprite): Likewise.
* scene: Rewrite scene graph.David Thompson2014-10-251-73/+47
| | | | | | | | * sly/scene.scm (make-scene, scene-node-texture, update-scene-node, draw-scene-node, <scene>, scene?, scene-root, scene-cameras, update-scene, draw-scene, with-texture-maybe): Delete. (scene-node, scene-node-object, scene-node-visible?, flatten, scene->render-list): New procedures.
* render: Add utils module.David Thompson2014-10-252-0/+30
| | | | | * sly/render/utils.scm: New file. * Makefile.am (SOURCES): Add it.
* render: Add simple renderer.David Thompson2014-10-252-0/+111
| | | | | * sly/render/renderer.scm: New file. * Makefile.am (SOURCES): Add it.
* TODO: Add items.David Thompson2014-10-251-0/+8
| | | | * TODO.org: Add new items.
* game: Decouple the scene graph from the game loop.David Thompson2014-10-251-18/+9
| | | | | * sly/game.scm (start-game-loop): Just run the draw hook instead of rendering a scene graph.
* render: Add vertex array module.David Thompson2014-10-252-0/+171
| | | | | * sly/render/vertex-array.scm: New file. * Makefile.am (SOURCES): Add it.
* shader: Explicitly bind attribute locations before binding.David Thompson2014-10-251-0/+8
| | | | | | * sly/shader.scm (vertex-position-location, vertex-texture-location): New variables. (make-shader-program): Bind attribute locations.
* helpers: Add trampoline procedure.David Thompson2014-10-241-1/+6
| | | | * sly/helpers.scm (trampoline): New procedure.
* transform: Add build-transform procedure.David Thompson2014-10-231-0/+9
| | | | * sly/transform.scm (build-transform): New procedure.
* Move rotate procedure to transform module.David Thompson2014-10-232-21/+20
| | | | | * sly/quaternion.scm (rotate): Remove. * sly/transform.scm (rotate): New procedure.
* quaternion: Export type descriptor.David Thompson2014-10-231-1/+1
| | | | * sly/quaternion.scm: Export '<quaternion>'.
* quaternion: Add axis angle conversion to constructor.David Thompson2014-10-211-17/+17
| | | | | | | * sly/quaternion.scm (%make-quaternion, quaternion): New procedures. (axis-angle->quaternion): Delete procedure. (make-quaternion): Support building from axis angle. (rotate): Remove axis angle special-case.
* gl: Properly undo state change caused by with-gl-bind-texture.David Thompson2014-10-191-5/+25
| | | | | | * sly/wrappers/gl.scm (gl-current-texture): New procedure. (with-gl-bind-texture): Don't bind texture if already bound. Restore the previously bound texture after evaluating the body.
* scene: Simplify scene nodes and meshes.David Thompson2014-10-194-129/+130
| | | | | | | | | | | | * sly/scene.scm (scene-node-positin, scene-node-scale, scene-node-rotation, interpolate): Delete. (with-texture-maybe): New macro. (draw-scene-node): Remove interpolation logic. Add texture binding. * sly/mesh.scm (mesh-texture): Delete. (make-mesh): Remove texture parameter. (draw-mesh): Remove texture binding. * sly/shape.scm (make-cube): Wrap mesh in a scene node. * sly/sprite.scm (make-sprite): Likewise.
* 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.