This commit is contained in:
2023-03-10 09:39:40 +00:00
parent b1750ad028
commit dc3faeed63
8 changed files with 138 additions and 46 deletions
+4 -1
View File
@@ -85,7 +85,10 @@ data DebugBool
data ResFactor = FullRes | HalfRes | QuarterRes
deriving (Show, Eq, Ord, Enum, Bounded)
data ObjectShadows = GeoObjShads | CPUObjShads | NoObjShads
data ObjectShadows = GeoObjShads
| InstancingShads
| CPUObjShads
| NoObjShads
deriving (Show, Eq, Ord, Enum, Bounded)
data RoomClipping = NoRoomClipBoundaries | AllRoomClipBoundaries | IntersectingRoomClipBoundaries
+5 -4
View File
@@ -95,7 +95,8 @@ doDrawing win pdata u = do
(_eboPtr $ _silhouetteEBO pdata)
-- set the coordinate uniform ready for drawing elements using world coordinates
glBindBufferBase GL_UNIFORM_BUFFER 0 (pdata ^. matUBO)
bufferUBO (pdata ^. matUBO) $ perspectiveMatrixb rot camzoom trans wins viewFroms
withArray (perspectiveMatrixb rot camzoom trans wins viewFroms) $ \ptr ->
glNamedBufferSubData (pdata ^. matUBO) 0 64 ptr
setViewportSize (round winx `div` resFact) (round winy `div` resFact)
--bindFramebuffer Framebuffer $= fst (_fboBase pdata)
glBindFramebuffer GL_FRAMEBUFFER (_unFBO (fst (_fboBase pdata)))
@@ -317,9 +318,9 @@ fpsText x = color col $ text $ "ms/frame " ++ show x
--------------------------------------------------------------------------------
-- note: currently assume there is only one UBO, we only bind it once at setup
bufferUBO :: GLuint -> [Float] -> IO ()
bufferUBO ubo mat = withArray mat $ \ptr ->
glNamedBufferSubData ubo 0 64 ptr
--bufferUBO :: GLuint -> [Float] -> IO ()
--bufferUBO ubo mat = withArray mat $ \ptr ->
-- glNamedBufferSubData ubo 0 64 ptr
setViewportSize :: Int -> Int -> IO ()
setViewportSize x y =