Skip to main content

Crate opencsg_sys

Crate opencsg_sys 

Source
Expand description

FFI bindings to OpenCSG (image-based CSG rendering for OpenGL).

OpenCSG renders CSG (Constructive Solid Geometry) results directly into the OpenGL depth buffer using the Goldfeather or SCS algorithms. After calling render, re-render the primitives with GL_EQUAL depth test to shade them.

Structs§

OcsgPrimitive
Opaque handle to an OpenCSG primitive.

Constants§

ALGORITHM_AUTOMATIC
Algorithm: automatic selection based on primitive properties.
ALGORITHM_GOLDFEATHER
Algorithm: Goldfeather (robust, handles concave primitives).
ALGORITHM_SCS
Algorithm: SCS (fast, convex primitives only).
INTERSECTION
Operation: the primitive is intersected into the CSG product.
OPTION_ALGORITHM
Option: which CSG algorithm to use.
OPTION_DEPTH_COMPLEXITY
Option: depth complexity sampling strategy.
OPTION_OFFSCREEN
Option: offscreen buffer type.
SUBTRACTION
Operation: the primitive is subtracted from the CSG product.

Functions§

free_resources
Release OpenGL resources allocated by OpenCSG for the current context.
init_gl
Initialize OpenCSG’s internal GL loader. Call once after GL context is current.
opencsg_free_resources
opencsg_init_gl
opencsg_primitive_free
opencsg_primitive_new
opencsg_primitive_set_bounding_box
opencsg_render_primitives
opencsg_set_option
primitive_free
Free an OpenCSG primitive.
primitive_new
Create a new OpenCSG primitive.
primitive_set_bbox
Set the bounding box on a primitive (normalized device coordinates).
render
Perform CSG rendering on a list of primitive pointers.
set_option
Set an OpenCSG option (algorithm, depth complexity, offscreen type).

Type Aliases§

RenderFn
C callback type for rendering a primitive’s geometry.