HORIZON HASKELLDocslts/ghc-10.0.x77a86622026-10-31Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 77a8662 · 2026-10-31

Modulesdl2-gfx-0.3.0.0Haskell2010

SDL.Primitive

Bindings to SDL2_gfx's primitives drawing functionality. These functions should allow you to render various simple shapes such as lines, ellipses or polygons.

All of the monadic functions within this module are capable of throwing an SDLException if they encounter an error.

Contents
  1. Pixels
  2. Lines
  3. Triangles
  4. Rectangles
  5. Curves
  6. Polygons
Synopsis

Pixels

Lines

Triangles

Rectangles

Curves

typetype Steps = CInt

How many interpolation steps when rendering a bezier curve?

The higher this is, the smoother the curve and more resource-intensive the render.

valuebezier
  1. :: MonadIO m
  2. => Renderer
  3. -> Vector Int16
  4. -> Vector Int16
  5. -> Steps
  6. -> Color
  7. -> m ()

Renders a bezier curve of a given Color.

The input vectors contain the bezier curve's point locations on the x and y-axis, respectively. The input vectors need to be the same length, and those lengths must be at least 3, otherwise bezier might raise an SDLException. The same applies for the number of interpolation Steps: it must be at least 2.

Polygons