st/oxr: Improve action space stubs.

This commit is contained in:
Ryan Pavlik 2019-04-05 17:28:36 -05:00
parent 0b2b99ca89
commit f533d737b9
2 changed files with 31 additions and 2 deletions

View file

@ -35,8 +35,16 @@ oxr_xrCreateActionSpace(XrAction action,
OXR_VERIFY_ARG_TYPE_AND_NULL(&log, createInfo,
XR_TYPE_ACTION_SPACE_CREATE_INFO);
//! @todo Implement
return oxr_error(&log, XR_ERROR_HANDLE_INVALID, " not implemented");
struct oxr_space* spc;
XrResult ret = oxr_space_action_create(&log, act, createInfo, &spc);
if (ret != XR_SUCCESS) {
return ret;
}
*space = oxr_space_to_openxr(spc);
return XR_SUCCESS;
}
static const XrReferenceSpaceType session_spaces[] = {

View file

@ -52,6 +52,27 @@ oxr_space_destroy(struct oxr_logger *log, struct oxr_handle_base *hb)
return XR_SUCCESS;
}
XrResult
oxr_space_action_create(struct oxr_logger *log,
struct oxr_action *act,
const XrActionSpaceCreateInfo *createInfo,
struct oxr_space **out_space)
{
struct oxr_space *spc = NULL;
OXR_ALLOCATE_HANDLE_OR_RETURN(log, spc, OXR_XR_DEBUG_SPACE,
oxr_space_destroy, &act->handle);
//! @todo implement more fully
oxr_warn(log, " not fully implemented");
spc->is_reference = false;
memcpy(&spc->pose, &createInfo->poseInActionSpace, sizeof(spc->pose));
*out_space = spc;
return XR_SUCCESS;
}
XrResult
oxr_space_reference_create(struct oxr_logger *log,
struct oxr_session *sess,