Cleanup
This commit is contained in:
@@ -116,7 +116,7 @@ setupStaticVBOVAO vas vdata = withArrayLen vdata $ \i ptr -> do
|
||||
setupVBOStatic :: Int -> IO VBO
|
||||
setupVBOStatic vertexsize = do
|
||||
vboname <- mglCreate glCreateBuffers
|
||||
thePtr <- mallocArray (vertexsize * numDrawableVertices)
|
||||
thePtr <- mallocBytes (vertexsize * numDrawableVertices)
|
||||
-- Allocate space
|
||||
glNamedBufferData
|
||||
vboname
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
module Shader.Poke.Floor (
|
||||
pokeTile,
|
||||
pokeChasm,
|
||||
) where
|
||||
|
||||
import Control.Monad
|
||||
@@ -19,3 +20,12 @@ pokeTileVerx tangent tilez ptr i (V2 x y, V2 s t) = do
|
||||
let a = argV tangent
|
||||
zipWithM_ (\off -> pokeElemOff ptr (i * 8 + off)) [0 ..] [x, y, 1, 1, s, t, tilez, a]
|
||||
return $ i + 1
|
||||
|
||||
pokeChasm :: Ptr Float -> Int -> [Point2] -> IO Int
|
||||
pokeChasm ptr i ps =
|
||||
foldM (pokeChasmVerx ptr) i $ polyToTris ps
|
||||
|
||||
pokeChasmVerx :: Ptr Float -> Int -> Point2 -> IO Int
|
||||
pokeChasmVerx ptr i (V2 x y) = do
|
||||
zipWithM_ (\off -> pokeElemOff ptr (i * 3 + off)) [0 ..] [x, y, 0]
|
||||
return $ i + 1
|
||||
|
||||
Reference in New Issue
Block a user