Implement static VBO/VAO

This commit is contained in:
2023-04-13 00:03:15 +01:00
parent 9bb1a22ea5
commit 36734c7af5
2 changed files with 29 additions and 23 deletions
+9 -8
View File
@@ -124,14 +124,15 @@ preloadRender = do
--initTexture2DArray 50 "data/texture/charMapVertBig.png" 2 32 64 95 GL_LINEAR_MIPMAP_NEAREST GL_LINEAR
putStrLn "Setup full screen shaders"
screentexturevbo <- mglCreate glCreateBuffers
withArray (concat cornerList) $ \ptr ->
glNamedBufferStorage
screentexturevbo
(fromIntegral $ floatSize * length (concat cornerList))
ptr
0
screentexturevao <- setupVAOvbo (toFloatVAs [2, 2]) 4 screentexturevbo
-- screentexturevbo <- mglCreate glCreateBuffers
-- withArray (concat cornerList) $ \ptr ->
-- glNamedBufferStorage
-- screentexturevbo
-- (fromIntegral $ floatSize * length (concat cornerList))
-- ptr
-- 0
-- screentexturevao <- setupVAOvbo (toFloatVAs [2, 2]) 4 screentexturevbo
(_,screentexturevao) <- setupStaticVBO (toFloatVAs [2,2]) (concat cornerList)
alphadivideshader <- makeShaderUsingVAO "texture2D/alphaDivide" [vert, frag] pmTriangleStrip screentexturevao
fsShad <- makeShaderUsingVAO "texture/simple" [vert, frag] pmTriangleStrip screentexturevao
bloomBlurShad <- makeShaderUsingVAO "texture/bloomBlur" [vert, frag] pmTriangleStrip screentexturevao