haskell-opengl / OpenGL

Haskell bindings to OpenGL
http://www.haskell.org/haskellwiki/OpenGL
BSD 3-Clause "New" or "Revised" License
147 stars 26 forks source link

Binding texture buffers #91

Open gilgamec opened 2 years ago

gilgamec commented 2 years ago

The current bindings have 'nice' ways to create and bind texture buffers, but no way that I can see to actually link one with a buffer object, i.e. glTexBuffer or glTexBufferRange. As nearly as I can tell, this should be straightforward, perhaps as simple as

texBuffer :: SettableStateVar (PixelInternalFormat, BufferObject)
texBuffer = makeSettableStateVar $ \(fmt,tbo) ->
  glTexBuffer (marshalBufferTarget TextureBuffer)
              (marshalPixelInternalFormat fmt)
              (bufferID tbo)

modulo available exports.