Class: Resource<T>
Type parameters
Name | Type |
---|---|
T | extends ResourceOptions |
Hierarchy
-
default
↳
Resource
↳↳
RenderBuffer
↳↳
RenderTarget
↳↳
Program
↳↳
Texture
Table of contents
Constructors
Properties
Accessors
Methods
Constructors
constructor
• new Resource<T
>(renderer
, options?
): Resource
<T
>
Type parameters
Name | Type |
---|---|
T | extends ResourceOptions |
Parameters
Name | Type |
---|---|
renderer | Renderer |
options | Partial <T > |
Returns
Resource
<T
>
Overrides
Base.constructor
Defined in
Properties
renderer
• renderer: Renderer
Inherited from
Base.renderer
Defined in
id
• id: string
Defined in
name
• name: WithUndef
<string
>
Defined in
userData
• userData: any
Defined in
byteLength
• byteLength: number
Defined in
options
• options: Partial
<T
>
Defined in
Accessors
gl
• get
gl(): WebGLRenderingContext
| WebGL2RenderingContext
获取 webgl
实例
Returns
WebGLRenderingContext
| WebGL2RenderingContext
Inherited from
Base.gl
Defined in
rendererState
• get
rendererState(): State
获取渲染状态
Returns
Inherited from
Base.rendererState
Defined in
handle
• get
handle(): any
Returns
any
Defined in
Methods
swapHandle
▸ swapHandle(handle
): void
交换为新的 handle
(一般我们会用在虚拟 webgl 环境中)
Parameters
Name | Type |
---|---|
handle | any |
Returns
void
Defined in
restoreHandle
▸ restoreHandle(): void
恢复为原有 handle
Returns
void
Defined in
destroy
▸ destroy(): void
销毁相关资源
Returns
void
Defined in
delete
▸ delete(«destructured»?
): Resource
<T
>
Parameters
Name | Type | Default value |
---|---|---|
«destructured» | Object | {} |
› deleteChildren | undefined | boolean | false |
Returns
Resource
<T
>
Defined in
bind
▸ bind(funcOrHandle?
): void
Parameters
Name | Type |
---|---|
funcOrHandle | any |
Returns
void
Defined in
unbind
▸ unbind(): void
Returns
void
Defined in
removeStats
▸ removeStats(): void
Returns
void
Defined in
createHandle
▸ createHandle(): void
Returns
void
Defined in
deleteHandle
▸ deleteHandle(): void
Returns
void
Defined in
toString
▸ toString(): string
Returns
string