EN
Данное содержимое не доступно на вашем языке, используйте версию на английском языке.

renderbufferStorage method

Creates or replaces the data store for the currently bound WebGLRenderbuffer object.

IE11

 

Syntax

WebGLRenderingContext.renderbufferStorage(target, internalformat, width, height);

Parameters

target [in]

Type: Number

Target must be the constant gl.RENDERBUFFER.

internalformat [in]

Type: Number

One of the following values:

ValueMeaning
gl.RGBA4

RGBA with 4 bits per channel

gl.RGB565

RGB value with 5 bits red, 6 bits green, and 5 bits blue respectively.

gl.RGB5_A1

RGBA value with 5 bits for RGB and 1 bit for Alpha.

gl.DEPTH_COMPONENT16

16 bit Depth component.

 

width [in]

Type: Number

Width of the render buffer in pixels.

height [in]

Type: Number

Height of the render buffer in pixels.

Return value

This method does not return a value.

Remarks

WebGL errorDescription
gl.INVALID_ENUM
  • If target is not gl.RENDERBUFFER.
  • If internal format is not one of the listed formats.
gl.INVALID_VALUE If width and height are greater than gl.MAX_RENDERBUFFER_SIZE or less than zero.
gl.INVALID_OPERATIONThe renderbuffer object isn't bound to a gl.RENDERBUFFER object.
gl.OUT_OF_MEMORYThe data store couldn't be generated with the supplied width and height.

 

See also

WebGLRenderingContext

 

 

Показ:
© 2014 Microsoft