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:
parent
e57f83f78c
commit
fa60dd2804
@ -194,6 +194,7 @@
|
||||
<ClInclude Include="InputRedirector.h" />
|
||||
<ClInclude Include="Overlay.h" />
|
||||
<ClInclude Include="OverlayLogSink.h" />
|
||||
<ClInclude Include="ProcessPriority.h" />
|
||||
<ClInclude Include="resource.h" />
|
||||
<ClInclude Include="Roboto.h" />
|
||||
<ClInclude Include="Settings.h" />
|
||||
|
@ -131,6 +131,9 @@
|
||||
<ClInclude Include="UWPOverlayEnabler.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="ProcessPriority.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\deps\SFML\out\Debug\lib\Debug\sfml-system-d-2.dll" />
|
||||
|
51
GlosSITarget/ProcessPriority.h
Normal file
51
GlosSITarget/ProcessPriority.h
Normal 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();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -51,8 +51,8 @@ END
|
||||
//
|
||||
|
||||
VS_VERSION_INFO VERSIONINFO
|
||||
FILEVERSION 0,0,3,1012008015277
|
||||
PRODUCTVERSION 0,0,3,1012008015277
|
||||
FILEVERSION 0,0,4,101004450861
|
||||
PRODUCTVERSION 0,0,4,101004450861
|
||||
FILEFLAGSMASK 0x3fL
|
||||
#ifdef _DEBUG
|
||||
FILEFLAGS 0x1L
|
||||
@ -69,12 +69,12 @@ BEGIN
|
||||
BEGIN
|
||||
VALUE "CompanyName", "Peter Repukat - FlatspotSoftware"
|
||||
VALUE "FileDescription", "GlosSI - SteamTarget"
|
||||
VALUE "FileVersion", "0.0.3.1-12-g8d15277"
|
||||
VALUE "FileVersion", "0.0.4.1-1-g445f861"
|
||||
VALUE "InternalName", "GlosSITarget"
|
||||
VALUE "LegalCopyright", "Copyright (C) 2021 Peter Repukat - FlatspotSoftware"
|
||||
VALUE "OriginalFilename", "GlosSITarget.exe"
|
||||
VALUE "ProductName", "GlosSI"
|
||||
VALUE "ProductVersion", "0.0.3.1-12-g8d15277"
|
||||
VALUE "ProductVersion", "0.0.4.1-1-g445f861"
|
||||
END
|
||||
END
|
||||
BLOCK "VarFileInfo"
|
||||
@ -695,6 +695,22 @@ END
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -22,12 +22,15 @@ limitations under the License.
|
||||
#include <SFML/Window/Event.hpp>
|
||||
#include <spdlog/spdlog.h>
|
||||
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <SFML/Graphics.hpp>
|
||||
#include <VersionHelpers.h>
|
||||
#include <Windows.h>
|
||||
#include <dwmapi.h>
|
||||
|
||||
#include "ProcessPriority.h"
|
||||
|
||||
#include "Settings.h"
|
||||
|
||||
#if !defined(WM_DPICHANGED)
|
||||
@ -57,6 +60,8 @@ TargetWindow::TargetWindow(
|
||||
}
|
||||
ImGui::End();
|
||||
});
|
||||
|
||||
ProcessPriority::init();
|
||||
}
|
||||
|
||||
void TargetWindow::setFpsLimit(unsigned int fps_limit)
|
||||
|
Loading…
Reference in New Issue
Block a user