mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-29 03:45:32 +00:00
28 lines
1.1 KiB
C++
28 lines
1.1 KiB
C++
|
#include "openxrdebug.hpp"
|
||
|
#include "openxrmanagerimpl.hpp"
|
||
|
#include "vrenvironment.hpp"
|
||
|
|
||
|
// The OpenXR SDK's platform headers assume we've included these windows headers
|
||
|
#include <Windows.h>
|
||
|
#include <objbase.h>
|
||
|
|
||
|
#include <openxr/openxr_platform.h>
|
||
|
#include <openxr/openxr_platform_defines.h>
|
||
|
#include <openxr/openxr_reflection.h>
|
||
|
|
||
|
void MWVR::VrDebug::setName(uint64_t handle, XrObjectType type, const std::string& name)
|
||
|
{
|
||
|
auto& xrManager = Environment::get().getManager()->impl();
|
||
|
if (xrManager.xrExtensionIsEnabled(XR_EXT_DEBUG_UTILS_EXTENSION_NAME))
|
||
|
{
|
||
|
XrDebugUtilsObjectNameInfoEXT nameInfo{ XR_TYPE_DEBUG_UTILS_OBJECT_NAME_INFO_EXT, nullptr };
|
||
|
nameInfo.objectHandle = handle;
|
||
|
nameInfo.objectType = type;
|
||
|
nameInfo.objectName = name.c_str();
|
||
|
|
||
|
static PFN_xrSetDebugUtilsObjectNameEXT setDebugUtilsObjectNameEXT
|
||
|
= reinterpret_cast<PFN_xrSetDebugUtilsObjectNameEXT>(xrManager.xrGetFunction("xrSetDebugUtilsObjectNameEXT"));
|
||
|
CHECK_XRCMD(setDebugUtilsObjectNameEXT(xrManager.xrInstance(), &nameInfo));
|
||
|
}
|
||
|
}
|