Open Dominaezzz opened 5 years ago
May have to take this into my own hands and implement an ergonomic Buffer
class. One for each primitive type.
While possibly overkill, it might be worth looking into using okio
's Buffer
for this.
Hello! Thank you for your interest in this project.
okio.Buffer
is convenient but a bit too high level.
Every time a okio.Buffer
is passed to kgl, it would have to make an allocation, copy the contents of the buffer over and then give it to OpenGL/Vulkan.
Also, some APIs return a pointer which cannot be represented by okio.Buffer
since it uses "on-heap" memory.
I looked around and I don't think okio
has appropriate data structures for this.
okio
also doesn't support many native targets.
Yeah that makes sense, thanks for the explanation. I guess the best option for now is to roll your own implementation like you said since kotlinx-io
doesn't have exactly what you need (yet) and breaking changes are bound to happen.
kotlinx.io.core.IoBuffer
is going to be deprecated soon.kotlinx.io.bits.Memory
will be a a better substitute for representingvoid*
in kotlin.https://github.com/Kotlin/kotlinx-io/issues/39