pituicat/src/Renderer.hs

24 lines
464 B
Haskell
Raw Normal View History

2020-12-06 07:14:50 +00:00
{-# LANGUAGE OverloadedStrings #-}
module Renderer where
import qualified Graphics.Rendering.OpenGL as GL
import Control.Concurrent.STM
import Foreign.Ptr
-- internal imports
import Graphics
2020-12-06 07:14:50 +00:00
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]