-
-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Plugins: Add various render target functions
- Loading branch information
Showing
16 changed files
with
250 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#pragma once | ||
#define UEVR_COMMIT_HASH "f48ed675e2c1f8730b2a7ebfb9a1981c9a6ebf3d" | ||
#define UEVR_BUILD_DATE "20.02.2024" | ||
#define UEVR_COMMIT_HASH "c25695a8c0ec35b556229046cc7011e27f4d42ee" | ||
#define UEVR_BUILD_DATE "22.02.2024" | ||
#define UEVR_BUILD_TIME "00:00" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#include "uevr/API.h" | ||
|
||
#include "mods/VR.hpp" | ||
#include "FFakeStereoRenderingFunctions.hpp" | ||
|
||
namespace uevr { | ||
UEVR_FRHITexture2DHandle stereo_hook::get_scene_render_target() { | ||
const auto& vr = VR::get(); | ||
if (auto& hook = vr->get_fake_stereo_hook(); hook != nullptr) { | ||
auto rtm = hook->get_render_target_manager(); | ||
if (auto rtm = hook->get_render_target_manager(); rtm != nullptr) { | ||
return (UEVR_FRHITexture2DHandle)rtm->get_render_target(); | ||
} | ||
} | ||
|
||
return nullptr; | ||
} | ||
|
||
UEVR_FRHITexture2DHandle stereo_hook::get_ui_render_target() { | ||
const auto& vr = VR::get(); | ||
if (auto& hook = vr->get_fake_stereo_hook(); hook != nullptr) { | ||
auto rtm = hook->get_render_target_manager(); | ||
if (auto rtm = hook->get_render_target_manager(); rtm != nullptr) { | ||
return (UEVR_FRHITexture2DHandle)rtm->get_ui_target(); | ||
} | ||
} | ||
|
||
return nullptr; | ||
} | ||
|
||
UEVR_FFakeStereoRenderingHookFunctions stereo_hook::functions { | ||
&stereo_hook::get_scene_render_target, | ||
&stereo_hook::get_ui_render_target | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#pragma once | ||
|
||
#include "uevr/API.h" | ||
|
||
namespace uevr { | ||
namespace stereo_hook { | ||
UEVR_FRHITexture2DHandle get_scene_render_target(); | ||
UEVR_FRHITexture2DHandle get_ui_render_target(); | ||
|
||
extern UEVR_FFakeStereoRenderingHookFunctions functions; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#include <sdk/StereoStuff.hpp> | ||
|
||
#include "FRHITexture2DFunctions.hpp" | ||
|
||
namespace uevr { | ||
namespace frhitexture2d { | ||
void* get_native_resource(UEVR_FRHITexture2DHandle handle) { | ||
const auto texture = (::FRHITexture2D*)handle; | ||
|
||
if (texture == nullptr) { | ||
return nullptr; | ||
} | ||
|
||
return texture->get_native_resource(); | ||
} | ||
|
||
UEVR_FRHITexture2DFunctions functions { | ||
&uevr::frhitexture2d::get_native_resource | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#pragma once | ||
|
||
#include "uevr/API.h" | ||
|
||
namespace uevr { | ||
namespace frhitexture2d { | ||
void* get_native_resource(UEVR_FRHITexture2DHandle handle); | ||
|
||
extern UEVR_FRHITexture2DFunctions functions; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#include "../mods/VR.hpp" | ||
#include "FRenderTargetPoolHook.hpp" | ||
|
||
namespace uevr { | ||
void render_target_pool_hook::activate() { | ||
const auto& vr = VR::get(); | ||
if (auto& hook = vr->get_render_target_pool_hook(); hook != nullptr) { | ||
hook->activate(); | ||
} | ||
} | ||
|
||
UEVR_IPooledRenderTargetHandle render_target_pool_hook::get_render_target(const wchar_t* name) { | ||
const auto& vr = VR::get(); | ||
if (auto& hook = vr->get_render_target_pool_hook(); hook != nullptr) { | ||
return (UEVR_IPooledRenderTargetHandle)hook->get_render_target(name); | ||
} | ||
|
||
return nullptr; | ||
} | ||
|
||
UEVR_FRenderTargetPoolHookFunctions render_target_pool_hook::functions { | ||
&render_target_pool_hook::activate, | ||
&render_target_pool_hook::get_render_target | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#pragma once | ||
|
||
#include "uevr/API.h" | ||
|
||
namespace uevr { | ||
namespace render_target_pool_hook { | ||
void activate(); | ||
UEVR_IPooledRenderTargetHandle get_render_target(const wchar_t* name); | ||
extern UEVR_FRenderTargetPoolHookFunctions functions; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.