ombra-1.0.0.0: Render engine.

LicenseBSD3
Maintainerziocroc@gmail.com
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Graphics.Rendering.Ombra.Texture

Contents

Description

 

Synopsis

Documentation

class (MonadGL m, GLES) => MonadTexture m Source #

Minimal complete definition

getTexture, getActiveTexturesCount, setActiveTexturesCount, newTexture, unusedTextures

Instances

GLES => MonadTexture (Draw o) Source # 

Methods

getTexture :: Texture -> Draw o (Either String LoadedTexture)

getActiveTexturesCount :: Draw o Int

setActiveTexturesCount :: Int -> Draw o ()

newTexture :: Int -> Int -> TextureParameters -> Int -> (Texture -> GL ()) -> Draw o LoadedTexture

unusedTextures :: [LoadedTexture] -> Draw o ()

data Texture Source #

A texture.

Instances

mkTexture Source #

Arguments

:: GLES 
=> Int

Width.

-> Int

Height.

-> TextureParameters 
-> [[Color]]

List of pixels, one for each level of detail. The first element is the base image level, the second image is half the size of the base, and so on. Use just one level of detail if you don't want mipmaps, or you used True in the previous argument.

-> Texture 

Creates a Texture from a list of pixels.

mkTextureFloat Source #

Arguments

:: GLES 
=> Int

Width.

-> Int

Height.

-> TextureParameters 
-> [Vec4]

List of vectors.

-> Texture 

Creates a float Texture from a list of vectors.

mkTextureRaw Source #

Arguments

:: GLES 
=> Int

Width.

-> Int

Height.

-> TextureParameters 
-> [UInt8Array]

Array of pixel components, one for each level of detail.

-> Int

Hash of the arrays

-> Texture 

colorTex :: GLES => Color -> Texture Source #

Generate a 1x1 texture.

Parameters

data Filter Source #

Constructors

Linear

Average of the four nearest pixels.

Nearest

Nearest pixel.

Instances

parameters Source #

Arguments

:: Filter

Minification filter

-> Filter

Magnification filter

-> TextureParameters 

potParameters Source #

Arguments

:: (Filter, Maybe Filter)

Minification filter.

-> Filter

Magnification filter.

-> Bool

Generate mipmaps automatically.

-> WrappingFunction

Horizontal wrapping function.

-> WrappingFunction

Vertical wrapping function.

-> TextureParameters 

This function provides more features than parameters, but, on WebGL, the resulting TextureParameters will not work with textures whose width or height is not a power of two.

potLinear Source #

Arguments

:: Bool

Generate mipmaps

-> TextureParameters 

potParameters with linear filters and repeat.