예제 #1
0
파일: OVR_CAPI.cpp 프로젝트: DJoser/minko
OVR_EXPORT ovrBool ovrHmd_AttachToWindow( ovrHmd hmd, void* window,
                                         const ovrRecti* destMirrorRect,
                                         const ovrRecti* sourceRenderTargetRect )
{
    OVR_UNUSED( destMirrorRect );
    OVR_UNUSED( sourceRenderTargetRect );

    if (!CAPI_ovrInitializeCalled)
        return false;

    if (!hmd || !hmd->Handle)
        return false;
#ifndef OVR_OS_MAC
    HMDState* hmds = (HMDState*)hmd->Handle;
    CAPI_pNetClient->Hmd_AttachToWindow(hmds->GetNetId(), window);
    hmds->pWindow = window;
#endif
#ifdef OVR_OS_WIN32
    Win32::DisplayShim::GetInstance().hWindow = (HWND)window;
#endif
#ifdef OVR_OS_MAC
    OVR_UNUSED(window);
#endif

    return true;
}
예제 #2
0
OVR_EXPORT const char* ovrHmd_GetLastError(ovrHmd hmddesc)
{
    if (!CAPI_ovrInitializeCalled)
    {
        return "System initialize not called";
    }

    if (hmddesc && hmddesc->Handle)
    {
        HMDState* p = (HMDState*)hmddesc->Handle;
        return CAPI_pNetClient->Hmd_GetLastError(p->GetNetId());
    }

	return "Uninitialized Hmd";
}
예제 #3
0
파일: OVR_CAPI.cpp 프로젝트: DJoser/minko
OVR_EXPORT const char* ovrHmd_GetLastError(ovrHmd hmddesc)
{
    if (!CAPI_ovrInitializeCalled)
    {
        return "System initialize not called";
    }

    VirtualHmdId netId = InvalidVirtualHmdId;

    if (hmddesc && hmddesc->Handle)
    {
        HMDState* p = (HMDState*)hmddesc->Handle;
        netId = p->GetNetId();
    }

    return CAPI_pNetClient->Hmd_GetLastError(netId);
}