Unify matrix uniform assignment, move towards uniform block
This commit is contained in:
@@ -15,7 +15,7 @@ import Graphics.Rendering.OpenGL hiding (Point,translate,scale,imageHeight)
|
||||
|
||||
-- I am not sure if this assumes that the shader is constructed directly before
|
||||
-- the texture is added...
|
||||
addTexture :: String -> FullShader -> IO (FullShader)
|
||||
addTexture :: String -> FullShader -> IO FullShader
|
||||
addTexture texturePath shad = do
|
||||
Right cmap <- readImage texturePath
|
||||
let tex = convertRGBA8 cmap
|
||||
@@ -31,7 +31,7 @@ addTexture texturePath shad = do
|
||||
textureFilter Texture2D $= ((Linear',Just Linear') , Nearest)
|
||||
return $ shad & shaderTexture ?~ ShaderTexture {_textureObject = textureOb}
|
||||
|
||||
addTextureArray :: String -> FullShader -> IO (FullShader)
|
||||
addTextureArray :: String -> FullShader -> IO FullShader
|
||||
addTextureArray texturePath shad = do
|
||||
Right cmap <- readImage texturePath
|
||||
let tex = convertRGBA8 cmap
|
||||
@@ -56,7 +56,7 @@ tilesToLine
|
||||
-> [a]
|
||||
tilesToLine w n = concat . concat . transpose . chunksOf n . chunksOf w
|
||||
|
||||
addUniforms :: [String] -> FullShader -> IO (FullShader)
|
||||
addUniforms :: [String] -> FullShader -> IO FullShader
|
||||
addUniforms uniStrings shad = do
|
||||
uniLocs <- mapM (uniformLocation $ _shaderProgram shad) uniStrings
|
||||
return $ shad & shaderCustomUnis %~ (++ uniLocs)
|
||||
|
||||
Reference in New Issue
Block a user