pituicat/src/Renderer.hs

23 lines
464 B
Haskell

{-# LANGUAGE OverloadedStrings #-}
module Renderer where
import qualified Graphics.Rendering.OpenGL as GL
import Control.Concurrent.STM
import Foreign.Ptr
-- internal imports
import Graphics
draw :: VertexArray -> IndexBuffer -> Shader -> IO ()
draw va ib sp = do
bind sp
bind va
bind ib
count <- atomically $ readTVar $ iBufCount ib
GL.drawElements GL.Triangles count GL.UnsignedInt nullPtr
-- clear :: IO ()
-- clear = GL.clear [GL.ColorBuffer]