lowgl-0.2.1.1: Basic gl wrapper and reference

Safe HaskellNone
LanguageHaskell2010

Graphics.GL.Low.Texture

Synopsis

Documentation

data Tex2D a Source

A 2D texture. A program can sample a texture if it has been bound to the appropriate texture unit.

Instances

data CubeMap a Source

A cubemap texture is just six 2D textures. A program can sample a cubemap texture if it has been bound to the appropriate texture unit.

Instances

data Filtering Source

Texture filtering modes.

Constructors

Nearest

No interpolation.

Linear

Linear interpolation.

data Wrapping Source

Texture wrapping modes.

Constructors

Repeat

Tile the texture past the boundary.

MirroredRepeat

Tile the texture but mirror every other tile.

ClampToEdge

Use the edge color for anything past the boundary.

data Dimensions Source

The size of an image in pixels.

Constructors

Dimensions 

Fields

imageWidth :: Int
 
imageHeight :: Int
 

Instances

newTexture2D :: InternalFormat a => Vector Word8 -> Dimensions -> IO (Tex2D a) Source

Create a new 2D texture from a blob and its image format. Dimensions should be powers of two.

deleteTexture :: Texture a => a -> IO () Source

Delete a texture.

newCubeMap :: InternalFormat a => Cube (Vector Word8, Dimensions) -> IO (CubeMap a) Source

Create a new cube map texture from six blobs and their respective formats. Dimensions should be powers of two.

newEmptyTexture2D :: InternalFormat a => Int -> Int -> IO (Tex2D a) Source

Create an empty texture with the specified dimensions and format.

newEmptyCubeMap :: InternalFormat a => Int -> Int -> IO (CubeMap a) Source

Create a cubemap texture where each of the six sides has the specified dimensions and format.

bindTexture2D :: Tex2D a -> IO () Source

Bind a 2D texture to the 2D texture binding target and the currently active texture unit.

bindTextureCubeMap :: CubeMap a -> IO () Source

Bind a cubemap texture to the cubemap texture binding target and the currently active texture unit.

setActiveTextureUnit :: Enum a => a -> IO () Source

Set the active texture unit. The default is zero.

setTex2DFiltering :: Filtering -> IO () Source

Set the filtering for the 2D texture currently bound to the 2D texture binding target.

setCubeMapFiltering :: Filtering -> IO () Source

Set the filtering for the cubemap texture currently bound to the cubemap texture binding target.

setTex2DWrapping :: Wrapping -> IO () Source

Set the wrapping mode for the 2D texture currently bound to the 2D texture binding target.

setCubeMapWrapping :: Wrapping -> IO () Source

Set the wrapping mode for the cubemap texture currently bound to the cubemap texture binding target. Because no blending occurs between cube faces you probably want ClampToEdge.