From eab27776cffdd7b208cd313ff514940591eb0ffe Mon Sep 17 00:00:00 2001 From: justin Date: Thu, 9 Mar 2023 14:12:07 +0000 Subject: [PATCH] Set up vertex attributes using DSA --- src/Shader/Compile.hs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/Shader/Compile.hs b/src/Shader/Compile.hs index 554f4d4f7..c79e2fee2 100644 --- a/src/Shader/Compile.hs +++ b/src/Shader/Compile.hs @@ -185,10 +185,17 @@ 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 +-- 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