Partial implementation of interleaving VBO

This commit is contained in:
jgk
2021-06-11 18:29:53 +02:00
parent a9aa2ca2cb
commit 0e0d8f4e99
2 changed files with 49 additions and 1 deletions
+12
View File
@@ -4,6 +4,7 @@ Datatypes used to setup and pass data to shaders.
-}
module Shader.Data
( VAO (..)
, VBO (..)
, FullShader (..)
, ShaderTexture (..)
-- | Lens functions
@@ -28,7 +29,18 @@ and its buffer targets. -}
data VAO = VAO
{ _vao :: VertexArrayObject
, _vaoBufferTargets :: [(BufferObject,Ptr Float,Int)]
, _vaoVBO :: VBO
}
{- | Vertex buffer object: contains the reference to the object,
a pointer to a location with space that can be written to the buffer,
and a list of attribute pointer sizes.
Vertex attributes are interleaved within the vbo. -}
data VBO = VBO
{ _vbo :: BufferObject
, _vboPoint :: Ptr Float
, _vboAttribSizes :: [Int] -- ^ It is not clear to me if this is necessary to store or not
}
{- | Datatype containing the necessary information for a single shader. -}
data FullShader a = FullShader
{ _shaderProgram :: Program