Skip to content

Commit

Permalink
feat: add dynres status to state
Browse files Browse the repository at this point in the history
  • Loading branch information
alandtse committed Oct 4, 2024
1 parent d440ac5 commit c3658ad
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/State.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,13 @@ void State::SetupResources()
renderer->GetRuntimeData().renderTargets[RE::RENDER_TARGETS::kMAIN].texture->GetDesc(&texDesc);

isVR = REL::Module::IsVR();
auto ini = RE::INISettingCollection::GetSingleton();
if (ini) {
auto setting = ini->GetSetting("bEnableAutoDynamicResolution:Display");
dynamicResolutionEnabled = setting ? setting->GetBool() : false;
} else {
dynamicResolutionEnabled = false;
}
screenSize = { (float)texDesc.Width, (float)texDesc.Height };
context = reinterpret_cast<ID3D11DeviceContext*>(renderer->GetRuntimeData().context);
device = reinterpret_cast<ID3D11Device*>(renderer->GetRuntimeData().forwarder);
Expand Down
1 change: 1 addition & 0 deletions src/State.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ class State

// Skyrim constants
bool isVR = false;
bool dynamicResolutionEnabled = false;
float2 screenSize = {};
ID3D11DeviceContext* context = nullptr;
ID3D11Device* device = nullptr;
Expand Down

0 comments on commit c3658ad

Please sign in to comment.