Continue render refactor

This commit is contained in:
2023-03-14 14:11:14 +00:00
parent 35f401d8c8
commit 378af69ca5
12 changed files with 118 additions and 112 deletions
+17 -16
View File
@@ -17,22 +17,23 @@ import Shader.Parameters
import Shape.Data
drawCPUShadows :: RenderData -> Shape -> Point3 -> Float -> IO ()
drawCPUShadows pdata s pos rad = do
let theshad = pdata ^. positionalBlankShader
theptr = _vboPtr $ _vaoVBO $ _shadVAO' theshad
i <- VFSM.foldlM' (pokeShapeShad pos rad theptr) 0 $ VFSM.fromList s
glBufferSubData
(theshad ^. shadVAO' . vaoVBO . vboName)
0
(fromIntegral $ floatSize * i)
(theshad ^. shadVAO' . vaoVBO . vboPtr)
glUseProgram (theshad ^. shadName)
glBindVertexArray . _vaoName $ _shadVAO' theshad
glDrawArrays
(marshalEPrimitiveMode $ _shadPrim' theshad)
0
(fromIntegral i)
return ()
drawCPUShadows _ _ _ _ = return ()
--drawCPUShadows pdata s pos rad = do
-- let theshad = pdata ^. positionalBlankShader
-- theptr = _vboPtr $ _vaoVBO $ _shadVAO' theshad
-- i <- VFSM.foldlM' (pokeShapeShad pos rad theptr) 0 $ VFSM.fromList s
-- glBufferSubData
-- (theshad ^. shadVAO' . vaoVBO . vboName)
-- 0
-- (fromIntegral $ floatSize * i)
-- (theshad ^. shadVAO' . vaoVBO . vboPtr)
-- glUseProgram (theshad ^. shadName)
-- glBindVertexArray . _vaoName $ _shadVAO' theshad
-- glDrawArrays
-- (marshalEPrimitiveMode $ _shadPrim' theshad)
-- 0
-- (fromIntegral i)
-- return ()
pokeShapeShad :: Point3 -> Float -> Ptr Float -> Int -> ShapeObj -> IO Int
pokeShapeShad pos r theptr i so = do