Safe Haskell | Safe-Infered |
---|
This module provides the means to load all kinds of textures from file. It's based on the stb-image package, and inherits its strengths and limitations. Specifically, it handles a subset of the JPEG, PNG, TGA, BMP and PSD file formats, but is not entirely thread safe. See http://hackage.haskell.org/package/stb-image for more information.
- class Texture t => LoadableTexture t where
- loadTexture :: TextureFormat t -> FilePath -> IO t
- class LoadableTexture3D f where
- loadTexture3D :: Int -> f -> FilePath -> IO (Texture3D f)
Documentation
class Texture t => LoadableTexture t whereSource
Provides the general way of loading any kind of textures. A 3D texture is assumed to be an array of square images tiled vertically in the image file. Cube textures are assumed to be composed of 6 equally sized images tiled vertically. No additional mipmaps are loaded.
Filesystem errors or bad texture dimensions (e.g. loading a cube texture from a file where the height
is not a multiple of 6) are thrown as IOError
s.
loadTexture :: TextureFormat t -> FilePath -> IO tSource
class LoadableTexture3D f whereSource