Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data Texture a
- texSlot :: Word32 -> Texture a -> GL ()
- glLoadKtx :: Maybe (Texture a) -> Ktx -> GL (Texture a)
- glLoadKtxFile :: FilePath -> GL (Texture a)
- glLoadTex2D :: forall a b. (Storable a, ExternalFormat a b) => Maybe (Texture b) -> Bool -> ForeignPtr a -> V2 Word32 -> GL (Texture b)
- glLoadTex3D :: forall a b. (Storable a, ExternalFormat a b) => Maybe (Texture b) -> Bool -> ForeignPtr a -> V3 Word32 -> GL (Texture b)
- glLoadTex2DArray :: forall a b. (Storable a, ExternalFormat a b) => Maybe (Texture b) -> Bool -> ForeignPtr a -> V3 Word32 -> GL (Texture b)
- setSampler :: Texture a -> Sampler -> GL ()
- data Sampler = Sampler {}
- data MagFilter
- magNearest :: MagFilter
- magLinear :: MagFilter
- data MinFilter
- minNearest :: MinFilter
- minLinear :: MinFilter
- nearestMipmapNearest :: MinFilter
- linearMipmapNearest :: MinFilter
- nearestMipmapLinear :: MinFilter
- linearMipmapLinear :: MinFilter
- data WrapMode
- tiledRepeat :: WrapMode
- clampToEdge :: WrapMode
- mirroredRepeat :: WrapMode
Texture
Assign a texture to a texture slot starts from 0.
To read the texture, pass the texture slot index as Int32
uniform variable.
Load a GL Texture object from Ktx texture container. See https://github.com/KhronosGroup/KTX/blob/master/lib/loader.c TODO: reject 2DArray/3D texture if unsupported
glLoadKtxFile :: FilePath -> GL (Texture a) Source
Load a KTX Texture from given path.
Unsafe Operations
:: (Storable a, ExternalFormat a b) | |
=> Maybe (Texture b) | if any, reuse the texture |
-> Bool | needs mipmap update? |
-> ForeignPtr a | pixel base components |
-> V2 Word32 | width, height |
-> GL (Texture b) |
Upload 2D texture of raw memory bitmap.
:: (Storable a, ExternalFormat a b) | |
=> Maybe (Texture b) | if any, reuse the texture |
-> Bool | needs mipmap update? |
-> ForeignPtr a | pixel base components |
-> V3 Word32 | width, height, depth |
-> GL (Texture b) |
Upload 3D texture of raw memory bitmap.
:: (Storable a, ExternalFormat a b) | |
=> Maybe (Texture b) | if any, reuse the texture |
-> Bool | needs mipmap update? |
-> ForeignPtr a | pixel base components |
-> V3 Word32 | width, height, layer depth |
-> GL (Texture b) |
Upload 2DArray texture of raw memory bitmap.
Sampler
setSampler :: Texture a -> Sampler -> GL () Source
Set sampler to the texture. Default sampler is (Sampler (tiledRepeat,tiledRepeat,Just tiledRepeat) 1.0 (magLinear, nearestMipmapLinear)).
The default sampler is Sampler (tiledRepeat,tiledRepeat,Just tiledRepeat) 1.0 (magLinear, nearestMipmapLinear).
Sampler | |
|