Files
loop/src/Shader/Parameters.hs
T

42 lines
844 B
Haskell

module Shader.Parameters
( floatSize
, ubyteSize
, numDrawableVertices
, numSubElements
, glushortSize
, numGLushort
) where
--import Picture.Data
import Graphics.GL.Core45
import Foreign
ubyteSize :: Int
ubyteSize = sizeOf (5 :: Word8)
{-# INLINE ubyteSize #-}
floatSize :: Int
floatSize = sizeOf (0.5 :: GLfloat)
{-# INLINE floatSize #-}
--intSize :: Int
--intSize = sizeOf (1 :: GLuint)
--{-# INLINE intSize #-}
glushortSize :: Int
glushortSize = sizeOf (0 :: GLushort)
{-# INLINE glushortSize #-}
numGLushort :: Int
numGLushort = fromIntegral (maxBound :: GLushort) + 1
{-# INLINE numGLushort #-}
-- why 6?
numDrawableVertices :: Int
{-# INLINE numDrawableVertices #-}
numDrawableVertices = 6 * numSubElements
-- why this number?
numSubElements :: Int
{-# INLINE numSubElements #-}
numSubElements = 65536