Thanks, this solution looks a lot cleaner!
Would the function wrapping technique you mentioned work for mutable structs and other value types?
let num: UInt32 = 0
var glfwExtensionCount = [num]
let glfwExtensions = glfwGetRequiredInstanceExtensions(UnsafeMutablePointer(mutating: glfwExtensionCount));
gflwGetRequiredInstanceExtensions
is a C function that mutates glfwExtensionCount
. How should I pass this as an arg and access this after mutating it?
Sorry if this is an ultra basic question. If you can point me to a resource to learn about C ffi best practices/tips, I should be able to figure it out.