Set refresh rate on client
This commit is contained in:
@@ -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>
|
||||
{
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user