Package: graphene

Macro graphene:with-vec2

Lambda List

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

Syntax

(graphene:with-vec2 (v) body) => result
(graphene:with-vec2 (v v1) body) => result
(graphene:with-vec2 (v x y) body) => result

Arguments

v -- a graphene:vec2-t instance to create and initialize
v1 -- 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

Details

The graphene:with-vec2 macro allocates a new graphene:vec2-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:vec2-init-from-vec2 function. The initialization with two values x and y uses the graphene:vec2-init function.

Note

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

See also

2024-12-26