gecko0307 / dagon

3D game engine for D
https://gecko0307.github.io/dagon
Other
321 stars 30 forks source link

Default program fails to run on Fedora 39 #93

Closed mxruben closed 3 months ago

mxruben commented 3 months ago

When I init a new project with dub init --type=dagon, it builds fine, but gives me multiple runtime errors when run:

libdecor-gtk-WARNING: Failed to initialize GTK
Failed to load plugin 'libdecor-gtk.so': failed to init
Error: Dagon requires OpenGL 4.0, but it seems that your graphics card does not support it
Error Program exited with code 1

I have gtk4, libdecor and SDL2 development libraries installed, so I'm not sure where the gtk errors are coming from. My graphics card (Intel Iris Xe) most definitely supports OpenGL 4. Maybe that error is just a side-effect of the first one.

Relevant library versions: Dagon: 0.16.0 SDL: 2.28.5-1 libdecor: 0.2.2-1 gtk: 4.12.5-1

Thanks for your help!

mxruben commented 3 months ago

I looks like this is an issue with my SDL installation. I tried using bindbc-sdl in a new project and I got the same libdecor errors. I also gave it a shot with just c++ and the same problems happened. Safe to say it is not a problem with this lib. Oddly everything runs fine when run as root. Probably an issue with my system.

mxruben commented 3 months ago

Update, it turns out that it was a wayland issue. When run with SDL_VIDEODRIVER=x11, the first few errors are gone. Apparently, wayland requires a full event loop for a window to be displayed. See this issue for more info.

Dagon still thinks my graphics card is ancient or non-existent because I still get this error: Error: Dagon requires OpenGL 4.0, but it seems that your graphics card does not support it unless run as root. Going to reopen because of this.

mxruben commented 3 months ago

Ok, things are really getting weird, I found out that when I run dub through vs-code's integrated terminal (with SDL_VIDEODRIVER=x11), everything just works fine, but for some reason when I run it with gnome-console, I get the OpenGL error. To make things even weirder, when I use gnome-terminal, everything also works as expected. When I use normal bindbc-opengl with bindbc-sdl, it detects opengl no matter what terminal app I use. I am mega confused right now.

gecko0307 commented 3 months ago

Seems that wayland support was missing in bindbc-opengl 1.0. I've updated dependencies, so now the context should initialize correctly.

mxruben commented 3 months ago

Thanks! It works great now on both x11 and wayland.