Macaw OS C reference

Function gpu_buffer

#include <macawgpu.h>
int gpu_buffer(const float *numbers, int count, const char *layout);

Makes a vertex buffer: a list of corners kept ready to draw.

Parameters

numbersconst float *
An array of floats, corner after corner, each with the numbers its layout lists, in that order.
countint
How many floats there are in all, a whole number of corners.
layoutconst char *
What each corner has: p position (3), t texture place (2), n normal (3), c colour (1), l light baked in (1, where 1 is lit as usual). It needs a p. NULL means "p".

Returns int

The buffer's number. It's an error if count isn't a whole number of corners.

In Buffers, with gpu_bufferset, gpu_buffercount, gpu_freebuffer, gpu_indices, gpu_freeindices, gpu_drawarrays, gpu_drawelements.