Giter Club home page Giter Club logo

clickabletransparentoverlay's People

Contributors

amiron49 avatar instantsc avatar zaafar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

clickabletransparentoverlay's Issues

Enable Multi-Viewports on this lib

it will allow users to create ImGuiWindows outside the SDL2 Window (in case overlay window is too small OR they have multiple monitors).

How to attach to a specific process, or overlay another process?

This demo looks great, but I can't seem to get it to work for a specific game (Perpetuum).

It runs on DX9. This sample is able to render the window over the game, but I can't actually click on anything unless I bring focus back to the sample console app.

Any advice on this would be highly appreciated.

WindowHandle not exposed

This issue is twofold

  1. The window handle is not exposed. I have to steal it with reflection to temporarily accomplish the things I request.
protected override Task PostInitialized()
{
    var handleField = typeof(Overlay).GetField("window", BindingFlags.NonPublic | BindingFlags.Instance);

    if (handleField == null)
        throw new Exception("Failed to get window field");

    object? window = handleField.GetValue(this);

    if (window == null)
        throw new Exception("Failed to get window value");

    object? handle = window.GetType().GetField("Handle")?.GetValue(window);

    if (handle == null)
        throw new Exception("Failed to get handle value"); 
    
    windowHandle = (IntPtr)handle;
    
    return Task.CompletedTask;
}
  1. A lot of native things are not exposed.
  2. A) I cannot put the overlay ontop of another window. I have to do:
IntPtr hwndInsertAfter = Win32.GetWindow(windowHandle, Win32.WindowCommand.Previous);
if (hwndInsertAfter == this.windowHandle)
    return;
Win32.SetWindowPos(this.windowHandle, hwndInsertAfter, 0, 0, 0, 0, Win32.SwpFlags.NoSize | Win32.SwpFlags.NoMove | Win32.SwpFlags.NoActivate | Win32.SwpFlags.AsyncWindowPos) ? 1 : 0;
  1. B) I cannot change the window decoration, for example removing the window.
  // Hide the window
  var style = Win32.GetWindowLong(windowHandle, Win32.GWL_EXSTYLE);
  Win32.SetWindowLong(windowHandle, Win32.GWL_EXSTYLE, (style & -Win32.WS_EX_APPWINDOW) | Win32.WS_EX_TOOLWINDOW);

White Screen and Scaling Glitch

In version 9.1, the ui sometimes turns white randomly before returning to normal. However, when using version 9.2 or later, the white screen issue is resolved, but there's a new problem: the ui cannot be fully displayed in fullscreen mode. Part of the screen seems to disappear, indicating a possible screen scaling issue, any idea to fix this?

Untitled

Add fonts of different sizes

Default ImGUI font looks too small on 4k resolution. Would be nice to add more fonts.

Use-Case-1: User can select a specific font for a specific part of the UI
Use-Case-2: User can select a specific font as a default font.

Ability to specify whether an image should use mipmaps

Currently having a hard time trying to not use mipmaps, as it seems to blur out the texture a bit, which is not desired for my use. I'm trying to do an image editor, where there should be no filtering at all.

Would it be possible for you to add an overload or something to AddOrGetImagePointer, where I can specify that I don't want any mipmaps/filtering? :)

Latest update

Seems like the last few updates has broken the resolution and only does about half the screen. Also I wanted to ask if there an option to disable the transparent background on the imgui menus? Changing the alpha seems to do nothing but I just want it a solid colour.

Memory leak

A memory leak will occur if you try to update the same image.

Steps to reproduce:

  • Add the following instruction on MultiThreadedOverlay.SampleOverlay.RenderMainMenu line 188:
  • RemoveImage("image.png");
  • Run MultiThreadedOverlay
  • Check the memory usage through task manager

Step to fix:

  • Add the following instruction on ClickableTransparentOverlay.ImGuiController.GetOrCreateImGuiBinding line 204:
  • texture.Dispose();

ReplaceFont raises a MissingMethodException exception (NuGet, >=ImGuiNET 1.89.5.1)

When trying to use ReplaceFont in my program, it raises a System.MissingMethodException exception every time the function is ran. I tried the SingleThreadedOverlayWithCoroutines example as well, and it still raises this exception:

