diff options
author | David Thompson <dthompson2@worcester.edu> | 2017-03-31 15:14:30 -0400 |
---|---|---|
committer | David Thompson <dthompson2@worcester.edu> | 2017-03-31 15:23:41 -0400 |
commit | 8152ddc9e677dcf9bf553d5b9a95148ff48cc17c (patch) | |
tree | c1537424bedc9dc1a26c821975f7414f603f676e /chickadee/render/sprite.scm | |
parent | 4ba1a03337ec50e3fabe0f50c76fcbfc458f3abf (diff) |
render: texture: Support using 32 texture units.
* chickadee/render/texture.scm (make-apply-texture, texture-ref,
texture-set!): New procedures.
(*texture-states*): New variable.
(apply-texture, *texture-state*): Delete.
(make-texture): Use 'vector-set!'
* chickadee/render/shader.scm: Export 'uniform-type'.
(default-uniform-value): Remove 'sampler-2d' case.
(extract-uniforms): Handle sampler-2d uniforms specially.
* chickadee/render.scm (current-texture): Add 'i' argument.
(with-texture): Add 'n' argument.
(gpu-apply*): Set textures for all texture units.
* .dir-locals.el: Update indentation rules for 'with-texture'.
Diffstat (limited to 'chickadee/render/sprite.scm')
-rw-r--r-- | chickadee/render/sprite.scm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/chickadee/render/sprite.scm b/chickadee/render/sprite.scm index 318a8a5..1ea4dda 100644 --- a/chickadee/render/sprite.scm +++ b/chickadee/render/sprite.scm @@ -114,7 +114,7 @@ void main (void) { (matrix4-mult! mvp mvp tmp-matrix) (matrix4-mult! mvp mvp (current-projection)) (with-blend-mode blend-mode - (with-texture texture + (with-texture 0 texture (gpu-apply shader (force vertex-array) #:mvp mvp)))))) @@ -192,7 +192,7 @@ void main (void) { "Render the contents of BATCH and clear the cache." (unless (zero? (sprite-batch-size batch)) (with-blend-mode (sprite-batch-blend-mode batch) - (with-texture (sprite-batch-texture batch) + (with-texture 0 (sprite-batch-texture batch) (unmap-vertex-buffer! (sprite-batch-index-buffer batch)) (unmap-vertex-buffer! (sprite-batch-position-buffer batch)) (unmap-vertex-buffer! (sprite-batch-texture-buffer batch)) |