XRTraits C++ OpenXR Utilities
twocall-function-and-one-arg.cpp

This example shows how to use doTwoCall() when a function requires one additional argument.

The wrapper will make a call like the following as required to retrieve all properties (adjusting the parameters and array between calls):

{c++}
XrResult result = xrEnumerateInstanceExtensionProperties(nullptr,
capacityInput, &countOutput, array);

Note how the one additional argument, nullptr, has been forwarded to the call before the capacity, count, and array args.

// Copyright 2019, Collabora, Ltd.
// SPDX-License-Identifier: BSL-1.0
#include <iostream>
int main()
{
auto extensions = doTwoCall<XrExtensionProperties>(
xrEnumerateInstanceExtensionProperties, nullptr);
for (const auto& prop : extensions) {
std::cout << prop.extensionName << std::endl;
}
return 0;
}