Unhandled exception. System.MissingMethodException: Method not found: 'ImGuiNET.ImFontPtr ImGuiNET.ImFontAtlasPtr.AddFontFromFileTTF(System.String, Single, ImGuiNET.ImFontConfigPtr, IntPtr)'.
   at ClickableTransparentOverlay.ImGuiRenderer.UpdateFontTexture(String fontPathName, Single fontSize, UInt16[] fontCustomGlyphRange, FontGlyphRangeType fontLanguage)
   at ClickableTransparentOverlay.Overlay.ReplaceFontIfRequired()
   at ClickableTransparentOverlay.Overlay.RunInfiniteLoop(CancellationToken token)
   at ClickableTransparentOverlay.Overlay.<Start>b__26_0()
   at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__128_1(Object state)
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading.PortableThreadPool.WorkerThread.WorkerThreadStart()

I made sure ImGui.NET and the other dependencies are installed, and I don't know any workarounds for the time being.

Use .net 5+

Won't happen, unless there is a .net 5 language feature which this library needs/wants.
Also, libs using .net core 2 can easily be used by the projects using .net 5.

GetWindowDrawList does not work in an library

If I create a overlay in for example a Console application, everything works fine.

If I however create the same overlay in a class library, then import that class library into a Console application, everything seems to work except the GetWindowDrawList, nothing is being drawn.

This is currently blocking me from using the library.

Thanks

Application focus changes when clicking on a form

Hi, there is such a problem that when you click on the imgui menu, the application behind it loses focus. That is, the click does not reach it. In my case, the application pauses after clicking on imgui, any ideas how to fix this? I also wanted to say thank you for this package, this is a very convenient solution. It would be convenient if you would like to leave any wallet for voluntary donations.

Disable INI

It does not seem possible to disable the ini that is created to store state. An option for this would be nice so things can be handled with the Save and Load functions.

clickabletransparentoverlay is missing NuGet package README file

We've noticed that your package on NuGet.org is missing a README file.

Why READMEs are Important

A README is essential for users to understand your package's purpose and functionality quickly. It's the first thing users see on NuGet.org and helps them decide if your package meets their needs.

Get Started with READMEs

How to Add a README

If you're new to NuGet READMEs, follow guidance on how to add one to your package.

How to write high quality of READMEs

Follow a blog post with README best practices and a template file to help you get started.

We Value Your Feedback

We value your feedback. If you encounter any issues or have suggestions, please reply to this issue.

Thank you for your contribution to the NuGet community.

Does this ImGui library support the use of glyphs (icons)?

I came across a code snippet on the internet that loads custom glyphs using ImGui.NET but I'm having trouble getting them to display properly. Even though the glyphs are loaded, they still appear as question marks when I try to use them with Push/Pop font. Do you have any suggestions for how I can troubleshoot this issue and get the glyphs to display correctly?

        static unsafe ImFontPtr LoadIconFont(string name, int size, (ushort, ushort) range)
        {
            ImFontConfigPtr configuration = ImGuiNative.ImFontConfig_ImFontConfig();

            configuration.MergeMode  = true;
            configuration.PixelSnapH = true;

            // string path = Path.Combine(".", "Resources", "Fonts", name + ".ttf");
            string path = MaterialDesign.FontIconFileNameMD;

            GCHandle rangeHandle = GCHandle.Alloc(new ushort[]
            {
                range.Item1,
                range.Item2,
                0
            }, GCHandleType.Pinned);

            try
            {
                return ImGui.GetIO().Fonts.AddFontFromFileTTF(path, size, configuration, rangeHandle.AddrOfPinnedObject());
            }
            finally
            {
                configuration.Destroy();

                if (rangeHandle.IsAllocated)
                {
                    rangeHandle.Free();
                }
            }
        }

Set Overlay window to Fullscreen

Hello I am trying to have the overlay cover my entierty of my screen not just a small area I tried doing ImGui#SetNextWindowSize but that only resized the ImGui window not the actual overlay
please let me know how to fix that thanks,

Different console window supression

