Refactor window size, update selection cursor on new screen
This commit is contained in:
+41
-26
@@ -7,6 +7,7 @@ module Framebuffer.Update (
|
||||
sizeFBOs,
|
||||
) where
|
||||
|
||||
import Dodge.WindowSize
|
||||
import Control.Lens
|
||||
import Control.Monad
|
||||
import Data.Preload.Render
|
||||
@@ -31,36 +32,50 @@ sizeFBOs cfig rdata =
|
||||
GL_NEAREST
|
||||
GL_NEAREST
|
||||
GL_RGBA8
|
||||
GL_RGBA16F
|
||||
GL_RGBA16F -- i am not sure if this should not be GL_RGBA32F
|
||||
GL_RGBA16F
|
||||
)
|
||||
rdata
|
||||
[fboBase, fboCloud]
|
||||
>>= flip
|
||||
( uncurry
|
||||
updateFBOTO
|
||||
(getWindowSize _graphics_world_resolution cfig)
|
||||
GL_NEAREST
|
||||
GL_NEAREST
|
||||
GL_RGBA8
|
||||
)
|
||||
fboLighting
|
||||
>>= ffoldM
|
||||
( uncurry
|
||||
updateFBOTO
|
||||
(getWindowSize _graphics_world_resolution cfig)
|
||||
GL_LINEAR_MIPMAP_LINEAR
|
||||
GL_LINEAR
|
||||
GL_RGBA16F
|
||||
)
|
||||
>>= foldUpdateFBOTO
|
||||
_graphics_world_resolution
|
||||
GL_NEAREST
|
||||
GL_NEAREST
|
||||
GL_RGBA8
|
||||
[fboLighting]
|
||||
>>= foldUpdateFBOTO
|
||||
_graphics_world_resolution
|
||||
GL_LINEAR_MIPMAP_LINEAR
|
||||
GL_LINEAR
|
||||
GL_RGBA16F
|
||||
[fboBloom, fboPos]
|
||||
>>= ffoldM
|
||||
(uncurry updateFBOTO (getWindowSize _graphics_overlay_resolution cfig) GL_LINEAR GL_NEAREST GL_RGBA8)
|
||||
>>= foldUpdateFBOTO
|
||||
_graphics_overlay_resolution
|
||||
GL_LINEAR
|
||||
GL_NEAREST
|
||||
GL_RGBA8
|
||||
[fbo2, fbo3, fboOverlay]
|
||||
>>= ffoldM
|
||||
(uncurry updateFBOTO (getWindowSize _graphics_downsize_resolution cfig) GL_LINEAR_MIPMAP_LINEAR GL_LINEAR GL_RGBA16F)
|
||||
>>= foldUpdateFBOTO
|
||||
_graphics_downsize_resolution
|
||||
GL_LINEAR_MIPMAP_LINEAR
|
||||
GL_LINEAR
|
||||
GL_RGBA16F
|
||||
[fboHalf1, fboHalf2, fboHalf3]
|
||||
>>= resizeShadowFBO' cfig
|
||||
where
|
||||
updateFBOTO' f =
|
||||
uncurry
|
||||
updateFBOTO
|
||||
(getWindowSize f cfig)
|
||||
foldUpdateFBOTO f minfilt magfilt format l =
|
||||
ffoldM
|
||||
( updateFBOTO'
|
||||
f
|
||||
minfilt
|
||||
magfilt
|
||||
format
|
||||
)
|
||||
l
|
||||
|
||||
ffoldM ::
|
||||
(Foldable t, Monad m) =>
|
||||
@@ -254,7 +269,7 @@ initializeTexture2DArray fbo attachpoint x y z minfilt magfilt informat = do
|
||||
glNamedFramebufferTexture (_unFBO fbo) attachpoint to1 0
|
||||
return to1
|
||||
|
||||
getWindowSize :: Integral a => (Configuration -> ResFactor) -> Configuration -> (a, a)
|
||||
getWindowSize f cfig = (g _windowX, g _windowY)
|
||||
where
|
||||
g h = fromIntegral $ round (h cfig) `div` resFactorNum (f cfig)
|
||||
--getWindowSize :: Integral a => (Configuration -> ResFactor) -> Configuration -> (a, a)
|
||||
--getWindowSize f cfig = (g _windowX, g _windowY)
|
||||
-- where
|
||||
-- g h = fromIntegral $ h cfig `div` resFactorNum (f cfig)
|
||||
|
||||
Reference in New Issue
Block a user