Method

CoglFramebufferset_viewport

Declaration [src]

void
cogl_framebuffer_set_viewport (
  CoglFramebuffer* framebuffer,
  float x,
  float y,
  float width,
  float height
)

Description [src]

Defines a scale and offset for everything rendered relative to the top-left of the destination framebuffer.

By default the viewport has an origin of (0,0) and width and height that match the framebuffer’s size. Assuming a default projection and modelview matrix then you could translate the contents of a window down and right by leaving the viewport size unchanged by moving the offset to (10,10). The viewport coordinates are measured in pixels. If you left the x and y origin as (0,0) you could scale the windows contents down by specify and width and height that’s half the real size of the framebuffer.

Although the function takes floating point arguments, existing drivers only allow the use of integer values. In the future floating point values will be exposed via a checkable feature.

Parameters

x

Type: float

The top-left x coordinate of the viewport origin (only integers supported currently).

y

Type: float

The top-left y coordinate of the viewport origin (only integers supported currently).

width

Type: float

The width of the viewport (only integers supported currently).

height

Type: float

The height of the viewport (only integers supported currently).