Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
viewport
Collapse the table of content
Expand the table of content

viewport method

Represents a rectangular viewable area that contains the rendering results of the drawing buffer.

IE11

 

Syntax

WebGLRenderingContext.viewport(x, y, width, height);

Parameters

x [in]

Type: Number

The horizontal component of the viewport origin. Default is 0.

y [in]

Type: Number

The vertical component of the viewport origin. Default is 0.

width [in]

Type: Number

The width of the viewport. Default equals the width of the parent canvas (width).

height [in]

Type: Number

The height of the viewport. Default equals the height of the parent canvas (height).

Return value

This method does not return a value.

Remarks

WebGL errorDescription
gl.INVALID_VALUE If the width or height is negative.

 

See also

WebGLRenderingContext

 

 

Show:
© 2015 Microsoft