Move shape parameters into separate file
This commit is contained in:
@@ -8,12 +8,10 @@
|
||||
|
||||
module Shape.Data where
|
||||
|
||||
import Foreign.Storable
|
||||
import Control.Lens
|
||||
import Data.Aeson
|
||||
import Data.Aeson.TH
|
||||
import Geometry.Data
|
||||
import Data.Word
|
||||
|
||||
data ShapeType
|
||||
= FlatFaces { _topBoxSize :: Int }
|
||||
@@ -54,7 +52,6 @@ makeLenses ''ShapeType
|
||||
|
||||
type Shape = [Surface]
|
||||
|
||||
shapeVerxSize = sizeOf (0 :: Float) * 8 + 4 * sizeOf (0 :: Word8)
|
||||
|
||||
--nShapeVerxComp :: Int
|
||||
--nShapeVerxComp = sum shapeVerxSizes
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
module Shape.Parameters
|
||||
where
|
||||
|
||||
import Shader.Parameters
|
||||
import Shader.Data
|
||||
import Data.Word
|
||||
import Foreign.Storable
|
||||
import Graphics.GL.Core45
|
||||
|
||||
shapeVerxSize :: Int
|
||||
shapeVerxSize = sizeOf (0 :: Float) * 8 + 4 * sizeOf (0 :: Word8)
|
||||
|
||||
shapeVerxAttributes :: [VertexAttribute]
|
||||
shapeVerxAttributes =
|
||||
[VertexAttribute 4 GL_FLOAT GL_FALSE 0
|
||||
,VertexAttribute 4 GL_UNSIGNED_BYTE GL_TRUE (fromIntegral (4 :: Int) * fromIntegral floatSize)
|
||||
,VertexAttribute 4 GL_FLOAT GL_FALSE (fromIntegral (4 :: Int) * fromIntegral (floatSize + ubyteSize))
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user