Macaw OS C reference

Module Water

#include <macawlevel.h>

In Brushwork you can make brushes into water. Water isn't solid, and its top is a surface that reflects. A built level has a list of water surfaces, which you draw after the level. Each needs its reflection drawn first, with waterreflect, or baked once with waterbake.

Functions

watercount
Tells you how many water surfaces a level has to draw: those built from its water brushes, and any you've added with newwater.
newwater
Adds a water surface of your own: a flat rectangle at a height.
waterinfo
Gives where a water surface is.
waterreflect
Draws a water's live reflection: the level is drawn again from a camera mirrored under the water, into the water's own picture.
waterdraw
Draws a water surface, with ripples and its reflection mixed in.
waterbake
Bakes a water's reflection once, so it doesn't have to be drawn every frame.
waterbaked
Tells you whether a water's reflection has been baked.
waterreflections
Turns a water's reflection on or off, or asks whether it's on.
watercamera
Points the graphics chip's camera the same way as camera3d, so gpu_ drawing in a reflection lines up with the level.