natiny_surface_resize

C
void natiny_surface_resize(NatinySurface surface, uint32_t width, uint32_t height);

Replaces a surface's attachments with new attachments of the requested size.

Parameters

Name Type Description
surface NatinySurface Surface handle from natiny_surface_create
width uint32_t New surface width in pixels
height uint32_t New surface height in pixels

Example

C
natiny_surface_resize(surface, 1920, 1080);

Notes

  • The colour and depth texture handles do not change. Anything already given one of them - a material, a model part - keeps working and reads the resized attachment. Only the pixels are lost; redraw the surface.
  • An unchanged size is a no-op. Zero dimensions, an invalid handle or an unavailable graphics device are ignored.
  • If allocation fails, the surface is left at the size it already had and stays usable.