module FRP.Spice.Graphics.Geometry where
import Graphics.Rendering.OpenGL
import FRP.Spice.Graphics.Utils
import FRP.Spice.Math.Vector
renderPoint :: Vector Float -> IO ()
renderPoint (Vector x y) = do
renderPrimitive Points $
vertex $ Vertex2 (togl x) (togl y)
renderRectangle :: Vector Float -> Vector Float -> IO ()
renderRectangle (Vector x y) (Vector w h) = do
renderPrimitive Quads $ do
vertex $ Vertex2 (togl (x )) (togl (y ))
vertex $ Vertex2 (togl (x + w)) (togl (y ))
vertex $ Vertex2 (togl (x + w)) (togl (y + h))
vertex $ Vertex2 (togl (x )) (togl (y + h))
renderSquare :: Vector Float -> Float -> IO ()
renderSquare pos size = renderRectangle pos $ Vector size size