Safe Haskell | None |
---|---|
Language | Haskell2010 |
- drawPoints :: Int -> IO ()
- drawLines :: Int -> IO ()
- drawLineStrip :: Int -> IO ()
- drawLineLoop :: Int -> IO ()
- drawTriangles :: Int -> IO ()
- drawTriangleStrip :: Int -> IO ()
- drawTriangleFan :: Int -> IO ()
- drawIndexedPoints :: Int -> IndexFormat -> IO ()
- drawIndexedLines :: Int -> IndexFormat -> IO ()
- drawIndexedLineStrip :: Int -> IndexFormat -> IO ()
- drawIndexedLineLoop :: Int -> IndexFormat -> IO ()
- drawIndexedTriangles :: Int -> IndexFormat -> IO ()
- drawIndexedTriangleStrip :: Int -> IndexFormat -> IO ()
- drawIndexedTriangleFan :: Int -> IndexFormat -> IO ()
- enableScissorTest :: Viewport -> IO ()
- disableScissorTest :: IO ()
- enableCulling :: Culling -> IO ()
- disableCulling :: IO ()
- setViewport :: Viewport -> IO ()
- data Culling
- data Viewport = Viewport {}
- data IndexFormat
- enableColorWriting :: IO ()
- disableColorWriting :: IO ()
- clearColorBuffer :: Real a => (a, a, a) -> IO ()
- enableDepthTest :: IO ()
- disableDepthTest :: IO ()
- clearDepthBuffer :: IO ()
Primitives
Render various kinds of primitives to the current framebuffer using the current shader program. The integer argument is the number of vertices to read from the VBOs via the current VAO.
So VAO, Program, and FBO (or default framebuffer) must already be setup to render these primitives.
drawPoints :: Int -> IO () Source
drawLineStrip :: Int -> IO () Source
drawLineLoop :: Int -> IO () Source
drawTriangles :: Int -> IO () Source
drawTriangleStrip :: Int -> IO () Source
drawTriangleFan :: Int -> IO () Source
Primitives (by index)
Render various kinds of primitives by traversing the vertices in the order specified in the current element array. The format argument indicates the size of each index in the element array.
So to render primitives this way, you need the VAO, Program, FBO, and the element array already setup.
drawIndexedPoints :: Int -> IndexFormat -> IO () Source
drawIndexedLines :: Int -> IndexFormat -> IO () Source
drawIndexedLineStrip :: Int -> IndexFormat -> IO () Source
drawIndexedLineLoop :: Int -> IndexFormat -> IO () Source
drawIndexedTriangles :: Int -> IndexFormat -> IO () Source
drawIndexedTriangleStrip :: Int -> IndexFormat -> IO () Source
drawIndexedTriangleFan :: Int -> IndexFormat -> IO () Source
Scissor Test
enableScissorTest :: Viewport -> IO () Source
Enable the scissor test. Graphics outside the scissor box will not be rendered.
disableScissorTest :: IO () Source
Disable the scissor test.
Face Culling
enableCulling :: Culling -> IO () Source
Enable face culling. The argument specifies whether front faces, back faces, or both will be omitted from rendering. If both front and back faces are culled you can still render points and lines.
disableCulling :: IO () Source
Disable face culling. Front and back faces will now be rendered.
Viewport
setViewport :: Viewport -> IO () Source
Set the viewport. The default viewport simply covers the entire window.
Face culling modes.
A rectangular section of the window.
data IndexFormat Source
How indices are packed in an ElementArray buffer object.
UByteIndices | Each index is one unsigned byte. |
UShortIndices | Each index is a two byte unsigned int. |
UIntIndices | Each index is a four byte unsigned int. |
Color Buffer
enableColorWriting :: IO () Source
Allow rendering commands to modify the color buffer of the current framebuffer.
disableColorWriting :: IO () Source
Disable rendering to color buffer.
clearColorBuffer :: Real a => (a, a, a) -> IO () Source
Clear the color buffer of the current framebuffer with the specified color. Has no effect if writing to the color buffer is disabled.
Depth Buffer
enableDepthTest :: IO () Source
Enable the depth test. Attempting to render pixels with a depth value greater than the depth buffer at those pixels will have no effect. Otherwise the depth in the buffer will get updated to the new pixel's depth.
disableDepthTest :: IO () Source
Disable the depth test and depth buffer updates.
clearDepthBuffer :: IO () Source
Clear the depth buffer with the maximum depth value.