summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2023-09-25 08:36:54 -0400
committerDavid Thompson <dthompson2@worcester.edu>2023-11-08 21:35:34 -0500
commitac57fbe150e213389b4ef61b7a510a1fa8d5a093 (patch)
tree9c4e732b99c6d896e1a1fc6270aa88bfd7bd1ffd /examples
parent834b7d2e2d703bfa772c59f7384c35705afec6f2 (diff)
examples: triangle: Simplify by removing projection matrix.
Diffstat (limited to 'examples')
-rw-r--r--examples/triangle.scm11
1 files changed, 5 insertions, 6 deletions
diff --git a/examples/triangle.scm b/examples/triangle.scm
index 2debc85..945cbce 100644
--- a/examples/triangle.scm
+++ b/examples/triangle.scm
@@ -11,9 +11,9 @@
(define (load)
(define verts
- (make-buffer #f32(0.0 0.0
- 640.0 0.0
- 320.0 480.0)))
+ (make-buffer #f32(-1.0 -1.0
+ 1.0 -1.0
+ 0.0 1.0)))
(define colors
(make-buffer #f32(1.0 0.0 0.0 1.0
0.0 1.0 0.0 1.0
@@ -52,11 +52,10 @@ varying vec4 fragColor;
#else
out vec4 fragColor;
#endif
-uniform mat4 mvp;
void main(void) {
fragColor = color;
- gl_Position = mvp * vec4(position, 0.0, 1.0);
+ gl_Position = vec4(position, 0.0, 1.0);
}
"
"
@@ -79,6 +78,6 @@ void main (void) {
")))
(define (draw alpha)
- (shader-apply shader vertex-array #:mvp (current-projection)))
+ (shader-apply shader vertex-array))
(run-game #:load load #:draw draw)