Map an "isometric" matrix to a static buffer
This commit is contained in:
+10
-1
@@ -5,6 +5,8 @@ module Preload.Render (
|
||||
cleanUpRenderPreload,
|
||||
) where
|
||||
|
||||
import Geometry.Data
|
||||
import MatrixHelper
|
||||
import GLHelp
|
||||
import Control.Lens
|
||||
import Control.Monad
|
||||
@@ -29,6 +31,12 @@ preloadRender = do
|
||||
theUBO <- mglCreate glCreateBuffers
|
||||
glNamedBufferData theUBO 64 nullPtr GL_STREAM_DRAW
|
||||
glBindBufferBase GL_UNIFORM_BUFFER 0 theUBO
|
||||
|
||||
isoUBO <- mglCreate glCreateBuffers
|
||||
withArray (isoMatrix 0 1 (V2 0 0) (V2 2 2)) $ \ptr ->
|
||||
glNamedBufferStorage isoUBO 64 ptr 0
|
||||
glBindBufferBase GL_UNIFORM_BUFFER 1 theUBO
|
||||
|
||||
-- setup wall points VBO, VAOs and shaders
|
||||
wpVBOname <- mglCreate glCreateBuffers
|
||||
wpVBOptr <- mallocArray (8 * numDrawableWalls)
|
||||
@@ -170,7 +178,7 @@ preloadRender = do
|
||||
>>= addTextureArray "data/texture/ayene_wooden_floor_transformed.png"
|
||||
-- >>= addTextureArray "data/texture/ayene_wooden_floor.png"
|
||||
-- bind fixed vertex data
|
||||
bindShaderBuffers' [fsShad] [4, 4]
|
||||
bindShaderBuffers [fsShad] [4, 4]
|
||||
framebuf2 <- setupTextureFramebuffer 800 600
|
||||
framebuf3 <- setupTextureFramebuffer 800 600
|
||||
|
||||
@@ -248,6 +256,7 @@ preloadRender = do
|
||||
, _fboPos = fboPosName
|
||||
, _rboBaseBloom = rboBaseBloomName
|
||||
, _matUBO = theUBO
|
||||
, _isoMatUBO = isoUBO
|
||||
}
|
||||
|
||||
--------------------end preloadRender
|
||||
|
||||
Reference in New Issue
Block a user