Monado OpenXR Runtime
resources.hpp
Go to the documentation of this file.
1// Copyright 2023, Shawn Wallace
2// SPDX-License-Identifier: BSL-1.0
3/*!
4 * @file
5 * @brief OpenVR IVRResources interface header.
6 * @author Shawn Wallace <yungwallace@live.com>
7 * @ingroup drv_steamvr_lh
8 */
9
10#pragma once
11
12#include "openvr_driver.h"
13#include "util/u_logging.h"
14
15class Resources : public vr::IVRResources
16{
17 const u_logging_level log_level;
18 const std::string steamvr_install;
19
20public:
21 Resources(u_logging_level l, const std::string &steamvr_install)
22 : log_level(l), steamvr_install(steamvr_install){};
23 // ------------------------------------
24 // Shared Resource Methods
25 // ------------------------------------
26
27 /** Loads the specified resource into the provided buffer if large enough.
28 * Returns the size in bytes of the buffer required to hold the specified resource. */
29 uint32_t
30 LoadSharedResource(const char *pchResourceName, char *pchBuffer, uint32_t unBufferLen) override;
31
32 /** Provides the full path to the specified resource. Resource names can include named directories for
33 * drivers and other things, and this resolves all of those and returns the actual physical path.
34 * pchResourceTypeDirectory is the subdirectory of resources to look in. */
35 uint32_t
36 GetResourceFullPath(const char *pchResourceName,
37 const char *pchResourceTypeDirectory,
38 VR_OUT_STRING() char *pchPathBuffer,
39 uint32_t unBufferLen) override;
40};
Definition: resources.hpp:16
uint32_t LoadSharedResource(const char *pchResourceName, char *pchBuffer, uint32_t unBufferLen) override
Loads the specified resource into the provided buffer if large enough.
Definition: resources.cpp:17
uint32_t GetResourceFullPath(const char *pchResourceName, const char *pchResourceTypeDirectory, VR_OUT_STRING() char *pchPathBuffer, uint32_t unBufferLen) override
Provides the full path to the specified resource.
Definition: resources.cpp:23
u_logging_level
Logging level enum.
Definition: u_logging.h:40
Basic logging functionality.