25 lines
438 B
Haskell
25 lines
438 B
Haskell
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
|
|
|
|
clear :: IO ()
|
|
clear = GL.clear [GL.ColorBuffer]
|