Static variables
Static methods
staticfromColor(color:Int, alpha:Float = 1.):Null<Texture>
Creates a 1x1 texture using the RGB color passed as parameter.
staticgetCubeFaceMatrix(face:Int):Matrix
Returns the matrix transforming vec3(uv * 2 - 1, 1) into the direction of the given cube face.
The matrix is shared and must not be modified.
staticgetDefaultDepth():Texture
This will return the default depth buffer, which is automatically resized to the screen size.
Constructor
Variables
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.
read onlyresidentMip:Int = 0
The most detailed mip level allocated on the GPU : mip levels before it are not allocated, and the texture is sampled starting at this level.
read onlyvisibleFrame:Int = -1
For a Streamed texture, the last frame (hxd.Timer.frameCount) in which the texture was visible, see markVisible.
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.
Methods
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.
inlinemarkVisible():Void
Records that the texture is used by something visible during the current frame. Streamed textures that are not visible lose mip levels when the streaming budget is exceeded (see hxd.res.TextureStream).
preventAutoDispose():Void
In case we run 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.
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.
