wisdom
Loading...
Searching...
No Matches
WisResult Struct Reference

Detailed Description

Specification


When an operation is performed, a WisResult structure is returned to indicate the outcome of the operation.

C version:

// Provided by Wisdom 0.7.0.
typedef struct WIS_NODISCARD WisResult {
WisStatus status;
int32_t platform_code;
const char* error;

C++ version:

namespace wis{
// Provided by Wisdom 0.7.0.
struct WIS_NODISCARD Result {
wis::Status status;
std::int32_t platform_code;
const char* error;
};
}

Members


  • status defines operation status. Compare with WisStatusOk.
  • platform_code indicates platform code from underlying implementation. Is an HRESULT for DX12 and a VkResult for Vulkan.
  • error specifies contains a human readable error message.

Description


To check if an operation succeeded, the return code is greater or equal to 0. Negative values indicate failure. Some operations may return positive codes other than WisStatusOk, indicating partial success, timeout or additional information about the operation. The structure also contains platform_code, which provides additional information about the result from the underlying graphics API.

error contains a human-readable error message, which may provide additional context about the failure. The message is static and must not be freed or modified.

Note
In C implementation, the structure is returned by value. In C++ implementation, because of RVO optimizations, most functions return wis::Result by reference.

See Also