2
0
mirror of https://github.com/Alia5/GlosSI.git synced 2024-11-10 19:10:46 +00:00

GlosSITarget: Up process priority (like OG GloSC) and add priority widget

Might help with input-lag
This commit is contained in:
Peter Repukat 2022-01-11 01:20:13 +01:00
parent e57f83f78c
commit fa60dd2804
5 changed files with 80 additions and 4 deletions

View File

@ -194,6 +194,7 @@
<ClInclude Include="InputRedirector.h" /> <ClInclude Include="InputRedirector.h" />
<ClInclude Include="Overlay.h" /> <ClInclude Include="Overlay.h" />
<ClInclude Include="OverlayLogSink.h" /> <ClInclude Include="OverlayLogSink.h" />
<ClInclude Include="ProcessPriority.h" />
<ClInclude Include="resource.h" /> <ClInclude Include="resource.h" />
<ClInclude Include="Roboto.h" /> <ClInclude Include="Roboto.h" />
<ClInclude Include="Settings.h" /> <ClInclude Include="Settings.h" />

View File

@ -131,6 +131,9 @@
<ClInclude Include="UWPOverlayEnabler.h"> <ClInclude Include="UWPOverlayEnabler.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="ProcessPriority.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="..\deps\SFML\out\Debug\lib\Debug\sfml-system-d-2.dll" /> <None Include="..\deps\SFML\out\Debug\lib\Debug\sfml-system-d-2.dll" />

View File

@ -0,0 +1,51 @@
#pragma once
#include <Windows.h>
#include "imgui.h"
#include "Overlay.h"
namespace ProcessPriority {
static int current_priority = HIGH_PRIORITY_CLASS;
inline void init()
{
SetPriorityClass(GetCurrentProcess(), HIGH_PRIORITY_CLASS);
Overlay::AddOverlayElem([]() {
ImGui::SetNextWindowPos({913, 418}, ImGuiCond_FirstUseEver);
ImGui::SetNextWindowSizeConstraints({170, 325}, {1000, 1000});
ImGui::Begin("Process Priority");
ImGui::Text("Might help with input-lag or bad game performance");
if (ImGui::RadioButton("Realtime", current_priority == REALTIME_PRIORITY_CLASS)) {
SetPriorityClass(GetCurrentProcess(), REALTIME_PRIORITY_CLASS);
current_priority = REALTIME_PRIORITY_CLASS;
}
if (ImGui::RadioButton("High", current_priority == HIGH_PRIORITY_CLASS)) {
SetPriorityClass(GetCurrentProcess(), HIGH_PRIORITY_CLASS);
current_priority = HIGH_PRIORITY_CLASS;
}
if (ImGui::RadioButton("Above Normal", current_priority == ABOVE_NORMAL_PRIORITY_CLASS)) {
SetPriorityClass(GetCurrentProcess(), ABOVE_NORMAL_PRIORITY_CLASS);
current_priority = ABOVE_NORMAL_PRIORITY_CLASS;
}
if (ImGui::RadioButton("Normal", current_priority == NORMAL_PRIORITY_CLASS)) {
SetPriorityClass(GetCurrentProcess(), NORMAL_PRIORITY_CLASS);
current_priority = NORMAL_PRIORITY_CLASS;
}
if (ImGui::RadioButton("Below Normal", current_priority == BELOW_NORMAL_PRIORITY_CLASS)) {
SetPriorityClass(GetCurrentProcess(), BELOW_NORMAL_PRIORITY_CLASS);
current_priority = BELOW_NORMAL_PRIORITY_CLASS;
}
if (ImGui::RadioButton("Low", current_priority == IDLE_PRIORITY_CLASS)) {
SetPriorityClass(GetCurrentProcess(), IDLE_PRIORITY_CLASS);
current_priority = IDLE_PRIORITY_CLASS;
}
ImGui::End();
});
}
}

View File

@ -51,8 +51,8 @@ END
// //
VS_VERSION_INFO VERSIONINFO VS_VERSION_INFO VERSIONINFO
FILEVERSION 0,0,3,1012008015277 FILEVERSION 0,0,4,101004450861
PRODUCTVERSION 0,0,3,1012008015277 PRODUCTVERSION 0,0,4,101004450861
FILEFLAGSMASK 0x3fL FILEFLAGSMASK 0x3fL
#ifdef _DEBUG #ifdef _DEBUG
FILEFLAGS 0x1L FILEFLAGS 0x1L
@ -69,12 +69,12 @@ BEGIN
BEGIN BEGIN
VALUE "CompanyName", "Peter Repukat - FlatspotSoftware" VALUE "CompanyName", "Peter Repukat - FlatspotSoftware"
VALUE "FileDescription", "GlosSI - SteamTarget" VALUE "FileDescription", "GlosSI - SteamTarget"
VALUE "FileVersion", "0.0.3.1-12-g8d15277" VALUE "FileVersion", "0.0.4.1-1-g445f861"
VALUE "InternalName", "GlosSITarget" VALUE "InternalName", "GlosSITarget"
VALUE "LegalCopyright", "Copyright (C) 2021 Peter Repukat - FlatspotSoftware" VALUE "LegalCopyright", "Copyright (C) 2021 Peter Repukat - FlatspotSoftware"
VALUE "OriginalFilename", "GlosSITarget.exe" VALUE "OriginalFilename", "GlosSITarget.exe"
VALUE "ProductName", "GlosSI" VALUE "ProductName", "GlosSI"
VALUE "ProductVersion", "0.0.3.1-12-g8d15277" VALUE "ProductVersion", "0.0.4.1-1-g445f861"
END END
END END
BLOCK "VarFileInfo" BLOCK "VarFileInfo"
@ -695,6 +695,22 @@ END

View File

@ -22,12 +22,15 @@ limitations under the License.
#include <SFML/Window/Event.hpp> #include <SFML/Window/Event.hpp>
#include <spdlog/spdlog.h> #include <spdlog/spdlog.h>
#ifdef _WIN32 #ifdef _WIN32
#include <SFML/Graphics.hpp> #include <SFML/Graphics.hpp>
#include <VersionHelpers.h> #include <VersionHelpers.h>
#include <Windows.h> #include <Windows.h>
#include <dwmapi.h> #include <dwmapi.h>
#include "ProcessPriority.h"
#include "Settings.h" #include "Settings.h"
#if !defined(WM_DPICHANGED) #if !defined(WM_DPICHANGED)
@ -57,6 +60,8 @@ TargetWindow::TargetWindow(
} }
ImGui::End(); ImGui::End();
}); });
ProcessPriority::init();
} }
void TargetWindow::setFpsLimit(unsigned int fps_limit) void TargetWindow::setFpsLimit(unsigned int fps_limit)