lambdacube-engine-0.2.1: 3D rendering engine written entirely in Haskell

Graphics.LambdaCube.HardwareVertexBuffer

Synopsis

Documentation

class HardwareBuffer a => HardwareVertexBuffer a whereSource

Methods

getVertexSizeSource

Arguments

:: a 
-> Int

Gets the size in bytes of a single vertex in this buffer

getNumVerticesSource

Arguments

:: a 
-> Int

Get the number of vertices in this buffer

data VertexElementSemantic Source

Vertex element semantics, used to identify the meaning of vertex buffer contents

Constructors

VES_POSITION

Position, 3 reals per vertex

VES_BLEND_WEIGHTS

Blending weights

VES_BLEND_INDICES

Blending indices

VES_NORMAL

Normal, 3 reals per vertex

VES_DIFFUSE

Diffuse colours

VES_SPECULAR

Specular colours

VES_TEXTURE_COORDINATES

Texture coordinates

VES_BINORMAL

Binormal (Y axis if normal is Z)

VES_TANGENT

Tangent (X axis if normal is Z)

data VertexElementType Source

Vertex element type, used to identify the base types of the vertex contents

data VertexElement Source

Constructors

VertexElement 

Fields

veSource :: Int

The source vertex buffer, as bound to an index using VertexBufferBinding

veOffset :: Int

The offset in the buffer that this element starts at

veType :: VertexElementType

The type of element

veSemantic :: VertexElementSemantic

The meaning of the element

veIndex :: Int

Index of the item, only applicable for some elements like texture coords

getTypeSize :: VertexElementType -> IntSource

Utility method for helping to calculate offsets

getTypeCount :: VertexElementType -> IntSource

Utility method which returns the count of values in a given type

multiplyTypeCount :: VertexElementType -> Int -> VertexElementTypeSource

Simple converter function which will turn a single-value type into a multi-value type based on a parameter.

getBaseType :: VertexElementType -> VertexElementTypeSource

Simple converter function which will convert a type into its single-value equivalent to make switches on type easier.

data VertexDeclaration Source

Constructors

VertexDeclaration 

Fields

vdElementList :: [VertexElement]

The list of vertex elements that makes up this declaration