Module OgamlGraphics.Texture.Cubemap

Cubemap textures

This module provides an abstraction of OpenGL's cubemap textures

type t
Cubemap texture
val create : (module RenderTarget.T with type t = 'a) -> 'a -> ?mipmaps:[ `AllEmpty | `Empty of int | `AllGenerated | `Generated of int | `None] -> positive_x:[< `File of string | `Image of Image.t | `Empty of OgamlMath.Vector2i.t] -> positive_y:[< `File of string | `Image of Image.t | `Empty of OgamlMath.Vector2i.t] -> positive_z:[< `File of string | `Image of Image.t | `Empty of OgamlMath.Vector2i.t] -> negative_x:[< `File of string | `Image of Image.t | `Empty of OgamlMath.Vector2i.t] -> negative_y:[< `File of string | `Image of Image.t | `Empty of OgamlMath.Vector2i.t] -> negative_z:[< `File of string | `Image of Image.t | `Empty of OgamlMath.Vector2i.t] -> unit -> t
Creates a cubemap texture from 6 textures, images or empty layers of a given dimension. Generates all mipmaps by default.
Raises Texture_error if the requested size exceeds the maximal texture size allowed by the context.
Also raises Texture_error if the 6 textures, images or empty layers do not have the same dimensions.
val size : t -> OgamlMath.Vector2i.t
Size of a face of a cubemap texture
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 mipmap_levels : t -> int
Returns the number of mipmap levels of a texture
val mipmap : t -> int -> CubemapMipmap.t
Returns a particular mipmap level of a texture
val face : t -> [ `PositiveX | `PositiveY | `PositiveZ | `NegativeX | `NegativeY | `NegativeZ] -> CubemapFace.t
Returns a particular face of a texture
val bind : t -> int -> unit
System only : binds the texture for drawing