diff options
author | David Thompson <dthompson2@worcester.edu> | 2018-09-06 09:34:46 -0400 |
---|---|---|
committer | David Thompson <dthompson2@worcester.edu> | 2018-09-06 09:34:46 -0400 |
commit | 749adfc4101d11784bf8207c2f6cbe6b8638dd13 (patch) | |
tree | c7e003957331c9c84d53b97e1b23a1f36fa5c0ed /guix.scm | |
parent | b3f98892edacce79525523984cb72eba2473f9e6 (diff) |
render: buffer: Fix pointer argument to glVertexAttribPointer.
This one was a doozy. Took me days to figure out why something wasn't
rendering properly and this was the culprit! The last argument, the
"pointer" argument, to glVertexAttribPointer is supposed to point to
the byte offset to start reading data from the VBO. I thought this
meant that I could pass a pointer to an integer that contained the
offset. WRONG! The pointer value itself must encode that offset.
You can see in the diff that I knew this code didn't work when the
offset was 0, but somehow a null pointer worked and I just made that
case work while leaving every other offset broken. The more I know!
* chickadee/render/buffer.scm (apply-typed-buffer): Pass a pointer
whose address is the byte offset of the buffer, rather than a
pointer whose dereferenced value is an integer representing the byte
offset.
Diffstat (limited to 'guix.scm')
0 files changed, 0 insertions, 0 deletions