summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2023-01-22 19:48:04 -0500
committerDavid Thompson <dthompson2@worcester.edu>2023-06-08 08:14:41 -0400
commite113d0c462811518e0b45159ec97503e878b329c (patch)
treea9bf54b0cad856a25d61dedab55ad337c1f48cae
parent361e58647b287f7898d750b9c3113acb4cb9e329 (diff)
Overload vec3/vec4 constructors.
-rw-r--r--chickadee/graphics/seagull.scm24
1 files changed, 20 insertions, 4 deletions
diff --git a/chickadee/graphics/seagull.scm b/chickadee/graphics/seagull.scm
index 9403f37..023223b 100644
--- a/chickadee/graphics/seagull.scm
+++ b/chickadee/graphics/seagull.scm
@@ -760,12 +760,28 @@
(list vec2-type))))
(define make-vec3-type
- (list (function-type (list float-type float-type float-type)
- (list vec3-type))))
+ (list (overload-type
+ (function-type (list float-type float-type float-type)
+ (list vec3-type))
+ (function-type (list vec2-type float-type)
+ (list vec3-type))
+ (function-type (list float-type vec2-type)
+ (list vec3-type)))))
(define make-vec4-type
- (list (function-type (list float-type float-type float-type float-type)
- (list vec4-type))))
+ (list (overload-type
+ (function-type (list float-type float-type float-type float-type)
+ (list vec4-type))
+ (function-type (list vec2-type float-type float-type)
+ (list vec4-type))
+ (function-type (list float-type vec2-type float-type)
+ (list vec4-type))
+ (function-type (list float-type float-type vec2-type)
+ (list vec4-type))
+ (function-type (list vec3-type float-type)
+ (list vec4-type))
+ (function-type (list float-type vec3-type)
+ (list vec4-type)))))
(define (top-level-type-env)
`((+ . ,add/sub-type)