summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* examples: Add Conway's Game of Life.Christopher Allan Webber2015-06-152-0/+338
| | | | | * examples/life.scm: New file. * examples/Makefile.am (nobase_dist_examples_DATA): Add it.
* Add composite (sly) module.David Thompson2015-06-146-41/+72
| | | | | | | | | * sly.scm: New file. * Makefile.am (SOURCES): Add it. * sandbox.in: Use new module. * examples/common.scm: Likewise. * examples/font.scm: Likewise. * README ("Example"): Update example.
* signal: Add comments specifying emacs indentation for macros.Christopher Allan Webber2015-06-121-0/+4
| | | | | * sly/signal.scm: Add comments specifying emacs indentation level for signal-let and signal-let* syntax.
* Update README.David Thompson2015-06-101-6/+16
|
* Update sandbox script.David Thompson2015-06-101-10/+9
|
* Rename start-game-loop to run-game-loop.David Thompson2015-06-1010-11/+11
| | | | | | | | | | | | | * doc/api/init.texi: s/start-game-loop/run-game-loop/ * examples/2048/2048.scm: Likewise. * examples/animation.scm: Likewise. * examples/font.scm: Likewise. * examples/joystick.scm: Likewise. * examples/mines/mines.scm: Likewise. * examples/simple.scm: Likewise. * examples/tilemap.scm: Likewise. * sandbox.in: Likewise. * sly/game.scm: Likewise.
* Clean up build system.David Thompson2015-06-105-24/+11
|
* Fix simple example.David Thompson2015-06-061-24/+3
|
* Update examples to use new interfaces.David Thompson2015-06-067-103/+125
|
* signal: Redefine the semantics of signal-let and signal-let*.David Thompson2015-06-061-9/+9
| | | | * sly/signal.scm (signal-let, signal-let*): Reimplement.
* game: Add scene argument to start-game-loop.David Thompson2015-06-061-5/+12
| | | | * sly/game.scm (start-game-loop): Add 'scene' argument.
* render: model: Add model-scale.David Thompson2015-06-061-0/+6
| | | | * sly/render/model.scm (model-scale): New procedure.
* render: Add <scene> record type.David Thompson2015-06-064-50/+135
| | | | | | | | | | | * sly/render/scene.scm: New file. * Makefile.am (SOURCES): Add it. * sly/render/camera.scm (apply-viewport): Do not clear viewport. (clear-viewport): New procedure. * sly/render/model.scm (model-sub-scene): New accessor. (make-model): Add #:sub-scene keyword argument. (draw-sub-scene): New variable. (draw-model): Remove rendering initialization code. Render sub-scenes.
* render: context: Add with-render-context-excursion macro.David Thompson2015-06-061-1/+22
| | | | * sly/render/context.scm (with-render-context-excursion): New syntax.
* render: context: Add framebuffer and viewport fields.David Thompson2015-06-061-1/+18
| | | | | | | | | * sly/render/context.scm (render-context-framebuffer, render-context-viewport): New accessors. (make-render-context): Initialize new GL parameters. (render-context-reset!): Reset new GL parameters. (set-render-context-framebuffer!, set-render-context-viewport!): New procedures.
* render: framebuffer: Tweak interface.David Thompson2015-06-061-7/+8
| | | | | | * sly/render/framebuffer.scm (null-framebuffer): New variable. (apply-framebuffer): New procedure. (with-framebuffer): Delete.
* render: camera: Add null-viewport.David Thompson2015-06-061-0/+3
| | | | * sly/render/camera.scm (null-viewport): New variable.
* signal: Fix inaccurate comment.David Thompson2015-06-061-1/+1
| | | | | | | | I don't know why I wrote that the signal combinators are "higher order signals", but that's not true. They are just procedures (some of which are higher order procedures) that take signals as arguments. * sly/signal.scm: Fix comment.
* render: Bypass texture rendering when a model uses the null texture.David Thompson2015-06-063-1/+7
| | | | | | | | | * data/shaders/default-fragment.glsl (use_texture): New uniform. (main): Skip texture rendering when 'use_texture' is false. * sly/render/model.scm (draw-model): Set 'use_texture' uniform before rendering. * sly/render/shader.scm (load-default-shader): Register 'use_texture' uniform.
* render: texture: Add texture-null? procedure.David Thompson2015-06-061-0/+5
| | | | * sly/render/texture.scm (texture-null?): New procedure.
* Restructure README.David Thompson2015-06-052-214/+214
|
* sandbox: Generate script with autoconf.David Thompson2015-05-143-5/+6
| | | | | | | * sandbox: Delete. * .gitignore: Ignore it. * sandbox.in: New file. * configure.ac: Generate sandbox.
* examples: Use null-model.David Thompson2015-04-052-23/+18
| | | | | * examples/2048/2048.scm: Use null-model * examples/mines/mines.scm: Likewise.
* render: model: Add null-model.David Thompson2015-04-051-2/+15
| | | | | | * sly/render/model.scm (null-model): New variable. (model-null?): New procedure. (draw-model): Test for null models.
* render: model: Prefix procedures with 'model-'.David Thompson2015-04-059-82/+86
| | | | | | | | | | | | | | * sly/render/model.scm (paint, blend, group, group*, move, place): Renamed. (model-paint, model-blend, model-group, list->model, model-move, model-place): New procedures. * README.org (Example): s/move/model-move/ * examples/2048/2048.scm: Update example. * examples/mines/mines.scm: Likewise. * examples/animation.scm: Likewise. * examples/font.scm: Likewise. * examples/joystick.scm: Likewise. * examples/simple.scm: Likewise. * examples/tilemap.scm: Likewise.
* guix: Use native-inputs properly and add texinfo.David Thompson2015-04-031-3/+6
| | | | | * package.scm: Move native inputs where they belong. Add texinfo to native inputs.
* window: Throw an exception when SDL window cannot be opened.David Thompson2015-03-171-1/+2
| | | | | * sly/window.scm (open-window): Throw error when 'SDL:set-video-mode' fails.
* Fix package.scm, again.David Thompson2015-03-171-5/+10
|
* Update package.scm.David Thompson2015-03-171-11/+6
|
* render: context: Rewrite transform stack.David Thompson2015-03-122-25/+53
| | | | | | | | | * sly/render/context.scm (with-temp-transform): Delete. (render-context-transform, render-context-transform*!, render-context-transform-identity!, render-context-push-transform!, render-context-pop-transform!, copy-transform!): New procedures. (with-transform-excursion): New syntax. (render-context-reset!): Set top of matrix stack to identity matrix.
* render: context: Use GL parameters.David Thompson2015-03-111-54/+34
| | | | | | | | | | | | * sly/render/context.scm (%set-render-context-blend-mode!, %set-render-context-depth-test!?, %set-render-context-texture!, %set-render-context-shader!, %set-render-context-mesh!): Delete. (make-render-context): Create GL parameters. (render-context-reset!): Reset GL parameters. (define-context-setter): New syntax. (set-render-context-blend-mode!, set-render-context-depth-test!?, set-render-context-texture!, set-render-context-shader!, set-render-context-mesh!): Define in terms of 'define-context-setter'.
* render: shader: Add null-shader-program.David Thompson2015-03-111-1/+3
| | | | * sly/render/shader.scm (null-shader-program): New variable.
* render: texture: Ensure 2D textures are enabled when applying texture.David Thompson2015-03-111-1/+3
| | | | | * sly/render/texture.scm (apply-texture): Enable 2D textures before binding texture.
* render: utils: Add apply-depth-test.David Thompson2015-03-111-1/+7
| | | | * sly/render/utils (apply-depth-test): New procedure.
* render: utils: Improve apply-blend-mode.David Thompson2015-03-111-3/+8
| | | | | * sly/render/utils.scm (apply-blend-mode): Enable/disable blending when necessary.
* render: context: Add GL parameter type.David Thompson2015-03-111-0/+18
| | | | | | | | | | * sly/render/context.scm (<gl-parameter>): New record type. (%make-gl-parameter, make-gl-parameter, gl-parameter?, gl-parameter-default, gl-parameter-bind, gl-parameter-ref, %gl-parameter-set!, gl-parameter-set!, gl-parameter-reset!): New procedures. Fixup gl-parameter
* render: utils: Remove generic draw method.David Thompson2015-03-111-5/+1
| | | | * sly/render/utils.scm (draw): Delete.
* examples: Clean up minesweeper demo.David Thompson2015-03-101-27/+46
| | | | * examples/mines/mines.scm: Miscellaneous clean up.
* render: Remove shader argument from sprite and label constructors.David Thompson2015-03-092-15/+7
| | | | | * sly/render/font.scm (make-label): Remove 'shader' keyword argument. * sly/render/sprite.scm (make-sprite): Likewise.
* render: Merge <group> into <model>.David Thompson2015-03-0911-252/+171
| | | | | | | | | | | | | | | | | | | | * sly/render/model.scm (<model>): Add 'transform' and 'children' fields. (model-transform, model-children): New accessors. (make-model): Add 'transform' and 'children' keyword arguments. (set-transform-identity!): New procedure. (draw-model): Recursively draw model and all children. (model-paint, model-blend): Renamed. (paint, blend, group, group*, move, place): New procedures. * sly/render/group.scm: Delete. * Makefile.am (SOURCES): Remove it. * examples/2048/2048.scm: Update example. * examples/animation.scm: Likewise. * examples/font.scm: Likewise. * examples/joystick.scm: Likewise. * examples/mines/mines.scm: Likewise. * examples/simple.scm: Likewise. * examples/tilemap.scm: Likewise. * README.org (Example): Update sample code.
* signals: Add signal-timer.David Thompson2015-03-092-1/+11
| | | | | * sly/signal.scm (signal-timer): New procedure. * doc/api/signals.texi: Document it.
* render: mesh: Add null-mesh.David Thompson2015-03-082-1/+3
| | | | | * sly/render/mesh.scm (null-mesh): New variable. * sly/render/context.scm (render-context-reset!): Reset to null-mesh.
* render: texture: Add null-texture.David Thompson2015-03-082-1/+4
| | | | | * sly/render/texture.scm (null-texture): New variable. * sly/render/context.scm (render-context-reset!): Reset to null-texture.
* render: mesh: Rewrite constructors and expose vertex buffers.David Thompson2015-01-264-116/+143
| | | | | | | | | | | | | | | | | * sly/rener/mesh.scm (vertex-buffer-attribute-size): Reimplement. (type-size): New procedure. (with-vertex-buffer): Unbind buffer when done. (init-vertex-buffer-data!): New procedure. (make-vertex-buffer*): Remove. (bytevector->vertex-buffer, vector->vertex-buffer): New procedures. (make-vertex-buffer): Implement in terms of 'bytevector->vertex-buffer'. (make-mesh): Change to accept pre-built vertex buffers. (build-mesh, mesh-ref): New procedures. (mesh-guadian): Destructure vertex buffer alist. * sly/render/shape.scm (make-cube): Use 'build-mesh'. * sly/render/sprite.scm (make-sprite): Likewise. * sly/render/tile-map.scm (compile-tile-layer): Likewise.
* render: mesh: Generalize <mesh> type to support streaming data.David Thompson2015-01-261-41/+74
| | | | | | | | | | | | | | | | * sly/render/mesh.scm (<mesh) [attr-size, length]: Remove fields. [usage]: Add field. (vertex-buffer-attr-size): Delete. (vertex-buffer-attribute-size): New procedure. (vertex-attrib-pointer): Use it. (vertex-buffer-length): Reimplement. (vertex-buffer-target, vertex-buffer-usage-gl, index-buffer?, attribute-type): New procedures. (bind-vertex-buffer): Use it. (with-vertex-buffer): Don't unbind buffer (one less context change). (make-vertex-buffer*): New procedure. (make-vertex-buffer): Use it. (make-mesh): Add index buffer to mesh VBO list.
* render: mesh: Support streaming vertex buffers.David Thompson2015-01-261-3/+6
| | | | * sly/render/mesh.scm (make-vertex-buffer): Add 'stream?' argument.
* render: mesh: Add data field.David Thompson2015-01-261-7/+9
| | | | * sly/render/mesh.scm (<mesh>) [data]: New field.
* render: context: Reset state after rendering.David Thompson2015-01-261-1/+3
| | | | | | | | Fixes state pollution issues where GL objects remained bound after rendering. * sly/render/context.scm (with-render-context): Call 'render-context-reset!' after evaluating the body.
* render: tileset: Add tileset-invert-index.David Thompson2015-01-241-1/+11
| | | | * sly/render/tileset.scm (tileset-invert-index): New procedure.
* render: tileset: Add rows and columns fields.David Thompson2015-01-241-14/+20
| | | | | | | * sly/render/tileset.scm (<tileset>) [rows, columns]: New fields. (tileset-rows, tileset-columns): New procedures. (split-texture): Return rows and columns. (make-tileset, load-tileset): Use new constructor.