Class: Buffer

Buffer

new Buffer(gl, target, data, usage)

缓冲

Name Type Default Description
gl WebGLRenderingContext
target GLenum ARRAY_BUFFER optional
data TypedArray null optional
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

bufferData(data){Buffer}

上传数据

Name Type Description
data TypedArray
Returns:
Type Description
Buffer this

bufferSubData(byteOffset, data, isBinding){Buffer}

上传部分数据

Name Type Default Description
byteOffset Number
data TypedArray
isBinding Boolean false optional
Returns:
Type Description
Buffer this

uploadGeometryData(geometryData){Buffer}

Name Type Description
geometryData GeometryData
Returns:
Type Description
Buffer this

destroyIfNoRef(renderer){Buffer}

没有被引用时销毁资源

Name Type Description
renderer WebGLRenderer
Returns:
Type Description
Buffer this

销毁资源

Returns:
Type Description
Buffer this