| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The big consequence of this change to the rest of the codebase is that
we can no longer use record destructuring when pattern matching, so I
had to rewrite every place where pattern matching was used. It was
probably a bad idea to expose the record type descriptors publicly in
the first place.
* sly/math/vector.scm: Reimplement everything in terms of an f64 packed
bytevector record type. Do not expose record type descriptors.
* sly/game.scm (run-game-loop): Convert viewport width/height to exact
numbers.
* sly/window.scm (open-window): Likewise.
* sly/input/mouse.scm (mouse-position): Rewrite pattern matching.
* sly/math/quaternion (make-quaternion, vector->quaternion): Likewise.
* sly/math/rect.scm (rect-clamp): Likewise.
* sly/math/transform.scm (translate!, translate, scale): Likewise.
* sly/render/mesh.scm (vertices-bytevector): Likewise.
* examples/mines/mines.scm: Likewise.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Rather than each foreign resource type creating its own guardian, let's
just use one instead so that there is only a single guardian to talk to
each frame.
* sly/guardian.scm: New file.
* Makefile.am (SOURCES): Add it.
* sly/game.scm (run-game-loop): Start guardian worker.
* sly/render/mesh.scm (mesh-guardian): Delete.
(free-mesh): New procedure.
(make-mesh): Guard newly created meshes.
* sly/render/shader.scm (shader-stage-guardian): Delete.
(free-shader-stage): New procedure.
(make-shader-stage): Guard newly created shader stages.
(shader-guardian): Delete.
(free-shader): New procedure.
(make-shader): Guard newly created shaders.
* sly/render/texture.scm (texture-guardian): Delete.
(free-texture): New procedure.
(make-texture): Guard newly created textures.
|
|
|
|
| |
* sly/game.scm (on-start): New procedure.
|
|
|
|
|
| |
* sly/game.scm (game-start-hook, game-started?): New variables.
(run-game-loop): Run game-start-hook before loop starts.
|
|
|
|
|
|
|
|
| |
In practice this wasn't very noticeable, but it is a bad idea to lock
input event processing with the frame rate.
* sly/game.scm (run-game-loop): Process input events before each call to
'agenda-tick!'.
|
|
|
|
|
|
|
|
|
| |
Necessary for interpolating moving objects to avoid temporal aliasing.
* sly/render.scm (<graphics>)[alpha]: New field.
(graphics-alpha, set-graphics-alpha!): New procedure.
* sly/game.scm (run-game-loop): Set the frame's alpha value before each
render call.
|
|
|
|
|
|
| |
This commit is massive and crazy and I'm not going to do the usual GNU
ChangeLog thing because it's just too much. Let's just be happy that
the port is completed!
|
|
|
|
|
|
|
| |
Fixes a long standing annoyance that pressing C-c wouldn't kill the
application.
* sly/game.scm (run-game-loop): Catch SIGINT and call 'stop-game-loop'.
|
|
|
|
|
|
|
|
|
|
|
| |
Warning: This is a huge commit.
I completely gutted the old scene graph and replaced it with a somewhat
monadic rendering combinator module instead. The interface remains
purely functional, but replaces the <model> data type with procedures in
the rendering monad instead. This opens the door for
rendering *anything*, not just meshes. Now I can implement particle
systems and other non-static things.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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/game.scm (start-game-loop): Add 'scene' argument.
|
|
|
|
|
|
|
| |
* sly/agenda.scm (tick-agenda!, clear-agenda!): Rename.
(agenda-tick!, agenda-clear!): New procedures.
* sly/game.scm (start-game-loop): Use agenda-tick!.
* sly/repl.scm (start-sly-repl): Likewise.
|
|
|
|
|
| |
* sly/game.scm: Remove (sly camera) import.
* sly/scene.scm: Likewise.
|
|
|
|
|
| |
* sly/game.scm (start-game-loop): Just run the draw hook instead of
rendering a scene graph.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* .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'.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
| |
* sly/game.scm (start-game-loop): Support rendering a single camera
object instead of just a list of cameras.
|
| |
|
|
|
|
| |
* sly/game.scm (start-game-loop): Add cameras parameter.
|
|
|
|
|
| |
* 2d/game.scm (draw): Use window-size instead of window-width and
window-height.
|
|
|
|
|
|
| |
* sly/game.scm (after-game-loop-error-hook): New variable
(display-game-loop-error): New procedure.
(start-game-loop): Add error handling.
|
|
|
|
|
|
|
|
|
| |
* sly/game.scm (tick-interval, max-ticks-per-frame): Remove them.
(draw, update, alpha, frame-sleep): Move within start-game-loop
closure.
(interval): New procedure.
(start-game-loop): Add tick-rate, frame-rate, and max-ticks-per-frame
keyword arguments.
|
|
Massive find/replace job.
|