natiny.render.viewport_end

Lua
natiny.render.viewport_end()

Ends the current viewport and restores the full window or surface render target as the local drawing area.

Example

Lua
natiny.render.viewport_begin(0, 0, 320, 180)
draw_scene()
natiny.render.viewport_end()

Notes

  • Calling this function when no viewport is active has no effect.
  • Ending a viewport clears its scissor stack and restores the render target's dimensions for 2D drawing, natiny.render.cover(), and cameras bound afterwards.