cmbruns / pyopenxr

Unofficial python bindings for OpenXR access to VR and AR devices
Apache License 2.0
112 stars 9 forks source link

Output buffer construction in functions needs work #22

Closed cmbruns closed 3 years ago

cmbruns commented 3 years ago

.make_array() is called on too many inappropriate objects.

cmbruns commented 3 years ago

This might be a more general and canonical array construction pattern:

# Use the default constructor to initialize each array member
N = 4
initialized_array = (MyStructure * N)(*([MyStructure()] * N))

That's a lot of punctuation to unpack, but this would be an implementation detail inside the python function definitions.