|
|
@ -2,52 +2,66 @@ |
|
|
|
{ |
|
|
|
{ |
|
|
|
using ClickableTransparentOverlay; |
|
|
|
using ClickableTransparentOverlay; |
|
|
|
using ImGuiNET; |
|
|
|
using ImGuiNET; |
|
|
|
using System; |
|
|
|
|
|
|
|
using System.Threading; |
|
|
|
using System.Threading; |
|
|
|
|
|
|
|
|
|
|
|
class Program |
|
|
|
class Program |
|
|
|
{ |
|
|
|
{ |
|
|
|
private static Overlay demo; |
|
|
|
private static bool isRunning = true; |
|
|
|
private static int Width = 2560; |
|
|
|
|
|
|
|
private static int Height = 1440; |
|
|
|
|
|
|
|
private static int Fps = 144; |
|
|
|
private static int Fps = 144; |
|
|
|
private static int RunFor = 10; |
|
|
|
private static int[] resizeHelper = new int[4] { 0, 0, 2560, 1440 }; |
|
|
|
static void Main(string[] args) |
|
|
|
private static int seconds = 5; |
|
|
|
{ |
|
|
|
private static Overlay overlay = new Overlay(0, 0, 2560, 1440, Fps, false); |
|
|
|
Console.Write("Enter Screen Width:"); |
|
|
|
|
|
|
|
Width = Convert.ToInt32(Console.ReadLine()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Console.Write("Enter Screen Height:"); |
|
|
|
private static void MainApplicationLogic() |
|
|
|
Height = Convert.ToInt32(Console.ReadLine()); |
|
|
|
{ |
|
|
|
|
|
|
|
while (isRunning) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
Thread.Sleep(10); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
overlay.Dispose(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Console.Write("Enter Monitor Max FPS:"); |
|
|
|
static void Main(string[] args) |
|
|
|
Fps = Convert.ToInt32(Console.ReadLine()); |
|
|
|
{ |
|
|
|
|
|
|
|
overlay.SubmitUI += RenderUi; |
|
|
|
|
|
|
|
Thread p = new Thread(MainApplicationLogic); |
|
|
|
|
|
|
|
p.Start(); |
|
|
|
|
|
|
|
overlay.Run(); |
|
|
|
|
|
|
|
p.Join(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Console.Write("You want to run this demo for X (seconds):"); |
|
|
|
private static void RenderUi(object sender, System.EventArgs e) |
|
|
|
RunFor = Convert.ToInt32(Console.ReadLine()); |
|
|
|
{ |
|
|
|
|
|
|
|
if (isRunning) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
ImGui.ShowDemoWindow(ref isRunning); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var EndDemo = new Thread(DistroyDemo); |
|
|
|
ImGui.Begin("SDL2Window Config", ImGuiWindowFlags.NoResize | ImGuiWindowFlags.AlwaysAutoResize); |
|
|
|
EndDemo.Start(); |
|
|
|
ImGui.Text($"Current FPS: {Fps}"); |
|
|
|
StartDemo(); |
|
|
|
if (ImGui.SliderInt("Set FPS", ref Fps, 30, 144)) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
overlay.SetFps(Fps); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static void StartDemo() |
|
|
|
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")) |
|
|
|
{ |
|
|
|
{ |
|
|
|
demo = new Overlay(0, 0, Width, Height, Fps); |
|
|
|
overlay.Resize(resizeHelper[0], resizeHelper[1], resizeHelper[2], resizeHelper[3]); |
|
|
|
demo.SubmitUI += (object sender, EventArgs e) => ImGui.ShowDemoWindow(); |
|
|
|
|
|
|
|
demo.Run(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static void DistroyDemo() |
|
|
|
ImGui.NewLine(); |
|
|
|
|
|
|
|
ImGui.DragInt("Set Hidden Time", ref seconds); |
|
|
|
|
|
|
|
if (ImGui.Button("Hide for X Seconds")) |
|
|
|
{ |
|
|
|
{ |
|
|
|
Thread.Sleep(RunFor * 1000); |
|
|
|
new Thread(() => { Thread.Sleep(seconds * 1000); overlay.Show(); }).Start(); |
|
|
|
demo.Resize(200, 200, 1024, 1024); |
|
|
|
overlay.Hide(); |
|
|
|
Thread.Sleep(RunFor * 1000); |
|
|
|
} |
|
|
|
demo.Hide(); |
|
|
|
|
|
|
|
Thread.Sleep(RunFor * 1000); |
|
|
|
ImGui.End(); |
|
|
|
demo.Show(); |
|
|
|
|
|
|
|
Thread.Sleep(RunFor * 1000); |
|
|
|
|
|
|
|
demo.Dispose(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |