Implement texture atlas, details on why it works unclear

This commit is contained in:
2021-06-14 16:24:10 +02:00
parent f09fe8798e
commit 73bd407c49
16 changed files with 118 additions and 26 deletions
+6 -6
View File
@@ -1,8 +1,7 @@
{- |
Contains the central drawing functions for the dodge loop. -}
module Dodge.Render
( module Dodge.Render.Picture
, doDrawing
( doDrawing
)
where
import Dodge.Data
@@ -39,10 +38,8 @@ import Data.Tuple.Extra
import Graphics.Rendering.OpenGL hiding (color,scale,translate,rotate)
import qualified SDL
{- |
Central drawing function.
Returns a 'Word32' that should give the number of ticks it took to evaluate.
-}
{- | Central drawing function.
Returns a 'Word32' that should give the number of ticks it took to evaluate. -}
doDrawing :: RenderData -> World -> IO Word32
doDrawing pdata w = do
sTicks <- SDL.ticks
@@ -73,6 +70,9 @@ doDrawing pdata w = do
-- the depth buffer is ready to be drawn on
blendFuncSeparate $= ((SrcAlphaSaturate, OneMinusSrcAlpha), (Zero,One))
renderBackground pdata rot camzoom trans wins
_ <- renderShader (_textureArrayShader pdata) (_floorTiles w)
-- draw the walls
depthFunc $= Just Less
if w ^. config . wall_textured