Macaw OS C reference

Function waterbake

#include <macawlevel.h>
int waterbake(int level, int i, levelviewfn draw, void *user);

Bakes a water's reflection once, so it doesn't have to be drawn every frame. Each call draws one of six views from just above the middle of the water; keep calling it until it returns 1. Things that move won't show in a baked reflection.

Parameters

levelint
The level the water's in.
iint
Which water, from 0.
drawlevelviewfn
Your function that draws each view, or NULL to draw just the level.
uservoid *
Any pointer you like, passed to draw as its user; NULL is fine.

Returns int

1 once it's done (or once it's clear it can't be baked), or 0 while there are views left.

In Water, with watercount, newwater, waterinfo, waterreflect, waterdraw, waterbaked, waterreflections, watercamera.