API/core/Texture/

Texture

The base class of texture, contains some common functions of texture-related classes.

Hierarchy: RefObject

constructor 

new Texture(engine: Engine)

Parameters

  • engine

instanceId ReadOnly

instanceId: number = ++EngineObject._instanceIdCounter

Engine unique id.

isGCIgnored 

isGCIgnored: boolean = false

Whether to ignore the garbage collection check, if it is true, it will not be affected by ResourceManager.gc().

name 

name: string

anisoLevel 

get anisoLevel(): number

Anisotropic level for texture.

set anisoLevel(number): void

destroyed 

get destroyed(): boolean

Whether it has been destroyed.

engine 

get engine(): Engine

Get the engine which the object belongs.

filterMode 

get filterMode(): TextureFilterMode

Filter mode for texture.

set filterMode(TextureFilterMode): void

height 

get height(): number

The height of the texture.

mipmapCount 

get mipmapCount(): number

Texture mipmapping count.

refCount 

get refCount(): number

Counted by valid references.

width 

get width(): number

The width of the texture.

wrapModeU 

get wrapModeU(): TextureWrapMode

Wrapping mode for texture coordinate S.

set wrapModeU(TextureWrapMode): void

wrapModeV 

get wrapModeV(): TextureWrapMode

Wrapping mode for texture coordinate T.

set wrapModeV(TextureWrapMode): void

destroy 

destroy(force: boolean): boolean

Destroy self.

Parameters

  • force

    Whether to force the destruction, if it is fasle, refCount = 0 can be released successfully.

Returns

Whether the release was successful.

generateMipmaps 

generateMipmaps(): void

Generate multi-level textures based on the 0th level data.