Macaw OS C reference

Function gpu_envpixels

#include <macawgpu.h>
int gpu_envpixels(int env, void *buf, int size, int *across);

Copies a cube map's six faces out as bytes, so you can save them and make it again with gpu_envmapbytes. Call it with buf NULL first to find out how big a buffer you need.

Parameters

envint
The cube map, from gpu_envmap.
bufvoid *
A buffer for the bytes: blue, green, red for each texel (texture pixel), face by face, top row first. NULL copies nothing.
sizeint
How many bytes buf holds. It copies no more than that.
acrossint *
Pass the address of an int for how many texels across each face is. NULL skips it.

Returns int

How many bytes there are in all, or 0 if there are none.

In Baked reflections, with gpu_envmap, gpu_envmapbytes, gpu_envloaded, gpu_envunload, gpu_freeenvmap.