From 54ef72d539578f581bc30358cab337f332868404 Mon Sep 17 00:00:00 2001 From: praydog Date: Thu, 22 Feb 2024 16:13:55 -0800 Subject: [PATCH] Plugins: Add functions for render target dimensions --- include/uevr/API.h | 7 ++++++- src/CommitHash.hpp | 2 +- src/mods/PluginLoader.cpp | 22 +++++++++++++++++++++- 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/include/uevr/API.h b/include/uevr/API.h index 2f08c709..9b743d09 100644 --- a/include/uevr/API.h +++ b/include/uevr/API.h @@ -36,7 +36,7 @@ SOFTWARE. #define UEVR_OUT #define UEVR_PLUGIN_VERSION_MAJOR 2 -#define UEVR_PLUGIN_VERSION_MINOR 14 +#define UEVR_PLUGIN_VERSION_MINOR 15 #define UEVR_PLUGIN_VERSION_PATCH 0 #define UEVR_RENDERER_D3D11 0 @@ -488,6 +488,11 @@ typedef struct { void (*set_aim_method)(unsigned int method); bool (*is_aim_allowed)(); void (*set_aim_allowed)(bool allowed); + + unsigned int (*get_hmd_width)(); + unsigned int (*get_hmd_height)(); + unsigned int (*get_ui_width)(); + unsigned int (*get_ui_height)(); } UEVR_VRData; typedef struct { diff --git a/src/CommitHash.hpp b/src/CommitHash.hpp index 7253ae36..ce7496ee 100644 --- a/src/CommitHash.hpp +++ b/src/CommitHash.hpp @@ -1,4 +1,4 @@ #pragma once -#define UEVR_COMMIT_HASH "c25695a8c0ec35b556229046cc7011e27f4d42ee" +#define UEVR_COMMIT_HASH "8ea88a21f29557e9f4d49266af173c1500d95733" #define UEVR_BUILD_DATE "22.02.2024" #define UEVR_BUILD_TIME "00:00" diff --git a/src/mods/PluginLoader.cpp b/src/mods/PluginLoader.cpp index 9342a779..5fb03807 100644 --- a/src/mods/PluginLoader.cpp +++ b/src/mods/PluginLoader.cpp @@ -993,6 +993,22 @@ bool is_aim_allowed() { void set_aim_allowed(bool allowed) { VR::get()->set_aim_allowed(allowed); } + +unsigned int get_hmd_width() { + return VR::get()->get_hmd_width(); +} + +unsigned int get_hmd_height() { + return VR::get()->get_hmd_height(); +} + +unsigned int get_ui_width() { + return (unsigned int)g_framework->get_rt_size().x; +} + +unsigned int get_ui_height() { + return (unsigned int)g_framework->get_rt_size().y; +} } } @@ -1032,7 +1048,11 @@ UEVR_VRData g_vr_data { uevr::vr::get_aim_method, uevr::vr::set_aim_method, uevr::vr::is_aim_allowed, - uevr::vr::set_aim_allowed + uevr::vr::set_aim_allowed, + uevr::vr::get_hmd_width, + uevr::vr::get_hmd_height, + uevr::vr::get_ui_width, + uevr::vr::get_ui_height };