From 6a688736535f1f3d6eeae737dd89c88c5dcbab7c Mon Sep 17 00:00:00 2001 From: justin Date: Thu, 9 Mar 2023 14:13:05 +0000 Subject: [PATCH] Cleanup --- src/Shader/Compile.hs | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/src/Shader/Compile.hs b/src/Shader/Compile.hs index c79e2fee2..9cd4d3087 100644 --- a/src/Shader/Compile.hs +++ b/src/Shader/Compile.hs @@ -14,13 +14,6 @@ import Foreign import Foreign.C.String import GLHelp import Graphics.GL.Core45 -import Graphics.Rendering.OpenGL (vertexAttribPointer, AttribLocation (..), ($=) - , IntegerHandling (..) - , VertexArrayDescriptor (..) - , DataType (..) - , vertexAttribArray - , Capability (..) - ) import Shader.Data import Shader.Parameters @@ -185,20 +178,13 @@ setupVertexAttribPointer :: Int -> IO () setupVertexAttribPointer vao vbo loc siz strd off = do --- vertexAttribPointer (AttribLocation (fi loc)) --- $= (ToFloat, VertexArrayDescriptor (fi' siz) Float (fi'' $ floatSize * strd) (bufferOffset off)) --- vertexAttribArray (AttribLocation (fi loc)) $= Enabled glVertexArrayVertexBuffer vao 0 vbo 0 (fromIntegral $ floatSize * strd) glEnableVertexArrayAttrib vao loc' glVertexArrayAttribFormat vao loc' siz' GL_FLOAT GL_FALSE (fromIntegral $ floatSize * off) glVertexArrayAttribBinding vao loc' 0 where - loc' = fi loc - siz' = fi' siz - off' = fi'' off - fi = fromIntegral - fi' = fromIntegral - fi'' = fromIntegral + loc' = fromIntegral loc + siz' = fromIntegral siz makeShaderProgram :: String -> @@ -261,5 +247,3 @@ withByteString bs act = BU.unsafeUseAsCStringLen bs $ \(ptr, size) -> act (castPtr ptr) (fromIntegral size) -bufferOffset :: Integral a => a -> Ptr b -bufferOffset = plusPtr nullPtr . (* floatSize) . fromIntegral