Continue render refactor
This commit is contained in:
+17
-16
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user