GLUtil-0.2.2: Miscellaneous OpenGL utilities.

Safe HaskellNone

Graphics.GLUtil.Textures

Description

Utilities for loading texture data.

Synopsis

Documentation

data TexColor Source

Pixel format of image data.

Constructors

TexMono 
TexRGB 
TexBGR 
TexRGBA 

data TexInfo a Source

A basic texture information record.

Constructors

TexInfo 

texInfo :: Int -> Int -> TexColor -> a -> TexInfo aSource

Helper for constructing a TexInfo using Haskell Ints for image dimensions.

class Storable a => HasGLType a whereSource

Open mapping from Haskell types to OpenGL types.

Methods

glType :: a -> DataTypeSource

class HasGLType (Elem a) => IsPixelData a whereSource

Class for containers of texture data.

Associated Types

type Elem a Source

Methods

withPixels :: a -> (Ptr (Elem a) -> IO c) -> IO cSource

newtype ShortString Source

Wrapper whose IsPixelData instance treats the pointer underlying a ByteString as an array of Word16s.

Constructors

ShortString ByteString 

loadTexture :: IsPixelData a => TexInfo a -> IO TextureObjectSource

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.