Macaw OS C reference

Function waterreflect

#include <macawlevel.h>
void waterreflect(
    int level,
    int i,
    const levelcam *cam,
    levelviewfn draw,
    void *user
);

Draws a water's live reflection: the level is drawn again from a camera mirrored under the water, into the water's own picture. Call it before you clear the screen and draw the scene, then waterdraw after. It does nothing if the water's reflections are off.

Parameters

levelint
The level the water's in.
iint
Which water, from 0.
camconst levelcam *
The camera you're looking from, a levelcam (see The structs).
drawlevelviewfn
Your function that draws the mirrored view, or NULL to draw just the level.
uservoid *
Any pointer you like, passed to draw as its user; NULL is fine.

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