Module OgamlGraphics.Texture.Texture2DArray

Represents arrays of 2D textures

This module provides an abstraction of OpenGL 2D texture arrays

type t
Type of a 2D texture array
val create : (module RenderTarget.T with type t = 'a) -> 'a -> ?mipmaps:[ `AllEmpty | `Empty of int | `AllGenerated | `Generated of int | `None] -> [< `File of string | `Image of Image.t | `Empty of OgamlMath.Vector2i.t] list -> t
Creates a texture array from a list of files, images, or empty layers of given dimensions. Generates all mipmaps by default for every layer by default.
Raises Texture_error if the requested size exceeds the maximal texture size allowed by the context.
Also raises Texture_error if the list of layers is empty, or if all the layers do not have the same dimensions.
val size : t -> OgamlMath.Vector3i.t
Returns the size of a texture array
val minify : t -> MinifyFilter.t -> unit
Sets the minifying filter of a texture. Defaults as LinearMipmapLinear.
val magnify : t -> MagnifyFilter.t -> unit
Sets the magnifying filter of a texture. Defaults as Linear.
val wrap : t -> WrapFunction.t -> unit
Sets the wrapping function of a texture. Defaults as ClampEdge.
val layers : t -> int
Returns the number of layers of a texture. Equivalent to (size tex).z
val mipmap_levels : t -> int
Returns the number of mipmap levels of a texture.
val layer : t -> int -> Texture2DArrayLayer.t
Returns a particular layer of a texture array. Raises Invalid_argument if the layer does not exist.
val mipmap : t -> int -> Texture2DArrayMipmap.t
Returns a particular mipmap of a texture array. Raises Invalid_argument if the mipmap level does not exist.