This commit is contained in:
2025-11-14 11:48:00 +00:00
parent 91917dbddd
commit 9fc36ec54c
4 changed files with 168 additions and 185 deletions
+1 -2
View File
@@ -7,8 +7,7 @@ import Geometry
import Data.Aeson
import Data.Aeson.TH
data Distortion
= RadialDistortion Point2 Point2 Point2 Float
data Distortion = RadialDistortion Point2 Point2 Point2 Float
deriving (Eq, Ord, Show, Read) --Generic, Flat)
deriveJSON defaultOptions ''Distortion
-9
View File
@@ -1,13 +1,7 @@
module Shader.Compile (
-- makeShaderEBO,
makeShaderVBO,
-- makeShaderUsingVBO,
makeShaderProgram,
-- makeShaderUsingVAO,
-- setupVAOUsingVBO,
-- setupEBO,
toFloatVAs,
-- setupStaticVBOVAO,
makeSourcedShader,
) where
@@ -54,13 +48,10 @@ setupVBO vertexsize = do
-- unclear whether this should also be multiplied by floatSize
thePtr <- mallocBytes (vertexsize * numDrawableVertices)
-- Allocate space
--glNamedBufferData
glNamedBufferStorage
vboname
(fromIntegral $ floatSize * numDrawableVertices * vertexsize)
-- (fromIntegral $ numDrawableVertices * vertexsize)
nullPtr
--GL_STREAM_DRAW
GL_DYNAMIC_STORAGE_BIT
return VBO{_vboName = vboname, _vboPtr = thePtr, _vboVertexBytes = vertexsize}
+1 -2
View File
@@ -79,8 +79,7 @@ Vertex attributes are interleaved within the vbo.
data VBO = VBO
{ _vboName :: GLuint
, _vboPtr :: Ptr Float
, _vboVertexBytes :: Int
-- add int for AMOUNT of data poked!
, _vboVertexBytes :: Int -- size of one verx in bytes
}
data FloatBO = FloatBO