-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathQuadTypes.hs
30 lines (24 loc) · 990 Bytes
/
QuadTypes.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
module QuadTypes ( RGBA(..)
, FillColor(..)
, QuadUV(..)
) where
-- Types shared between different modules generating / processing / storing quads for
-- OpenGL rendering. Put in their own module to reduce logical and compile time dependency
-- between them
data RGBA = RGBA {-# UNPACK #-} !Float
{-# UNPACK #-} !Float
{-# UNPACK #-} !Float
{-# UNPACK #-} !Float
deriving (Eq, Show)
data FillColor = FCWhite
| FCBlack
| FCSolid !RGBA
| FCBottomTopGradient !RGBA !RGBA
| FCLeftRightGradient !RGBA !RGBA
deriving (Eq, Show)
data QuadUV = QuadUVDefault
| QuadUV {-# UNPACK #-} !Float -- UV Bottom Left
{-# UNPACK #-} !Float
{-# UNPACK #-} !Float -- UV Top Right
{-# UNPACK #-} !Float
deriving (Eq, Show)