Commit before moving buffer swapping command

This commit is contained in:
2023-03-02 11:49:40 +00:00
parent 6b0f78d4eb
commit ed8efd21d9
4 changed files with 11 additions and 5 deletions
+6 -5
View File
@@ -7,9 +7,9 @@ import Control.Lens
import Dodge.Base.Wall import Dodge.Base.Wall
import Dodge.Data.World import Dodge.Data.World
import Dodge.Wall.Draw import Dodge.Wall.Draw
import Dodge.Zoning.Base --import Dodge.Zoning.Base
import Dodge.Zoning.Wall --import Dodge.Zoning.Wall
import Dodge.Zoning.World --import Dodge.Zoning.World
import Geometry import Geometry
import ShapePicture import ShapePicture
@@ -25,8 +25,9 @@ wallsToDraw w =
<*> L.prefilter wlSeeThroughDraw (L.premap f L.list) <*> L.prefilter wlSeeThroughDraw (L.premap f L.list)
<*> L.premap getWallSPic L.mconcat <*> L.premap getWallSPic L.mconcat
) )
(wlsFromIXs w $ zonesExtract (w ^. wlZoning) $ zoneOfSight wlZoneSize cam) (w ^. cWorld . lWorld . walls)
cam = w ^. cWorld . camPos -- (wlsFromIXs w $ zonesExtract (w ^. wlZoning) $ zoneOfSight wlZoneSize cam)
-- cam = w ^. cWorld . camPos
--wallsToDraw --wallsToDraw
-- :: World -- :: World
+1
View File
@@ -231,6 +231,7 @@ doConLoop' ::
---- immediately ---- immediately
(world -> ConcurrentEffect world) -> (world -> ConcurrentEffect world) ->
-- | simulation update. Allows for side effects such as rendering. -- | simulation update. Allows for side effects such as rendering.
-- passes the window to allow buffer swapping at different times
(world -> IO world) -> (world -> IO world) ->
-- | SDL Event handling. Note no side effects. -- | SDL Event handling. Note no side effects.
(world -> Event -> world) -> (world -> Event -> world) ->
+1
View File
@@ -141,6 +141,7 @@ preloadRender = do
-- texture shaders, no textures attached -- texture shaders, no textures attached
fsShad <- makeShaderSized "texture/simple" [vert, frag] [2, 2] 4 ETriangleStrip fsShad <- makeShaderSized "texture/simple" [vert, frag] [2, 2] 4 ETriangleStrip
-- note we directly poke the shader vertex data here -- note we directly poke the shader vertex data here
-- could possibly use an indirect draw call
pokeArray (shadVBOptr fsShad) $ concat cornerList pokeArray (shadVBOptr fsShad) $ concat cornerList
bloomBlurShad <- makeShaderUsingShaderVAO "texture/bloomBlur" [vert, frag] ETriangleStrip fsShad bloomBlurShad <- makeShaderUsingShaderVAO "texture/bloomBlur" [vert, frag] ETriangleStrip fsShad
+3
View File
@@ -30,6 +30,8 @@ divideSize :: Int -> Size -> Size
divideSize i (Size x y) = Size (div x $ fromIntegral i) (div y $ fromIntegral i) divideSize i (Size x y) = Size (div x $ fromIntegral i) (div y $ fromIntegral i)
-- | Determine where light is shining in the world. -- | Determine where light is shining in the world.
-- think of the produced texture as showing what RGB values should be "taken
-- away" from the shape colors.
createLightMap :: createLightMap ::
RenderData -> RenderData ->
[(Point3, Float, Point3)] -> -- Lights [(Point3, Float, Point3)] -> -- Lights
@@ -55,6 +57,7 @@ createLightMap pdata lightPoints nWalls nSils nCaps drawObjShads toPos drawCPUSh
-- we will not be changing that here -- we will not be changing that here
depthMask $= Disabled depthMask $= Disabled
-- clearColor is specified differently in preloadRender -- clearColor is specified differently in preloadRender
-- the colors are inverted
clearColor $= Color4 1 1 1 1 clearColor $= Color4 1 1 1 1
clear [ColorBuffer] clear [ColorBuffer]
-- for each of the lights: -- for each of the lights: