Set refresh rate on client

This commit is contained in:
Patrick Nicolas
2024-02-03 10:05:54 +01:00
parent c6cc5652a1
commit 6f29061ace
7 changed files with 26 additions and 4 deletions
+1
View File
@@ -44,6 +44,7 @@ union event
XrEventDataInteractionProfileChanged interaction_profile_changed;
XrEventDataReferenceSpaceChangePending space_changed_pending;
XrEventDataSessionStateChanged state_changed;
XrEventDataDisplayRefreshRateChangedFB refresh_rate_changed;
};
class instance : public utils::handle<XrInstance>
{
+8
View File
@@ -233,6 +233,14 @@ std::vector<float> xr::session::get_refresh_rates()
return {};
}
void xr::session::set_refresh_rate(float refresh_rate)
{
static auto xrRequestDisplayRefreshRateFB = inst->get_proc<PFN_xrRequestDisplayRefreshRateFB>("xrRequestDisplayRefreshRateFB");
if (xrRequestDisplayRefreshRateFB)
CHECK_XR(xrRequestDisplayRefreshRateFB(id, refresh_rate));
}
void xr::session::sync_actions(std::span<XrActionSet> action_sets)
{
std::vector<XrActiveActionSet> active_action_sets(action_sets.size());
+1
View File
@@ -69,6 +69,7 @@ public:
float get_current_refresh_rate();
std::vector<float> get_refresh_rates();
void set_refresh_rate(float);
void sync_actions(XrActionSet action_set, XrPath subaction_path = XR_NULL_PATH);
void sync_actions(XrActionSet action_set, const std::string & subaction_path);