-
Notifications
You must be signed in to change notification settings - Fork 13
No conversion from cinterop types to Kotlin types done by code generator #13
Comments
Hi! Thanks for the interest in the project. |
By not-so-firendly low-level function do you mean the version of |
Yes, |
I started in the
Feel free to suggest any that could be added to the list. EDIT: I won't be touching primitive arrays just yet. |
I created some convenience functions for my own GL bindings and what I've done for primitive arrays for functions like glCreateBuffers is the following: fun glCreateBuffers(n: Int): UIntArray = UIntArray(n).apply {
usePinned { copengl.glCreateBuffers(n, it.addressOf(0)) }
}
fun glCreateBuffer(): UInt = glCreateBuffers(1).first() |
Are there any plans to use the Enums generated from the GL registry in the gl functions? |
Ah.... those. The enums are generated from the official gl.xml registry. The problem is the registry isn't exhaustive about enums, so it doesn't work very well. |
Functions like
glGetString
are generated with a return type ofCPointer<GLubyteVar>
rather thanString
. This requires a conversion using a!!.reinterpret<ByteVar>().toKString()
, which could be included in the generated code to make the kotlin-facing functions more kotlinic.The text was updated successfully, but these errors were encountered: