Cleanup
This commit is contained in:
@@ -84,6 +84,3 @@ setupFramebuffer2GivenStencil rboName = do
|
||||
Complete -> return ()
|
||||
_ -> putStrLn $ "Framebuffer with given stencil and two texture objects status: " ++ show fboStatus
|
||||
return (FBO fboName, (TO to1, TO to2))
|
||||
|
||||
minMagFilter :: ((TextureFilter, Maybe TextureFilter), TextureFilter)
|
||||
minMagFilter = ((Nearest, Nothing), Nearest)
|
||||
|
||||
@@ -166,34 +166,21 @@ resizeFBOTO
|
||||
-> Int
|
||||
-> Int
|
||||
-> GLenum -- ^ minification filter
|
||||
--((TextureFilter, Maybe TextureFilter),TextureFilter)
|
||||
-> GLenum -- ^ magnification filter
|
||||
-> GLenum -- ^ internal color format
|
||||
-> IO (FBO, TO)
|
||||
resizeFBOTO (fboName,oldto) xsize ysize minfilt magfilt inFormat = do
|
||||
--bindFramebuffer Framebuffer $= fboName
|
||||
glBindFramebuffer GL_FRAMEBUFFER (_unFBO fboName)
|
||||
let xsize' = fromIntegral xsize
|
||||
ysize' = fromIntegral ysize
|
||||
mglDelete glDeleteTextures $ _unTO oldto
|
||||
to <- mglCreate (glCreateTextures GL_TEXTURE_2D)
|
||||
--toName <- genObjectName
|
||||
--textureBinding Texture2D $= Just toName
|
||||
--glTexStorage2D GL_TEXTURE_2D 1 inFormat xsize' ysize'
|
||||
glTextureStorage2D to 1 inFormat xsize' ysize'
|
||||
glTextureParameteri to GL_TEXTURE_MIN_FILTER (unsafeCoerce minfilt)
|
||||
glTextureParameteri to GL_TEXTURE_MAG_FILTER (unsafeCoerce magfilt)
|
||||
--textureFilter Texture2D $= mmfilt
|
||||
glNamedFramebufferTexture (_unFBO fboName) GL_COLOR_ATTACHMENT0 to 0
|
||||
--framebufferTexture2D Framebuffer (ColorAttachment 0) Texture2D toName 0
|
||||
to1 <- mglCreate (glCreateTextures GL_TEXTURE_2D)
|
||||
glTextureStorage2D to1 1 inFormat xsize' ysize'
|
||||
glTextureParameteri to1 GL_TEXTURE_MIN_FILTER (unsafeCoerce minfilt)
|
||||
glTextureParameteri to1 GL_TEXTURE_MAG_FILTER (unsafeCoerce magfilt)
|
||||
glNamedFramebufferTexture (_unFBO fboName) GL_COLOR_ATTACHMENT0 to1 0
|
||||
fboStatus <- framebufferStatus Framebuffer
|
||||
case fboStatus of
|
||||
Complete -> return ()
|
||||
_ -> error $ "after resize, resizeFBOTO framebuffer status:" ++ show fboStatus
|
||||
return (fboName, TO to)
|
||||
|
||||
minMagFilter :: ((TextureFilter, Maybe TextureFilter),TextureFilter)
|
||||
minMagFilter = ((Nearest,Nothing),Nearest)
|
||||
|
||||
linMinMagFilter :: ((TextureFilter, Maybe TextureFilter),TextureFilter)
|
||||
linMinMagFilter = ((Linear',Nothing),Linear')
|
||||
return (fboName, TO to1)
|
||||
|
||||
Reference in New Issue
Block a user