You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
67 lines
2.1 KiB
67 lines
2.1 KiB
namespace DriverProgram
|
|
{
|
|
using ClickableTransparentOverlay;
|
|
using ImGuiNET;
|
|
using System.Threading;
|
|
|
|
class Program
|
|
{
|
|
private static bool isRunning = true;
|
|
private static int Fps = 144;
|
|
private static int[] resizeHelper = new int[4] { 0, 0, 2560, 1440 };
|
|
private static int seconds = 5;
|
|
private static Overlay overlay = new Overlay(0, 0, 2560, 1440, Fps, false);
|
|
|
|
private static void MainApplicationLogic()
|
|
{
|
|
while (isRunning)
|
|
{
|
|
Thread.Sleep(10);
|
|
}
|
|
overlay.Dispose();
|
|
}
|
|
|
|
static void Main(string[] args)
|
|
{
|
|
overlay.SubmitUI += RenderUi;
|
|
Thread p = new Thread(MainApplicationLogic);
|
|
p.Start();
|
|
overlay.Run();
|
|
p.Join();
|
|
}
|
|
|
|
private static void RenderUi(object sender, System.EventArgs e)
|
|
{
|
|
if (isRunning)
|
|
{
|
|
ImGui.ShowDemoWindow(ref isRunning);
|
|
}
|
|
|
|
ImGui.Begin("SDL2Window Config", ImGuiWindowFlags.NoResize | ImGuiWindowFlags.AlwaysAutoResize);
|
|
ImGui.Text($"Current FPS: {Fps}");
|
|
if (ImGui.SliderInt("Set FPS", ref Fps, 30, 144))
|
|
{
|
|
overlay.SetFps(Fps);
|
|
}
|
|
|
|
ImGui.NewLine();
|
|
ImGui.Text($"Current Position: {resizeHelper[0]}, {resizeHelper[1]}");
|
|
ImGui.Text($"Current Size: {resizeHelper[2]}, {resizeHelper[3]}");
|
|
ImGui.SliderInt4("Set Position & Size", ref resizeHelper[0], 0, 3840);
|
|
if (ImGui.Button("Resize"))
|
|
{
|
|
overlay.Resize(resizeHelper[0], resizeHelper[1], resizeHelper[2], resizeHelper[3]);
|
|
}
|
|
|
|
ImGui.NewLine();
|
|
ImGui.DragInt("Set Hidden Time", ref seconds);
|
|
if (ImGui.Button("Hide for X Seconds"))
|
|
{
|
|
new Thread(() => { Thread.Sleep(seconds * 1000); overlay.Show(); }).Start();
|
|
overlay.Hide();
|
|
}
|
|
|
|
ImGui.End();
|
|
}
|
|
}
|
|
} |