STREGAsGate / GateEngine

Swift Game Engine supporting Windows, Linux, macOS, HTML5, and more 🚂
Apache License 2.0
280 stars 6 forks source link

2D_01_AnimatedSprite Demo Nof Working #32

Closed 3DSki closed 11 months ago

3DSki commented 12 months ago

I'm a Fedora user, running swift 5.8.1. The target shows as x86_64-unknown-linux-gnu.

When I run the 2D animation window the window is black with no animation. When I run it from the command line it presents 2 unhandled event warnings (21 and 19) and I don't know if that's significant.

I'm not understanding how resource pathing works. I see the "Earth rotating 32 x 32.png' file, and I see it referenced from a relative path of "Resources/Earth rotating 32 x 32.png", from the Source location, but don't know how the engine uses this information, in relationship to the executable under the target directory for my platform. I get the same result when attempting to do "swift run 2D_01_AnimatedSprite".

I apologize if this is a new user error and would appreciate some direction if this isn't a bug. None of the demos are displaying anything. The multiple windows examples open windows, but they're all blank.

I also have a Win 10 system, so I'm tempted to install swift to work with the demos there to compare the behaviors.

Thanks!

STREGA commented 11 months ago

The paths are relative search paths. GateEngine looks through swift resource bundles until it locates the resource.

If there was a resource load error it would be displayed in the console output though.

It's likely an OpenGL issue. For Linux you need a dev package for opengl. I use freeglut-dev on ubuntu. I'm experimenting with including the dev headers to allow builds to work on systems where the opengl library is in path, but perhaps different distributions have differences where that wont work 🤔

It's hard to know for sure. I'll remove the experimental stuff tonight when I get a chance and we can see if it works properly with fedoras own dev packages.

STREGA commented 11 months ago

Okay, I've removed the static headers. These are the packages for Ubuntu sudo apt-get install freeglut3-dev; sudo apt-get install libopenal-dev you'll need the fedora equivalents installed to be able to build now. Give it a try and let me know how it goes.

Don't forget to do swift package update to pull the newer GateEngine changes.

3DSki commented 11 months ago

I moved off of Fedora and back to Windows (not a dual boot environment), so I can't confirm your fix, but I trust your directions and they'd be a help for anyone else that runs into the same issue. Thanks!