summaryrefslogtreecommitdiff
path: root/chickadee/render/buffer.scm
Commit message (Collapse)AuthorAgeFilesLines
* Rename 'render' subdirectory to 'graphics'.David Thompson2020-10-031-605/+0
|
* render: Make apply-* procedures public.David Thompson2019-11-191-0/+2
|
* render: Collect all managed GPU state into a single record type.David Thompson2019-11-061-18/+10
|
* Update copyright year on sprite and buffer modules.David Thompson2019-05-161-1/+1
|
* render: Rename "typed buffer" to "buffer view".David Thompson2019-05-131-117/+117
| | | | | | | * chickadee/render/buffer.scm: s/typed-buffer/buffer-view/ * chickadee/render/shapes.scm: Same. * chickadee/render/sprite.scm: Same. * doc/api.texi: Same.
* render: buffer: Allow specifying read/write mode when mapping buffer.David Thompson2019-05-101-2/+5
| | | | * chickadee/render/buffer.scm (map-buffer!): Add optional 'mode' argument.
* render: buffer: Fix buffer orphaning for streaming buffers.David Thompson2019-05-101-4/+3
| | | | | * chickadee/render/buffer.scm (map-buffer!): Compare symbols to symbols for checking stream usage. -__-
* render: buffer: Don't attempt to map a buffer that is already mapped.David Thompson2019-05-091-10/+11
| | | | | * chickadee/render/buffer (map-buffer!): Do nothing if buffer is already mapped to avoid throwing an error.
* render: buffer: Add buffer-mapped? procedure.David Thompson2019-05-091-0/+5
| | | | * chickadee/render/buffer.scm (buffer-mapped?): New procedure.
* render: buffer: Improve docstrings.David Thompson2018-12-111-7/+64
|
* render: buffer: Add support for int and double component types.David Thompson2018-12-051-2/+6
| | | | | * chickadee/render/buffer.scm (component-type-size, typed-buffer-type-gl): Add int and double cases.
* render: buffer: Add render-vertices/instanced procedure.David Thompson2018-10-251-1/+12
| | | | * chickadee/render/buffer.scm (render-vertices/instanced): New procedure.
* render: buffer: Add divisor field to typed buffers.David Thompson2018-10-251-8/+18
| | | | | | | * chickadee/render/buffer.scm (<typed-buffer>)[divisor]: New field. (typed-buffer-divisor): New procedure. (make-typed-buffer, make-streaming-typed-buffer): Add #:divisor argument. (apply-typed-buffer): Setup vertex attribute divisor if there is one.
* render: buffer: Fix pointer argument to glVertexAttribPointer.David Thompson2018-09-061-4/+1
| | | | | | | | | | | | | | | | | 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.
* render: buffer: Use correct data type for index buffer when rendering.David Thompson2018-09-061-6/+6
| | | | | * chickadee/render/buffer.scm (render-vertices): Use the index buffer type rather than assuming it is always unsigned-int.
* render: buffer: Stop using glBufferSubData when creating VBOs.David Thompson2018-09-061-6/+3
| | | | | * chickadee/render/buffer.scm (make-buffer): Remove unnecessary call to glBufferSubData and just use glBufferData to do it all.
* render: buffer: Fixed default typed buffer length calculation.David Thompson2018-09-061-3/+14
| | | | | | * chickadee/render/buffer.scm (num-elements): New procedure. (make-typed-buffer): Default 'length' to the correct value in elements, not bytes, when a custom length is not specified.
* render: buffer: Orphan before mapping only when used for streaming.David Thompson2018-09-061-3/+4
| | | | | * chickdaee/render/buffer.scm (map-buffer!): Orphan buffer data only when the buffer usage is 'stream'.
* Major rewrite of vertex buffer and vertex array abstractions.David Thompson2017-09-131-0/+515