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