Skip to content

Commit

Permalink
Plugins: Add functions for render target dimensions
Browse files Browse the repository at this point in the history
  • Loading branch information
praydog committed Feb 23, 2024
1 parent 8ea88a2 commit 54ef72d
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 3 deletions.
7 changes: 6 additions & 1 deletion include/uevr/API.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/CommitHash.hpp
Original file line number Diff line number Diff line change
@@ -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"
22 changes: 21 additions & 1 deletion src/mods/PluginLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
}

Expand Down Expand Up @@ -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
};


Expand Down

0 comments on commit 54ef72d

Please sign in to comment.