2020-12-14 07:00:06 +00:00
|
|
|
{-# LANGUAGE TypeFamilies #-}
|
2021-04-29 18:28:52 +00:00
|
|
|
module Graphics.Classes.Drawable where
|
2020-12-14 07:00:06 +00:00
|
|
|
|
2020-12-16 17:57:37 +00:00
|
|
|
import qualified Data.Vector as V
|
|
|
|
|
2020-12-14 07:00:06 +00:00
|
|
|
-- iternal imports
|
|
|
|
|
2021-04-29 18:28:52 +00:00
|
|
|
import Graphics.Types.VertexBuffer (Vertex)
|
2020-12-14 07:00:06 +00:00
|
|
|
|
|
|
|
-- | A typeclass for all drawable objects
|
|
|
|
class Drawable a where
|
|
|
|
|
2020-12-16 17:57:37 +00:00
|
|
|
-- -- | List type for resulting vertices and indices
|
|
|
|
-- type VertexList a :: * -> *
|
2020-12-14 07:00:06 +00:00
|
|
|
|
|
|
|
-- | converter function
|
2020-12-16 17:57:37 +00:00
|
|
|
-- toVertices :: a -> ((VertexList a) Word, (VertexList a) Vertex)
|
|
|
|
toVertices :: a -> (V.Vector Word, V.Vector Vertex)
|