Package: graphene

Macro graphene:with-vec4

Lambda List

graphene:with-vec4 ((var &rest args) &body body)

Syntax

(graphene:with-vec4 (v) body) => result
(graphene:with-vec4 (v v1) body) => result
(graphene:with-vec4 (v v2 w) body) => result
(graphene:with-vec4 (v v3 z w) body) => result
(graphene:with-vec4 (v x y z w) body) => result

Arguments

v -- a graphene:vec4-t instance to create and initialize
v1 -- a graphene:vec4-t instance to use for initialization
v2 -- a graphene:vec3-t instance to use for initialization
v3 -- a graphene:vec2-t instance to use for initialization
x -- a number coerced to a float with the x component of the vector
y -- a number coerced to a float with the y component of the vector
z -- a number coerced to a float with the z component of the vector
w -- a number coerced to a float with the w component of the vector

Details

The graphene:with-vec4 macro allocates a new graphene:vec4-t instance, initializes the vector with the given values and executes the body that uses the vector. After execution of the body the allocated memory for the vector is released.

When no argument is given the components of the vector are initialized to zero. The initialization from another vector is done with the graphene:vec4-init-from-vec4 function. The initialization with two values uses the graphene:vec4-init-from-vec3 function and the initialization with three values values uses the graphene:vec4-init-from-vec2 function. At last, the graphene:vec4-init function initializes the vector from four values.

Note

The memory is allocated with the graphene:vec4-alloc function and released with the graphene:vec4-free function.
 

See also

2024-12-26