lowgl-0.2.0.0: Basic gl wrapper and reference

Safe HaskellNone
LanguageHaskell2010

Graphics.GL.Low.Texture

Synopsis

Documentation

data Tex2D a

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

Instances

data CubeMap a

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

Texture filtering modes.

Constructors

Nearest

No interpolation.

Linear

Linear interpolation.

data Wrapping

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

The size of an image in pixels.

Constructors

Dimensions 

Fields

imageWidth :: Int
 
imageHeight :: Int
 

Instances

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

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

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

Delete a texture.

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

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)

Create an empty texture with the specified dimensions and format.

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

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

bindTexture2D :: Tex2D a -> IO ()

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

bindTextureCubeMap :: CubeMap a -> IO ()

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

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

Set the active texture unit. The default is zero.

setTex2DFiltering :: Filtering -> IO ()

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

setCubeMapFiltering :: Filtering -> IO ()

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

setTex2DWrapping :: Wrapping -> IO ()

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

setCubeMapWrapping :: Wrapping -> IO ()

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.