diff --git a/app/Classes/Renderable.hs b/app/Classes/Renderable.hs new file mode 100644 index 0000000..e6ee6e0 --- /dev/null +++ b/app/Classes/Renderable.hs @@ -0,0 +1,11 @@ +{-# LANGUAGE TypeFamilies #-} +module Classes.Renderable where + +class Renderable a where + type VertexObjects a :: * + + type ShaderObjects a :: * + + type RenderableInfo a :: * + + draw :: VertexObjects a -> ShaderObjects a -> RenderableInfo a -> IO () diff --git a/app/Types/Renderer.hs b/app/Types/Renderer.hs index f26df86..5342eba 100644 --- a/app/Types/Renderer.hs +++ b/app/Types/Renderer.hs @@ -5,11 +5,11 @@ import Graphics.Rendering.OpenGL as GL data RenderObjects = RenderObjects { roVAO :: GL.VertexArrayObject , roVBO :: GL.BufferObject - , shader :: } -class Renderable a where - type VertexObjects :: * - - draw = do - +data GL.Uniform u => ShaderObjects u = Shaderobjects + { soVertexShader :: GL.Shader + , soFragmentShader :: GL.Shader + , soProgram :: GL.Program + , soUniforms :: [(String, u)] + }