Move pair to V2
This commit is contained in:
+12
-16
@@ -5,6 +5,7 @@
|
||||
-}
|
||||
module Framebuffer.Update (sizeFBOs) where
|
||||
|
||||
import Geometry.Data
|
||||
import Control.Lens
|
||||
import Control.Monad
|
||||
import Data.Preload.Render
|
||||
@@ -19,9 +20,8 @@ import Unsafe.Coerce
|
||||
|
||||
sizeFBOs :: Config -> RenderData -> IO RenderData
|
||||
sizeFBOs cfig rdata =
|
||||
uncurry (resizeRBO (_rboBaseBloom rdata)) (getWindowSize _gr_world_res cfig)
|
||||
>> uncurry
|
||||
updateFBOTO3
|
||||
uncurryV (resizeRBO (_rboBaseBloom rdata)) (getWindowSize _gr_world_res cfig)
|
||||
>> updateFBOTO3
|
||||
(getWindowSize _gr_world_res cfig)
|
||||
GL_NEAREST
|
||||
GL_NEAREST
|
||||
@@ -34,7 +34,7 @@ sizeFBOs cfig rdata =
|
||||
rdata
|
||||
fboBase
|
||||
>>= flip
|
||||
( uncurry
|
||||
(
|
||||
updateFBOTO3
|
||||
(getWindowSize _gr_world_res cfig)
|
||||
GL_NEAREST
|
||||
@@ -69,8 +69,7 @@ sizeFBOs cfig rdata =
|
||||
GL_RGBA16F
|
||||
[fboHalf1, fboHalf2]
|
||||
>>= flip
|
||||
( uncurry
|
||||
updateFBOTO2
|
||||
( updateFBOTO2
|
||||
(getWindowSize _gr_world_res cfig)
|
||||
GL_NEAREST
|
||||
GL_NEAREST
|
||||
@@ -79,7 +78,7 @@ sizeFBOs cfig rdata =
|
||||
)
|
||||
fboWindow
|
||||
where
|
||||
updateFBOTO' f = uncurry updateFBOTO (getWindowSize f cfig)
|
||||
updateFBOTO' f = updateFBOTO (getWindowSize f cfig)
|
||||
foldUpdateFBOTO f minfilt magfilt form =
|
||||
ffoldM (updateFBOTO' f minfilt magfilt form)
|
||||
|
||||
@@ -90,8 +89,7 @@ resizeRBO :: GLuint -> GLsizei -> GLsizei -> IO ()
|
||||
resizeRBO rboName = glNamedRenderbufferStorage rboName GL_DEPTH24_STENCIL8
|
||||
|
||||
updateFBOTO ::
|
||||
Int ->
|
||||
Int ->
|
||||
V2 Int ->
|
||||
-- | minification filter
|
||||
GLenum ->
|
||||
-- | magnification filter
|
||||
@@ -101,15 +99,14 @@ updateFBOTO ::
|
||||
RenderData ->
|
||||
ALens' RenderData (FBO, TO) ->
|
||||
IO RenderData
|
||||
updateFBOTO xsize ysize minfilt magfilt form pdata target = do
|
||||
updateFBOTO (V2 xsize ysize) minfilt magfilt form pdata target = do
|
||||
newfbo2 <- resizeFBOTO (pdata ^# target) xsize ysize minfilt magfilt form
|
||||
return $ storing target newfbo2 pdata
|
||||
|
||||
-- note that the ordering of arguments is different to the other update
|
||||
-- functions... this all needs rethinking
|
||||
updateFBOTO2 ::
|
||||
Int ->
|
||||
Int ->
|
||||
V2 Int ->
|
||||
-- | minification filter
|
||||
GLenum ->
|
||||
-- | magnification filter
|
||||
@@ -121,13 +118,12 @@ updateFBOTO2 ::
|
||||
RenderData ->
|
||||
ALens' RenderData (FBO, (TO, TO)) ->
|
||||
IO RenderData
|
||||
updateFBOTO2 xsize ysize minfilt magfilt form1 form2 pdata target = do
|
||||
updateFBOTO2 (V2 xsize ysize) minfilt magfilt form1 form2 pdata target = do
|
||||
newfbo2 <- resizeFBOTO2 (pdata ^# target) xsize ysize minfilt magfilt form1 form2
|
||||
return $ storing target newfbo2 pdata
|
||||
|
||||
updateFBOTO3 ::
|
||||
Int ->
|
||||
Int ->
|
||||
V2 Int ->
|
||||
-- | minification filter
|
||||
GLenum ->
|
||||
-- | magnification filter
|
||||
@@ -141,7 +137,7 @@ updateFBOTO3 ::
|
||||
RenderData ->
|
||||
ALens' RenderData (FBO, (TO, TO, TO)) ->
|
||||
IO RenderData
|
||||
updateFBOTO3 xsize ysize minfilt magfilt form1 form2 form3 pdata target = do
|
||||
updateFBOTO3 (V2 xsize ysize) minfilt magfilt form1 form2 form3 pdata target = do
|
||||
newfbo2 <- resizeFBOTO3 (pdata ^# target) xsize ysize minfilt magfilt form1 form2 form3
|
||||
return $ storing target newfbo2 pdata
|
||||
|
||||
|
||||
Reference in New Issue
Block a user