Draw to fullscreen using one triangle

This commit is contained in:
2025-11-23 22:26:06 +00:00
parent 5f29c20d39
commit 65d7b93a32
2 changed files with 31 additions and 11 deletions
+11 -1
View File
@@ -42,7 +42,8 @@ preloadRender = do
glBindBufferBase GL_UNIFORM_BUFFER 1 lightubo
fulltexbo <- mglCreate glCreateBuffers
let ftsize = fromIntegral $ sizeOf (0::Float) * 6 * 4
--let ftsize = fromIntegral $ sizeOf (0::Float) * 6 * 4
let ftsize = fromIntegral $ sizeOf (0::Float) * 3 * 4
withArray cornerList $ \ptr ->
glNamedBufferStorage fulltexbo ftsize ptr 0
glBindBufferBase GL_UNIFORM_BUFFER 2 fulltexbo
@@ -226,6 +227,15 @@ preloadRender = do
--------------------end preloadRender
cornerList :: [Float]
cornerList = concat
[ bl, br, tl
]
where
bl = [-1, -1, 0, 0]
br = [ 3, -1, 2, 0]
tl = [-1, 3, 0, 2]
cornerList' :: [Float]
cornerList' = concat
[ bl, br, tl
, tl, br, tr
]