Closed zenzoa closed 1 year ago
I tried running the latest release but Gameroy panicked upon receiving an invalid window handle
To be honest, I never tested it on a real Linux environment, only under Windows subsystem for linux. And only tested using VcXsrv Windows X Server, not wayland.
But looking at where the error happened, it appears that the window became invalid in the middle of the texture loading? Not sure if the source line is right, actually. A backtrace should be more accurate.
I only see a blank screen with a green bar on the bottom. Pressing F12 does not bring up the debug window
Try passing a gameboy ROM as argument: cargo run --release -p gameroy-native -- path/to/rom
. It should open the game directly, where you can press F12.
With no argument, it should open the ROM list screen. It should appear similar to the window that you are getting, but with some buttons at the top for loading a ROM. You can configure a path to folder containing ROMs in gameroy.toml
, to show them in the list.
Actually, the buttons will not appear if you disable the rfd
feature, maybe you have done that when trying to build?
You can enable logging by setting the RUST_LOG=info
env var, to see if anything else is going wrong.
you have to run cargo run --release -p gameroy-native not gameroy_native
At some point I renamed the package name, and forget to fix the README. Thanks for point out!
I tried loading a ROM directly, as well as creating a roms folder - turns out it does work just fine, only Wayland (or at least Hyprland) is getting the wrong window sizing/positioning info:
But looking at where the error happened, it appears that the window became invalid in the middle of the texture loading? Not sure if the source line is right, actually.
Looking back at this, it is obvious that the source line is wrong, because it is an older version. Also, in this older version I was still using a poorly maintained OpenGL backend, where the error is probably coming from.
turns out it does work just fine, only Wayland (or at least Hyprland) is getting the wrong window sizing/positioning info:
Hmm, it is strangely cropping to the bottom-left corner? I would expect to be cropping in the top-left corner at least.
This error can be originating at 5 points: In the GUI rendering, in my OpenGL sprite renderer, in the opengl bindings, in Winit Wayland backend, or in Hyprlan. Probably isn't in the GUI rendering, bottom-left corner appear to be too strange behavior. Also, I have seen some screenshots of alacritty (which uses winit) running on Hyprland, so probably isn't winit or Hyprland.
If you could, try running the example as describe in the README of Rodrigodd/sprite-render-rs. If this is matching with the screenshot in the README, try running the example in Rodrigodd/giui.
If sprite-render-rs is not working, try running the window
example in this tag of Glutin: rust-windowing/glutin/v0.30.3. The example should display a centered triangle. If this is not working, try again the example but in the last commit this time. If neither are working, the problem is upstream.
Also, are you applying scaling in your Hyprland config? Try setting it to 1, could be a problem with DPI awareness somewhere.
I skipped ahead to the scaling on Hyprland, since I had it set to 1.5. Changed it to 1, and it works:
It does get distorted when I resize the window:
I was able to test the program in a Wayland compositor (weston in this case), and was able to reproduce the problem with the resizing (but I didn't find out how to increase the scale factor).
The problem was that I forget to call resize
on the OpenGL surface, which is necessary on Wayland and macOS. For reference, the fix is here: https://github.com/Rodrigodd/sprite-render-rs/commit/7d7032de91cb4ed0d877d43084cf01ddb98350e4.
I also update the version of sprite-render in master.
Could you test the last commit? It will probably fix the resizing problem, but I don't know if it will also fix the scaling.
I tested this on both weston and sway, on a actual linux machine, and everything appears to be working.
@zenzoa fell free to reopen if the problem persists on hyprland.
I'm running Arch Linux with the wayland compositor/wm Hyprland. I tried running the latest release but Gameroy panicked upon receiving an invalid window handle:![image](https://github.com/Rodrigodd/gameroy/assets/10480278/36165a09-2b51-4776-8fab-a735b0e68abb)
I then cloned the latest source and got it to compile and run, but I only see a blank screen with a green bar on the bottom. Pressing F12 does not bring up the debug window:![image](https://github.com/Rodrigodd/gameroy/assets/10480278/b987b8ca-9075-4fd6-ae92-d212ccdc02f9)
(Also, small thing, but your readme has a typo: you have to run
cargo run --release -p gameroy-native
notgameroy_native
)