right now the static bool TerminalWindow in Overlay.cs is responsible for toggling the console window away. But the ClickableTransparentOverlay assembly is not the one responsible for spawning it.

Changing the OutputType of DriverProgram.csproj to WinExe would be cleaner

<PropertyGroup>
   <OutputType>WinExe</OutputType>
   <TargetFramework>netcoreapp3.1</TargetFramework>
</PropertyGroup>

AccessViolationException when create texture when height and width is not same size

When i load image 512x512 128x128, ... or some size when width and height is same size, it works nice, but if i load image with width and height different, i get the error, a exmple: 512x128
The error is in ClickableTransparentOverlay.ImGuiRenderer.CreateImageTexture when the method calls the device.CreateTexture2D(...)
The error message is System.AccessViolationException: 'Attempted to read or write protected memory. This is often an indication that other memory is corrupt.'

The problem is in

var texDesc = new Texture2DDescription(format, image.Width, image.Width, 1, 1);

Looking to the Texture2DDescription, the parameters is format, width, height, ....., in the current code, using image.Width in height param

Sharing Image Texture with Unity

I am using this with Unity.
I would like to present a Texture loaded by Unity main thread to an ImGui.Image.
How would I be able to do this?
I kept getting the

Fatal error. System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

Moving Overlay window to different screen

In the current NuGet Package, the overlay window only displays on the "primary" screen.
In the current source code it seams that something is implemented so the overlay window can be moved:
grafik

I build the source repo and added it to my project.
I am trying to set those properties to the new Position and Size depending on the selected screen Bounds:
grafik

the overlay window disappears from the main screen but not appear on the selected screen (I set the ImGui window to the same coordinates relative to the old screen)

on main screen:
grafik

after moving to the other screen (without any debugging):
grafik

set Position and Size:
grafik

to clarify:
I have 3 Monitors, the selected monitor is on the right so X is 1920 and Y is 0 whichis the upper left corner of the right monitor

Help

Any example on how To add it to processor ? All it does is open the imgui

How to implement VSync on Render loop

Thank you for the extremely useful architecture. I have been making great use of this as I build up my app.

I have gotten to the point in my project where I need to optimize the rate at which I am sampling data and want to match with the rate at which the target game is being refreshed. I was hoping to ask you if you know how to do this?

My tenuous information so far is that I need to change a setting in Vortice.DXGI called SynchronizeWithVerticalRetrace to true
But I am not sure how I would gain the handle to the device to set that. I was hoping you might be able to point me in the right direction.

Nuget dependency issue

Unable to find package Veldrid.StartupUtilities with version (>= 4.9.0-beta1-g416d633c88)
Unable to find package Veldrid.Sdl2 with version (>= 4.9.0-beta1-g416d633c88)
Unable to find package Veldrid.ImageSharp with version (>= 4.9.0-beta1-g416d633c88)
Unable to find package Veldrid with version (>= 4.9.0-beta1-g416d633c88)

Nearest version: 4.9.0-beta1

Is this able to be rectified by uploading a new NuGet/NuSpec with these dependency versions updated?

Overlay stuck in non-clickable mode

Sometime when clicking and moving mouse like a monkey the overlay gets stuck in a non-clickable mode forever. Developers using this lib should implement the following workaround in their application to get rid of this issue.

workaround: cc3c1d7 (basically you need to figure out a way to send ImGui.GetIO().WantCaptureMouse = true; to the ImGui.).

Not working on FullScreen and Vulkan-BorderlessWindow mode

Everyone, who is familiar with the overlay technology, knows that Overlay doesn't really work with applications running in FullScreen mode (unless you do some really hacky/brittle stuff e.g. by-passing the OS input system) so that's not really a problem.

However, in this issue, overlay stops working on "Borderless Window" mode as well. This happens only when application, who is being overlayed by the ClickableTransparentOverlay, is using Vulkan APIs.

Acceptance Criteria

  • ClickableTransparentOverlay works with Vulkan API in borderless-window mode
  • [Optional] ClickableTransparentOverlay works in fullscreen mode as well

Notes

  • [Personal preference] Do not hook to the Windows OS input system

Work Around

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.