Fix character array binding

This commit is contained in:
2023-03-23 14:59:20 +00:00
parent 05d1d3d1eb
commit b352d17f72
8 changed files with 15 additions and 126 deletions
+5 -5
View File
@@ -2,7 +2,7 @@ module Shader.AuxAddition
( addSamplerTexture2D
, vaddTextureNoFilter
, addTextureArray
, addTextureArray'
, addBindTextureArray
, initTexture2D
, initTexture2DArray
, tilesToLine
@@ -128,9 +128,9 @@ addTextureArray texturePath (shad,vbo) = do
return (shad & shaderTextures .:~ TO texname
, vbo)
addTextureArray' :: String -> GLsizei -> GLsizei -> GLsizei -> GLsizei -> GLenum -> GLenum
-> Shader -> IO Shader
addTextureArray' fp nlev w h d minfilt magfilt shad = do
addBindTextureArray :: GLuint -> String -> GLsizei -> GLsizei -> GLsizei -> GLsizei -> GLenum -> GLenum
-> IO ()
addBindTextureArray bindpoint fp nlev w h d minfilt magfilt = do
Right cmap <- readImage fp
let texdata = convertRGBA8 cmap
texname <- mglCreate $ glCreateTextures GL_TEXTURE_2D_ARRAY
@@ -140,7 +140,7 @@ addTextureArray' fp nlev w h d minfilt magfilt shad = do
glGenerateTextureMipmap texname
glTextureParameteri texname GL_TEXTURE_MIN_FILTER (unsafeCoerce minfilt)
glTextureParameteri texname GL_TEXTURE_MAG_FILTER (unsafeCoerce magfilt)
return (shad & shaderTextures .:~ TO texname )
glBindTextureUnit bindpoint texname
tilesToLine
:: Int -- ^ Parameter a