summaryrefslogtreecommitdiff
path: root/sly/render.scm
Commit message (Collapse)AuthorAgeFilesLines
* render: Add alpha value to render context.David Thompson2016-01-121-1/+4
| | | | | | | | | 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.
* render: Add render/signal macro.David Thompson2016-01-021-1/+9
| | | | * sly/render.scm (render/signal): New syntax.
* Upgrade to SDL2!David Thompson2015-12-221-8/+5
| | | | | | 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!
* render: shader: Rename <shader-program> to <shader>.David Thompson2015-11-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * sly/render.scm * sly/render/model.scm (null-model): Use 'null-shader'. * sly/render/shader.scm (<shader-stage>): Rename to <shader>. (<shader-program>): Rename to <shader>. (vertex-shader?, fragment-shader?): Rename to... (vertex-shader-stage?, fragment-shader-stage?): ...these. (shader-stage-guardian): New variable. (%shader-compiled?, shader-compiled?): Rename to... (%shader-stage-compiled?, shader-stage-compiled?): ...these. (display-compilation-error): Change 'shader' to 'stage'. (compile-shader, set-shader-source, make-shader, make-vertex-shader) (make-fragment-shader, load-shader, load-vertex-shader, load-fragment-shader): Rename to... (compile-shader-stage, set-shader-stage-source, make-shader-stage) (make-vertex-shader-stage, make-fragment-shader-stage) (load-shader-stage, load-vertex-shader-stage) (load-fragment-shader-stage): ...these. (shader-program-uniform-location, shader-program-linked?) (make-shader-program, load-shader-program, null-shader-program) (apply-shader-program): Rename to... (shader-uniform-location, shader-linked?, make-shader, load-shader) (null-shader, apply-shader): ...these. (with-shader): Delete. (uniform-set!): Change 'shader-program' argument to 'shader'. (%default-shader): Use 'load-shader'.
* render: Add more rotation combinators.David Thompson2015-11-091-0/+18
| | | | * sly/render.scm (rotate-x, rotate-y, rotate): New procedures.
* render: Export additional procedures.David Thompson2015-11-091-1/+8
|
* render: Reimplement rendering engine using functional combinators.David Thompson2015-09-211-48/+325
| | | | | | | | | | | 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.
* render: Add separate projection and model-view matrix stacks.David Thompson2015-09-091-13/+31
| | | | | | | | | | | | | | | Just like the Opengl 2.x days! ;) * sly/render.scm (graphics-transform, graphics-transform-mul!, graphics-transform-identity!): Delete. (graphics-model-view-transform, graphics-model-view-mul!, graphics-model-view-identity!, graphics-projection-transform, graphics-projection-mul!, graphics-projection-identity!): New procedures. (with-model-view-excursion, with-projection-excursion): New syntax. (call-with-transform-excursion): Move matrix copying out of the "in guard." (draw-scene): Use new matrix stacks.
* render: Force OpenGL state changes when resetting context.David Thompson2015-09-091-7/+7
| | | | * sly/render.scm (graphics-reset!): Force context changes.
* render: Reset OpenGL state after drawing a frame.David Thompson2015-09-091-1/+4
| | | | | | | | 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.
* render: Reimplement OpenGL state machine manager.David Thompson2015-08-261-0/+206
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.