move clear to renderer
This commit is contained in:
parent
4a499165c4
commit
750f55fda6
2 changed files with 5 additions and 1 deletions
|
@ -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
|
||||||
|
|
|
@ -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]
|
||||||
|
|
Loading…
Reference in a new issue