natiny_camera_bind

C
void natiny_camera_bind(NatinyCamera cam);

Binds a camera. All subsequent 3D draw calls use this camera until it is unbound or another one is bound. Zero means no camera.

Parameters

Name Type Description
cam NatinyCamera Camera handle from natiny_camera_create, or 0 for none

Example

C
natiny_camera_bind(cam);
draw_scene();
natiny_camera_unbind();

Notes

  • Binding another camera replaces the current one. natiny_camera_unbind is equivalent to binding 0; it does not restore the previous camera.
  • Bind the camera after the target it draws into: the projection is built against the current target's aspect ratio.
  • A surface bind starts with no camera. Its matching unbind restores the suspended camera matrices; see The bind stack.