Next: Rendering Engine, Previous: Framebuffers, Up: Graphics [Contents][Index]
A viewport represents a subset of the screen (or framebuffer). When
rendering a frame, the resulting image will only appear within that
viewport. These aren’t often needed, and Chickadee’s default viewport
occupies the entire screen, but there are certain situations where
they are useful. For example, a split-screen multiplayer game may
render to two different viewports, each occupying a different half of
the screen. For information about how to set the current viewport,
see with-viewport
in Rendering Engine.
The (chickadee render viewport)
module provides the following
API:
Create a viewport that covers an area of the window starting from
coordinates (x, y) and spanning width x
height pixels. Fill the viewport with clear-color when
clearing the screen. Clear the buffers denoted by the list of symbols
in clear-flags.
Possible values for clear-flags are color-buffer, depth-buffer, accum-buffer, and stencil-buffer.
Return #t
if obj is a viewport.
Return the left edge of viewport.
Return the bottom edge of viewport.
Return the width of viewport.
Return the height of viewport.
Return the clear color for viewport.
Return the list of clear flags for viewport.