bind buffers before reading from them

This commit is contained in:
nek0 2020-12-07 16:02:57 +01:00
parent d0a9d342c7
commit 7142ce9b55
2 changed files with 2 additions and 0 deletions

View file

@ -68,6 +68,7 @@ instance Buffer IndexBuffer where
(fromIntegral currentBufSize `div`
sizeOf (undefined :: StoreType IndexBuffer))
$ \ (ptr :: Ptr (StoreType IndexBuffer)) -> do
bind buf
GL.bufferSubData
(target buf)
GL.ReadFromBuffer

View file

@ -98,6 +98,7 @@ instance Buffer VertexBuffer where
(fromIntegral currentBufSize `div`
sizeOf (undefined :: StoreType VertexBuffer))
$ \ (ptr :: Ptr (StoreType VertexBuffer)) -> do
bind buf
GL.bufferSubData
(target buf)
GL.ReadFromBuffer