uniform work now
This commit is contained in:
parent
d566595b1c
commit
5390c2c57d
1 changed files with 8 additions and 0 deletions
|
@ -135,6 +135,14 @@ main = do
|
||||||
|
|
||||||
sp <- createShaderProgram vertSrc fragSrc
|
sp <- createShaderProgram vertSrc fragSrc
|
||||||
GL.currentProgram $= Just sp
|
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
|
err <- get GL.errors
|
||||||
print $ "pre-loop errors: " <> show err
|
print $ "pre-loop errors: " <> show err
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue