Continue render refactor

This commit is contained in:
2023-03-14 14:11:14 +00:00
parent 35f401d8c8
commit 378af69ca5
12 changed files with 118 additions and 112 deletions
+4 -3
View File
@@ -62,8 +62,8 @@ addTexture2D nlev minfilt magfilt texpath shad = do
-- | for transforming a 256x256 image containing 64 tiles of 16x16 pixels into
-- an image that was directly readable by glTexSubImage3D, used the
-- transformation tilesToLine 8 128 on the underlying pixels.
addTextureArray :: String -> FullShader -> IO FullShader
addTextureArray texturePath shad = do
addTextureArray :: String -> (FullShader,VBO) -> IO (FullShader,VBO)
addTextureArray texturePath (shad,vbo) = do
err <- glGetError
print err
Right cmap <- readImage texturePath
@@ -75,8 +75,9 @@ addTextureArray texturePath shad = do
glGenerateTextureMipmap texname
glTextureParameteri texname GL_TEXTURE_MIN_FILTER (unsafeCoerce GL_LINEAR_MIPMAP_LINEAR)
glTextureParameteri texname GL_TEXTURE_MAG_FILTER (unsafeCoerce GL_LINEAR)
return $ shad & shadTex' ?~ ShaderTexture
return (shad & shadTex' ?~ ShaderTexture
{ _textureObject = texname}
, vbo)
-- I am completely unclear on why this works with its current parameters
tilesToLine