Class: Buffer

Buffer

new Buffer(gl, target, data, usage)

缓冲

Name Type Default Description
gl WebGLRenderingContext
target GLenum ARRAY_BUFFER optional
data TypedArray
usage GLenum STATIC_DRAW optional

Members Show Inherited

Name Type Default Description
className String Buffer
isBuffer Boolean true
id String

id

target GLenum

target

usage GLenum

usage

buffer WebGLBuffer

buffer

static,readonlyBuffer.cache

缓存

Methods Show Inherited

staticBuffer.reset()

重置缓存

staticBuffer.createVertexBuffer(gl, geometryData, usage){Buffer}

生成顶点缓冲

Name Type Default Description
gl WebGLRenderingContext
geometryData GeometryData
usage GLenum STATIC_DRAW optional
Returns:
Type Description
Buffer

staticBuffer.createIndexBuffer(gl, geometryData, usage){Buffer}

生成索引缓冲

Name Type Default Description
gl WebGLRenderingContext
geometryData GeometryData
usage GLenum STATIC_DRAW optional
Returns:
Type Description
Buffer

绑定

Returns:
Type Description
Buffer this

upload(data, offset){Buffer}

上传数据

Name Type Default Description
data TypedArray
offset Number 0 optional

偏移值

Returns:
Type Description
Buffer this

destroyIfNoRef(renderer){Buffer}

没有被引用时销毁资源

Name Type Description
renderer WebGLRenderer
Returns:
Type Description
Buffer this

销毁资源

Returns:
Type Description
Buffer this