From 4bf5fa6b87726b49ce4abc7c9c10216276102e9e Mon Sep 17 00:00:00 2001 From: nek0 Date: Thu, 6 Feb 2020 14:41:06 +0100 Subject: [PATCH] blergh --- app/Classes/Renderable.hs | 11 +++++++++++ app/Types/Renderer.hs | 12 ++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) create mode 100644 app/Classes/Renderable.hs 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)] + }