Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static std::string get_last_error()
- {
- int buffer_length;
- HAPI_GetStatusStringBufLength(
- nullptr, HAPI_STATUS_CALL_RESULT, HAPI_STATUSVERBOSITY_ERRORS, &buffer_length);
- char* buf = new char[buffer_length];
- HAPI_GetStatusString(nullptr, HAPI_STATUS_CALL_RESULT, buf, buffer_length);
- std::string result(buf);
- delete[] buf;
- return result;
- }
- #define ENSURE_SUCCESS( result ) \
- if ( (result) != HAPI_RESULT_SUCCESS ) \
- { \
- std::cout << "failure at " << __FILE__ << ":" << __LINE__ << std::endl; \
- std::cout << get_last_error() << std::endl; \
- exit( 1 ); \
- }
- get_last_cook_error()
- {
- int buffer_length;
- HAPI_GetStatusStringBufLength(
- nullptr,
- HAPI_STATUS_COOK_RESULT, HAPI_STATUSVERBOSITY_ERRORS, &buffer_length);
- char* buf = new char[buffer_length];
- HAPI_GetStatusString(
- nullptr, HAPI_STATUS_CALL_RESULT, buf, buffer_length);
- std::string result(buf);
- delete[] buf;
- return result;
- }
- #define ENSURE_COOK_SUCCESS( result ) \
- if ( (result) != HAPI_STATE_READY ) \
- { \
- std::cout << "failure at " << __FILE__ << ":" << __LINE__ << std::endl; \
- std::cout << get_last_cook_error() << std::endl; \
- exit( 1 ); \
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement