The graphics chip
#include <macawgpu.h>#include <macawgpu.h> to talk to the 3D hardware from C. Call these from your program's _draw function: they draw into the window (or into the picture drawinto picked), and they work the way old OpenGL 1.x does. They're Lua's gpu.* calls with gpu_ in front, so The graphics chip has the ideas and examples, and C says how C programs work.
Modules
- State
gpu_enable,gpu_disable,gpu_isenabled,gpu_depthmask,gpu_cullface,gpu_frontfaceand more- Matrices
- A matrix is a grid of 16 numbers that moves, turns, grows or projects every corner you draw.
- Drawing a corner at a time
gpu_begin,gpu_color,gpu_colorex,gpu_texcoord,gpu_normal,gpu_vertexand more- Buffers
- A buffer keeps a model's corners, so you send them once and draw them each frame.
- Textures, light and fog
gpu_bindtexture,gpu_light,gpu_lightoff,gpu_ambient,gpu_shademodel,gpu_materialand more- Reflecting water
- To draw water that reflects: draw the scene into a picture from a camera mirrored in the water, draw the main scene, call
gpu_mask(1), draw the water's surface, callgpu_mask(0), then callgpu_water. - Baked reflections
- A cube map is six views from one place, drawn once, that water can reflect instead of a picture drawn again every frame.