Constructor

new(w:Int, h:Int, layers:Int, ?flags:Array<TextureFlags>, ?format:Null<TextureFormat>)

Methods

Inherited Variables

Defined by Texture

@:value(0.)depthBias:Float = 0.

depthBuffer:Texture

When the texture is used as render target, tells which depth buffer will be used. If set to null, depth testing is disabled.

@:value(false)depthClamp:Bool = false

read onlyflags:EnumFlags<TextureFlags>

read onlyheight:Int

read onlyid:Int

read onlylayerCount:Int

@:value(0.)lodBias:Float = 0.

read onlymipLevels:Int

read onlyname:String

realloc:() ‑> Void

If this callback is set, the texture can be re-allocated when the 3D context has been lost or when it's been free because of lack of memory.

@:value(0.)slopeScaledBias:Float = 0.

@:value(0)startingMip:Int = 0

read onlywidth:Int

Inherited Methods

Defined by Texture

alloc():Void

@:value({ mipLevel : 0, face : 0 })capturePixels(face:Int = 0, mipLevel:Int = 0, ?region:IBounds):Pixels

Downloads the current texture data from the GPU. Beware, this is a very slow operation that shouldn't be done during rendering.

@:value({ layer : -1, alpha : 1. })clear(color:Int, alpha:Float = 1., layer:Int = -1):Void

@:value({ layer : -1, a : 0., b : 0., g : 0., r : 0. })clearF(r:Float = 0., g:Float = 0., b:Float = 0., a:Float = 0., layer:Int = -1):Void

dispose():Void

hasStencil():Bool

isDepth():Bool

inlineisDisposed():Bool

isSRGB():Bool

preventAutoDispose():Void

In case of out of GPU memory, textures that hasn't been used for a long time will be disposed. Calling this will make this texture not considered for auto disposal.

resize(width:Int, height:Int):Void

setName(n:String):Void

@:value({ layer : 0, mipLevel : 0 })uploadBitmap(bmp:BitmapData, mipLevel:Int = 0, layer:Int = 0):Void

@:value({ layer : 0, mipLevel : 0 })uploadPixels(pixels:Pixels, mipLevel:Int = 0, layer:Int = 0):Void

waitLoad(f:() ‑> Void):Void

Some textures might take some time to load. You can check flags.has(Loading) or add a waitLoad callback which will get called either immediately if the texture is already loaded or when loading is complete.