Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data Tex2D a
- data CubeMap a
- data Filtering
- data Wrapping
- data Dimensions = Dimensions {
- imageWidth :: Int
- imageHeight :: Int
- newTexture2D :: InternalFormat a => Vector Word8 -> Dimensions -> IO (Tex2D a)
- deleteTexture :: Texture a => a -> IO ()
- newCubeMap :: InternalFormat a => Cube (Vector Word8, Dimensions) -> IO (CubeMap a)
- newEmptyTexture2D :: InternalFormat a => Int -> Int -> IO (Tex2D a)
- newEmptyCubeMap :: InternalFormat a => Int -> Int -> IO (CubeMap a)
- bindTexture2D :: Tex2D a -> IO ()
- bindTextureCubeMap :: CubeMap a -> IO ()
- setActiveTextureUnit :: Enum a => a -> IO ()
- setTex2DFiltering :: Filtering -> IO ()
- setCubeMapFiltering :: Filtering -> IO ()
- setTex2DWrapping :: Wrapping -> IO ()
- setCubeMapWrapping :: Wrapping -> IO ()
Documentation
A 2D texture. A program can sample a texture if it has been bound to the appropriate texture unit.
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.
Texture filtering modes.
Texture wrapping modes.
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.
Dimensions | |
|
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.