1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-23 22:23:52 +00:00
openmw-tes3mp/apps/openmw/mwvr/openxrdebug.cpp
Christoph Haag b54e77a667 fix openmw non-vr build
../apps/openmw/mwphysics/movementsolver.cpp: In static member function ‘static void MWPhysics::MovementSolver::move(MWPhysics::ActorFrameData&, float, const btCollisionWorld*, MWPhysics::WorldFrameData&)’:
../apps/openmw/mwphysics/movementsolver.cpp:98:52: error: ‘getPlayer’ is not a member of ‘MWMechanics’
   98 |         const bool isPlayer = (ptr == MWMechanics::getPlayer());
      |                                                    ^~~~~~~~~
2020-10-30 23:29:24 +00:00

37 lines
1.2 KiB
C++

#include "openxrdebug.hpp"
#include "openxrmanagerimpl.hpp"
#include "vrenvironment.hpp"
// The OpenXR SDK's platform headers assume we've included these windows headers
#ifdef _WIN32
#include <Windows.h>
#include <objbase.h>
#elif __linux__
#include <X11/Xlib.h>
#include <GL/glx.h>
#undef None
#else
#error Unsupported platform
#endif
#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));
}
}