Open zkxs opened 1 year ago
Hi I have followed the instructions, installed Rust, and it downloaded and installed. Now what do I do? How do I run it?
Hi, thanks for being the first person to try it on Mac. I'm not sure which set of instructions you followed. If it was the "Installing from Source" section, you should be able to just run simple-crosshair-overlay
as a command in your terminal.
Hi, thanks for the work @zkxs:
Here's the exception I get when running the binary and also building from source.
thread 'main' panicked at /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.29.10/src/platform_impl/macos/event_loop.rs:200:13:
`winit` requires control over the principal class. You must create the event loop before other parts of your application initialize NSApplication
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Submitted a PR regarding the exception I mentioned here #52
Works on Mac except the crosshair is not on a transparent layer but black layer, I haven't figured out yet how to fix it
Hmm, I've only got a couple of ideas:
init_window
the aftermath of me fighting with Windows for a while to get things working as desired. I wouldn't be surprised if MacOS has similar things going on. Don't be afraid to totally reorder everything I'm doing in that function and see if it changes anything. In particular, try removing the .with_visible(false)
call and see if anything happens.+
crosshair the background would be transparent as expected, but the red crosshair would be fully opaque instead of the intended 70% opaque. If you suspect that it might need premultiplied alpha, try out this change I've put on a new macos-premultiply-alpha branch. If MacOS wants a different pixel format than 32-bit ARGB then things are gonna get complicated.
Simple Crosshair Overlay should mostly work on MacOS, but I don't have access to a system to test that on and I'm very doubtful it will work out of the box without any platform specific tweaks.
Homework for me:
Homework for you, dear reader:
If anyone gives this a try I recommend starting the program from a terminal, so when it inevitably crashes you can capture the backtrace for us to analyze.