From 5390c2c57d2869748c329d8d0500253bb75f80a1 Mon Sep 17 00:00:00 2001 From: nek0 Date: Sun, 17 May 2020 13:37:59 +0200 Subject: [PATCH] uniform work now --- src/Main.hs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Main.hs b/src/Main.hs index cee5df1..de5c16f 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -135,6 +135,14 @@ main = do sp <- createShaderProgram vertSrc fragSrc GL.currentProgram $= Just sp + + -- -- UNIFORMS + + -- get the uniform's location out of the shader program + uniLoc <- get $ GL.uniformLocation sp "u_color" + -- write data to the uniform + GL.uniform uniLoc $= (GL.Color4 1 0.5 0 1 :: GL.Color4 GL.GLfloat) + err <- get GL.errors print $ "pre-loop errors: " <> show err