Skip to content

raylib.rlViewport

JoeStrout edited this page Apr 29, 2026 · 2 revisions

Set the viewport area (transformation from normalized device coordinates to window coordinates)

Parameters

Parameter Default Value Note
x
y
width
height

Return value

None.

Notes

Example

// Draw to the left half of the screen
raylib.rlViewport 0, 0, 400, 600
// Draw to the right half of the screen
raylib.rlViewport 400, 0, 400, 600
// Restore full viewport
raylib.rlViewport 0, 0, 800, 600

Clone this wiki locally