Safe Haskell | None |
---|---|
Language | Haskell98 |
Graphics.GLUtil.Textures
Description
Utilities for loading texture data.
- data TexColor
- data TexInfo a = TexInfo {}
- texInfo :: Int -> Int -> TexColor -> a -> TexInfo a
- class HasGLType (Elem a) => IsPixelData a where
- type Elem a
- newtype ShortString = ShortString ByteString
- freshTexture :: forall a proxy. HasGLType a => Int -> Int -> TexColor -> proxy a -> IO TextureObject
- freshTextureWord8 :: Int -> Int -> TexColor -> IO TextureObject
- freshTextureFloat :: Int -> Int -> TexColor -> IO TextureObject
- loadTexture :: IsPixelData a => TexInfo a -> IO TextureObject
- reloadTexture :: forall a. IsPixelData a => TextureObject -> TexInfo a -> IO ()
- texture2DWrap :: StateVar (Repetition, Clamping)
- texture3DWrap :: StateVar (Repetition, Clamping)
- withTextures :: BindableTextureTarget t => t -> [TextureObject] -> IO a -> IO a
- withTextures2D :: [TextureObject] -> IO a -> IO a
- withTexturesAt :: BindableTextureTarget t => t -> [(TextureObject, GLuint)] -> IO a -> IO a
Documentation
A basic texture information record.
class HasGLType (Elem a) => IsPixelData a where Source #
Class for containers of texture data.
Minimal complete definition
Instances
IsPixelData ByteString Source # | |
IsPixelData ShortString Source # | |
HasGLType b => IsPixelData [b] Source # | |
HasGLType b => IsPixelData (Ptr b) Source # | |
HasGLType b => IsPixelData (ForeignPtr b) Source # | |
HasGLType b => IsPixelData (Vector b) Source # | |
HasGLType b => IsPixelData (StorableArray i b) Source # | |
newtype ShortString Source #
Wrapper whose IsPixelData
instance treats the pointer underlying
a ByteString
as an array of Word16
s.
Constructors
ShortString ByteString |
Instances
freshTexture :: forall a proxy. HasGLType a => Int -> Int -> TexColor -> proxy a -> IO TextureObject Source #
Create a new 2D texture with uninitialized contents.
freshTextureWord8 :: Int -> Int -> TexColor -> IO TextureObject Source #
Create a new 2D texture with uninitialized Word8
contents.
freshTextureFloat :: Int -> Int -> TexColor -> IO TextureObject Source #
Create a new 2D texture with uninitialized GLfloat
contents.
loadTexture :: IsPixelData a => TexInfo a -> IO TextureObject Source #
Create a new 2D texture with data from a TexInfo
.
reloadTexture :: forall a. IsPixelData a => TextureObject -> TexInfo a -> IO () Source #
Replace a 2D texture's pixel data with data from a TexInfo
.
texture2DWrap :: StateVar (Repetition, Clamping) Source #
Set texture coordinate wrapping options for both the S
and T
dimensions of a 2D texture.
texture3DWrap :: StateVar (Repetition, Clamping) Source #
Set texture coordinate wrapping options for the S
, T
, and R
dimensions of a 3D texture.
withTextures :: BindableTextureTarget t => t -> [TextureObject] -> IO a -> IO a Source #
Bind each of the given textures to successive texture units at
the given TextureTarget
starting with texture unit 0.
withTextures2D :: [TextureObject] -> IO a -> IO a Source #
Bind each of the given 2D textures to successive texture units starting with texture unit 0.
withTexturesAt :: BindableTextureTarget t => t -> [(TextureObject, GLuint)] -> IO a -> IO a Source #
Bind each of the given textures to the texture unit they are
paired with. The given action is run with these bindings, then the
texture bindings are reset. If you don't care which texture units
are used, consider using withTextures
or withTextures2D
.