Buffer

extern (C)
struct Buffer {}

Members

Variables

id
uint id;
Undocumented in source.

Detailed Description

sg buffer

vertex- and index-buffers

sg image

images used as textures and render-pass attachments sg_sampler sampler objects describing how a texture is sampled in a shader

sg shader

vertex- and fragment-shaders and shader interface information

sg pipeline

associated shader and vertex-layouts, and render states

sg attachments

a baked collection of render pass attachment images

Instead of pointers, resource creation functions return a 32-bit handle which uniquely identifies the resource object.

The 32-bit resource id is split into a 16-bit pool index in the lower bits, and a 16-bit 'generation counter' in the upper bits. The index allows fast pool lookups, and combined with the generation-counter it allows to detect 'dangling accesses' (trying to use an object which no longer exists, and its pool slot has been reused for a new object)

The resource ids are wrapped into a strongly-typed struct so that trying to pass an incompatible resource id is a compile error

Meta