opengles-0.8.3: Functional interface for OpenGL 4.1+ and OpenGL ES 2.0+

Safe HaskellNone
LanguageHaskell2010

Graphics.OpenGLES.Texture

Contents

Synopsis

Texture

texSlot Source

Arguments

:: Word32

texture slot index

-> Texture a

the texture to be bound

-> GL () 

Assign a texture to a texture slot starts from 0. To read the texture, pass the texture slot index as Int32 uniform variable.

glLoadKtx Source

Arguments

:: Maybe (Texture a)

overwrite the texture if specified

-> Ktx

the texture

-> GL (Texture a) 

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

glLoadTex2D Source

Arguments

:: (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.

glLoadTex3D Source

Arguments

:: (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.

glLoadTex2DArray Source

Arguments

:: (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)).

data Sampler Source

The default sampler is Sampler (tiledRepeat,tiledRepeat,Just tiledRepeat) 1.0 (magLinear, nearestMipmapLinear).

Constructors

Sampler 

Fields

_wrapMode :: (WrapMode, WrapMode, Maybe WrapMode)

texture wrap modes per axis

_anisotropicFilter :: Float

A number of ANISOTROPY filter sampling points. Specify 1.0 to disable anisotropy filter. When EXT_texture_filter_anisotropic is not supported, fallback filters are used instead.

_fallbackFilter :: (MagFilter, MinFilter)

(Fallback) Mag and Min filters