Add uniform buffer window coordinate matrix
This commit is contained in:
+9
-10
@@ -57,14 +57,6 @@ doDrawing pdata w = do
|
||||
wallPoints = map fst wallPointsCol
|
||||
|
||||
let pmat = perspectiveMatrixb rot camzoom trans wins viewFroms
|
||||
pmata <- (newMatrix RowMajor $ perspectiveMatrix rot camzoom trans wins viewFroms) :: IO (GLmatrix GLfloat)
|
||||
|
||||
-- withMatrix pmata $ \_ ptr ->
|
||||
-- bufferData UniformBuffer $=
|
||||
-- (fromIntegral $ sizeOf (head pmat) * length pmat
|
||||
-- ,ptr
|
||||
-- ,StreamDraw
|
||||
-- )
|
||||
withArray pmat $ \ptr ->
|
||||
bufferData UniformBuffer $=
|
||||
(fromIntegral $ sizeOf (head pmat) * length pmat
|
||||
@@ -72,8 +64,6 @@ doDrawing pdata w = do
|
||||
,StreamDraw
|
||||
)
|
||||
|
||||
-- bufferData UniformBuffer $=
|
||||
|
||||
-- set the coordinate uniforms ready for drawing elements using world coordinates
|
||||
--setIsoMatrixUniforms pdata rot camzoom trans wins
|
||||
setPerpMatrixUniforms pdata rot camzoom trans wins viewFroms
|
||||
@@ -145,6 +135,15 @@ doDrawing pdata w = do
|
||||
-- reset the coordinate uniforms for pictures that are drawn wrt to window
|
||||
-- coordinates
|
||||
resetShaderUniforms (map extractProgAndUnis $ _pictureShaders pdata)
|
||||
|
||||
let pmata = perspectiveMatrixc 0 1 (0,0) (2,2)
|
||||
withArray pmata $ \ptr ->
|
||||
bufferData UniformBuffer $=
|
||||
(fromIntegral $ sizeOf (head pmat) * length pmat
|
||||
,ptr
|
||||
,StreamDraw
|
||||
)
|
||||
|
||||
blendFunc $= (SrcAlpha,OneMinusSrcAlpha)
|
||||
_ <- renderFoldable pdata (picToLTree Nothing $ fixedCoordPictures w)
|
||||
eTicks <- SDL.ticks
|
||||
|
||||
Reference in New Issue
Block a user