renderer-tutorial/src/Renderer.hs

25 lines
438 B
Haskell
Raw Normal View History

2020-05-22 00:29:16 +00:00
module Renderer where
import SDL (($=), get)
import qualified Graphics.Rendering.OpenGL as GL
import Foreign.Ptr
-- internal imports
import BindableClass
import VertexArray
import IndexBuffer
import Shader
draw :: VertexArray -> (IndexBuffer a) -> Shader -> IO ()
draw va ib sp = do
bind sp
bind va
bind ib
GL.drawElements GL.Triangles (iBufCount ib) GL.UnsignedInt nullPtr
2020-05-22 00:31:24 +00:00
clear :: IO ()
clear = GL.clear [GL.ColorBuffer]