Package: graphene

Macro graphene:with-rect

Lambda List

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

Syntax

(graphene:with-rect (rect) body) => result
(graphene:with-rect (rect src) body) => result
(graphene:with-rect (rect x y width height) body) => result

Arguments

rect -- a graphene:rect-t instance to create and initialize
src -- a graphene:rect-t instance to use for initialization
x -- a number coerced to a single float for the x coordinate
y -- a number coerced to a single float for the y coordinate
width -- a number coerced to a single float for the width
height -- a number coerced to a single float for the height

Details

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

When no argument is given the components of the rectangle are initialized to zero. The initialization with four single floats uses the graphene:rect-init function. The initialization from another rectangle is done with the graphene:rect-init-from-rect function.

Notes

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

See also

2025-4-3