move clear to renderer

This commit is contained in:
nek0 2020-05-22 02:31:24 +02:00
parent 4a499165c4
commit 750f55fda6
2 changed files with 5 additions and 1 deletions

View file

@ -168,7 +168,7 @@ main = do
-- GL.clearColor $= clearcol -- GL.clearColor $= clearcol
-- clear buffers before drawing -- clear buffers before drawing
GL.clear [GL.ColorBuffer] -- GL.clear [GL.ColorBuffer]
-- -- rebind everything neccessary for draw call -- -- rebind everything neccessary for draw call
-- bind vao -- bind vao

View file

@ -15,7 +15,11 @@ import Shader
draw :: VertexArray -> (IndexBuffer a) -> Shader -> IO () draw :: VertexArray -> (IndexBuffer a) -> Shader -> IO ()
draw va ib sp = do draw va ib sp = do
clear
bind sp bind sp
bind va bind va
bind ib bind ib
GL.drawElements GL.Triangles (iBufCount ib) GL.UnsignedInt nullPtr GL.drawElements GL.Triangles (iBufCount ib) GL.UnsignedInt nullPtr
clear :: IO ()
clear = GL.clear [GL.ColorBuffer]