cal3d-0.1: Haskell binding to the Cal3D animation library.Source codeContentsIndex
Graphics.Animation.Cal3D.Renderer
Description
A Renderer provides information needed for graphics rendering; it does not output any graphics by itself, but needs the cooperation of a graphics API. Consider using Graphics.Animation.Cal3D.OpenGL from the cal3d-opengl package.
Synopsis
newRenderer :: Model -> IO Renderer
deleteRenderer :: Renderer -> IO ()
renderAnimation :: Renderer -> IO () -> IO (Either String ())
getMeshCount :: Renderer -> IO Int
getSubmeshCount :: Renderer -> Int -> IO Int
selectMeshSubmesh :: Renderer -> Int -> Int -> IO (Either String ())
type CalIndex = CInt
getFaceCount :: Renderer -> IO Int
getFaces :: Renderer -> Ptr CalIndex -> IO Int
withAmbientColorPtr :: Storable c => (Ptr Word8 -> IO c) -> Renderer -> IO c
withDiffuseColorPtr :: Storable c => (Ptr Word8 -> IO c) -> Renderer -> IO c
withSpecularColorPtr :: Storable c => (Ptr Word8 -> IO c) -> Renderer -> IO c
getShininess :: Renderer -> IO Float
getVertexCount :: Renderer -> IO Int
getVertices :: Renderer -> Ptr Float -> Int -> IO Int
getNormals :: Renderer -> Ptr Float -> Int -> IO Int
Documentation
newRenderer :: Model -> IO RendererSource
Create a Renderer.
deleteRenderer :: Renderer -> IO ()Source
Destroy a Renderer.
renderAnimationSource
:: Renderer
-> IO ()rendering action
-> IO (Either String ())

Executes a rendering action.

 renderAnimation renderer action

corresponds to

 renderer->beginRendering();
 action();
 renderer->endRendering();

in the Cal3D C++ API.

getMeshCount :: Renderer -> IO IntSource
The number of meshes in the Renderer's Model.
getSubmeshCountSource
:: Renderer
-> Intmesh ID
-> IO Int
The number of submeshes in the given mesh of the Renderer's Model.
selectMeshSubmeshSource
:: Renderer
-> Intmesh ID
-> Intsubmesh ID
-> IO (Either String ())
Selects a particular (mesh, submesh) so that all subsequent operations refer to this (mesh, submesh) pair.
type CalIndex = CIntSource
Used to index faces.
getFaceCount :: Renderer -> IO IntSource
The number of faces in the current (mesh, submesh).
getFacesSource
:: Renderer
-> Ptr CalIndexbuffer
-> IO Int
Fills a buffer with the face numbers.
withAmbientColorPtrSource
:: Storable c
=> Ptr Word8 -> IO caction
-> Renderer
-> IO c
Calls an action with a pointer to the ambient color data. The color data are four bytes (red, green, blue, alpha). If you are using OpenGL, use Graphics.Animation.Cal3D.OpenGL.getAmbientColor instead. You almost certainly don't want to use withAmbientColorPtr directly, unless your are connecting Cal3D to a different graphics API.
withDiffuseColorPtr :: Storable c => (Ptr Word8 -> IO c) -> Renderer -> IO cSource
Diffuse color, like withAmbientColorPtr.
withSpecularColorPtr :: Storable c => (Ptr Word8 -> IO c) -> Renderer -> IO cSource
Specular color, like withAmbientColorPtr.
getShininess :: Renderer -> IO FloatSource
The shininess, which affects the extent of speculr effects.
getVertexCount :: Renderer -> IO IntSource
The number of vertices, also the number of normals, in the current (mesh, submesh).
getVerticesSource
:: Renderer
-> Ptr Floatbuffer
-> Intstride
-> IO Int
Fills a buffer with the vertex data of the current (mesh, submesh).
getNormals :: Renderer -> Ptr Float -> Int -> IO IntSource
Fills a buffer with the normal data for the current (mesh, submesh).
Produced by Haddock version 2.4.2