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