Tweak vbo again
This commit is contained in:
@@ -212,9 +212,11 @@ frag = FragmentShader
|
|||||||
|
|
||||||
pokeWPStrat :: RenderType -> [[[Float]]]
|
pokeWPStrat :: RenderType -> [[[Float]]]
|
||||||
pokeWPStrat Render22{_unRender22 = ((x,y),(z,w))} = [[[x,y,z,w]]]
|
pokeWPStrat Render22{_unRender22 = ((x,y),(z,w))} = [[[x,y,z,w]]]
|
||||||
|
pokeWPStrat _ = undefined
|
||||||
|
|
||||||
pokeWPColStrat :: RenderType -> [[[Float]]]
|
pokeWPColStrat :: RenderType -> [[[Float]]]
|
||||||
pokeWPColStrat Render22x4{_unRender22x4=(((x,y),(z,w)),(r,g,b,a))} = [[[x,y,z,w],[r,g,b,a]]]
|
pokeWPColStrat Render22x4{_unRender22x4=(((x,y),(z,w)),(r,g,b,a))} = [[[x,y,z,w],[r,g,b,a]]]
|
||||||
|
pokeWPColStrat _ = undefined
|
||||||
|
|
||||||
poke32 :: (Point3,Point2) -> [[[Float]]]
|
poke32 :: (Point3,Point2) -> [[[Float]]]
|
||||||
poke32 ((x,y,z),(a,b)) = [[[x,y,z],[a,b]]]
|
poke32 ((x,y,z),(a,b)) = [[[x,y,z],[a,b]]]
|
||||||
|
|||||||
@@ -85,6 +85,7 @@ overPos f (RenderText vs) = RenderText $ map (\(a,b,c) -> (f a,b,c)) vs
|
|||||||
overPos f (RenderBezQ vs) = RenderBezQ $ map (\(a,b,c) -> (f a,b,c)) vs
|
overPos f (RenderBezQ vs) = RenderBezQ $ map (\(a,b,c) -> (f a,b,c)) vs
|
||||||
overPos f (RenderEllipse vs) = RenderEllipse $ map (first f) vs
|
overPos f (RenderEllipse vs) = RenderEllipse $ map (first f) vs
|
||||||
overPos f (RenderArc (a,b,c)) = RenderArc (f a,b,c)
|
overPos f (RenderArc (a,b,c)) = RenderArc (f a,b,c)
|
||||||
|
overPos _ _ = undefined
|
||||||
|
|
||||||
overRot :: Float -> RenderType -> RenderType
|
overRot :: Float -> RenderType -> RenderType
|
||||||
{-# INLINE overRot #-}
|
{-# INLINE overRot #-}
|
||||||
@@ -99,6 +100,7 @@ overCol f (RenderEllipse vs) = RenderEllipse $ map (second f) vs
|
|||||||
overCol f (RenderText vs) = RenderText $ map (\(a,b,c) -> (a,f b,c)) vs
|
overCol f (RenderText vs) = RenderText $ map (\(a,b,c) -> (a,f b,c)) vs
|
||||||
overCol f (RenderBezQ vs) = RenderBezQ $ map (\(a,b,c) -> (a,f b,c)) vs
|
overCol f (RenderBezQ vs) = RenderBezQ $ map (\(a,b,c) -> (a,f b,c)) vs
|
||||||
overCol f (RenderArc (a,b,c)) = RenderArc (a,f b,c)
|
overCol f (RenderArc (a,b,c)) = RenderArc (a,f b,c)
|
||||||
|
overCol _ _ = undefined
|
||||||
|
|
||||||
overSca :: (Point2 -> Point2) -> RenderType -> RenderType
|
overSca :: (Point2 -> Point2) -> RenderType -> RenderType
|
||||||
{-# INLINE overSca #-}
|
{-# INLINE overSca #-}
|
||||||
|
|||||||
+1
-1
@@ -165,7 +165,7 @@ setupVBO sizes = do
|
|||||||
thePtr <- mallocArray (strd * numDrawableElements)
|
thePtr <- mallocArray (strd * numDrawableElements)
|
||||||
return $ VBO
|
return $ VBO
|
||||||
{ _vbo = vboName
|
{ _vbo = vboName
|
||||||
, _vboPoint = thePtr
|
, _vboPointer = thePtr
|
||||||
, _vboAttribSizes = sizes
|
, _vboAttribSizes = sizes
|
||||||
}
|
}
|
||||||
where
|
where
|
||||||
|
|||||||
+2
-1
@@ -9,6 +9,7 @@ module Shader.Data
|
|||||||
, ShaderTexture (..)
|
, ShaderTexture (..)
|
||||||
-- | Lens functions
|
-- | Lens functions
|
||||||
, vao
|
, vao
|
||||||
|
, vaoVBO
|
||||||
, vaoBufferTargets
|
, vaoBufferTargets
|
||||||
|
|
||||||
, shaderProgram
|
, shaderProgram
|
||||||
@@ -39,7 +40,7 @@ and a list of attribute pointer sizes.
|
|||||||
Vertex attributes are interleaved within the vbo. -}
|
Vertex attributes are interleaved within the vbo. -}
|
||||||
data VBO = VBO
|
data VBO = VBO
|
||||||
{ _vbo :: BufferObject
|
{ _vbo :: BufferObject
|
||||||
, _vboPoint :: Ptr Float
|
, _vboPointer :: Ptr Float
|
||||||
, _vboAttribSizes :: [Int] -- ^ It is not clear to me if this is necessary to store or not
|
, _vboAttribSizes :: [Int] -- ^ It is not clear to me if this is necessary to store or not
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user