2020-12-06 07:14:50 +00:00
|
|
|
{-# LANGUAGE TypeFamilies #-}
|
|
|
|
{-# LANGUAGE FlexibleContexts #-}
|
|
|
|
{-# LANGUAGE AllowAmbiguousTypes #-}
|
2021-04-29 18:28:52 +00:00
|
|
|
module Graphics.Classes.VertexLayout where
|
2020-12-06 07:14:50 +00:00
|
|
|
|
|
|
|
import qualified Graphics.Rendering.OpenGL as GL
|
|
|
|
|
|
|
|
-- internal imports
|
|
|
|
|
2021-04-29 18:28:52 +00:00
|
|
|
import Graphics.Classes.Bindable
|
2020-12-06 07:14:50 +00:00
|
|
|
|
|
|
|
class (Bindable (VertBuffer v)) => VertexLayout v where
|
|
|
|
|
|
|
|
type VertBuffer v :: *
|
|
|
|
|
|
|
|
layoutElements :: v -> [(GL.GLuint, GL.VertexArrayDescriptor GL.GLfloat)]
|
|
|
|
|
|
|
|
addBuffer :: v -> VertBuffer v -> IO ()
|