| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
| |
Not resetting the graphics context after rendering leads to strange bugs
such as sprites disappearing when a new mesh is created in between
drawing.
* sly/render.scm (with-graphics): Reset context after drawing.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The implementation is a bit cleaner, and it's a stepping stone towards
render combinators.
* sly/render/context.scm: Delete.
* sly/render.scm: New file.
* Makefile.am (SOURCES): Add it. Remove context.scm.
* sly/game.scm (run-game-loop): Use new <graphics> type.
* sly/render/model.scm (draw-model): Likewise.
* sly/render/scene.scm (draw-scene): Likewise.
* examples/2048/2048.scm: Remove (sly render context) import.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Guile's array procedures are slow, so switch to using raw bytevectors
instead. Additionally, converting the bytevector to a pointer is also
slow, so the pointer is now cached for redundant calls.
There's more to be done, but this was low hanging fruit.
* sly/math/transform.scm (<transform>)[ptr]: New field.
(transform-ptr): New accessor.
(set-transform-ptr!): New setter.
(make-4x4-matrix): Implement using bytevectors.
(matrix-set!, matrix-ref): New procedures.
(make-transform, transform-vector2, transform-position): Use
'matrix-set!' and 'matrix-ref'.
(transpose, transform+, transform*): Use new transform constructor.
(transform->pointer): Cache pointer.
* sly/render/context.scm (copy-transform!): Use 'bytevector-copy!'
* sly/render/shader.scm: Use 'transform->pointer' in the transform
uniform setter.
|
|
|
|
|
|
| |
Add the Gnu Scientific Library (GSL) to the dependencies and update the
git clone command for sly itself to the new address of the repository
(https://git.dthompson.us/sly.git), since gitorious is down.
|
|
|
|
| |
* package.scm: Change source to #f for now.
|
|
|
|
|
| |
* examples/life.scm: New file.
* examples/Makefile.am (nobase_dist_examples_DATA): Add it.
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
| |
* sly/signal.scm: Add comments specifying emacs indentation level for
signal-let and signal-let* syntax.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
| |
|
| |
|
| |
|
|
|
|
| |
* sly/signal.scm (signal-let, signal-let*): Reimplement.
|
|
|
|
| |
* sly/game.scm (start-game-loop): Add 'scene' argument.
|
|
|
|
| |
* sly/render/model.scm (model-scale): New procedure.
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
| |
* sly/render/context.scm (with-render-context-excursion): New syntax.
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
| |
* sly/render/framebuffer.scm (null-framebuffer): New variable.
(apply-framebuffer): New procedure.
(with-framebuffer): Delete.
|
|
|
|
| |
* sly/render/camera.scm (null-viewport): New variable.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
| |
* sly/render/texture.scm (texture-null?): New procedure.
|
| |
|
|
|
|
|
|
|
| |
* sandbox: Delete.
* .gitignore: Ignore it.
* sandbox.in: New file.
* configure.ac: Generate sandbox.
|
|
|
|
|
| |
* examples/2048/2048.scm: Use null-model
* examples/mines/mines.scm: Likewise.
|
|
|
|
|
|
| |
* sly/render/model.scm (null-model): New variable.
(model-null?): New procedure.
(draw-model): Test for null models.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
| |
* package.scm: Move native inputs where they belong. Add texinfo to
native inputs.
|
|
|
|
|
| |
* sly/window.scm (open-window): Throw error when 'SDL:set-video-mode'
fails.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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'.
|
|
|
|
| |
* sly/render/shader.scm (null-shader-program): New variable.
|
|
|
|
|
| |
* sly/render/texture.scm (apply-texture): Enable 2D textures before
binding texture.
|
|
|
|
| |
* sly/render/utils (apply-depth-test): New procedure.
|
|
|
|
|
| |
* sly/render/utils.scm (apply-blend-mode): Enable/disable blending when
necessary.
|
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
| |
* sly/render/utils.scm (draw): Delete.
|
|
|
|
| |
* examples/mines/mines.scm: Miscellaneous clean up.
|
|
|
|
|
| |
* sly/render/font.scm (make-label): Remove 'shader' keyword argument.
* sly/render/sprite.scm (make-sprite): Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
| |
* sly/signal.scm (signal-timer): New procedure.
* doc/api/signals.texi: Document it.
|
|
|
|
|
| |
* sly/render/mesh.scm (null-mesh): New variable.
* sly/render/context.scm (render-context-reset!): Reset to null-mesh.
|
|
|
|
|
| |
* sly/render/texture.scm (null-texture): New variable.
* sly/render/context.scm (render-context-reset!): Reset to null-texture.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|