code-disaster / steamworks4j

A thin Java wrapper to access the Steamworks API
https://code-disaster.github.io/steamworks4j/
MIT License
468 stars 64 forks source link

Should I retire SteamSharedLibraryLoader? #119

Closed code-disaster closed 1 year ago

code-disaster commented 2 years ago

I'm thinking about nuking SteamSharedLibraryLoader from orbit. I want to ask your opinion about that.

I believe it has been a mistake to introduce the loader in the first place. The intention was to keep the library free of dependencies as much as possible, so I went and shamelessly copied&modified the libGDX loader. I've updated it a couple of times since then, but frankly it's a nightmare to work on, is not on par with its libGDX sibling, and miles behind what the LWJGL3 library loader can do.

In fact, some changes to steamworks4j have been done only to allow bypassing the shared library loader. Our own game, Pathway, even jumps some extra hoops to sneak past the libGDX loader, and uses the one of LWJGL3, esp on Windows, for compatibility reasons.

The current idea would be to introduce one or two additional packages. Let's call them steamworks4j-gdx and steamworks4j-lwjgl3. Their sole purpose would be to demonstrate how to load the native libraries within those frameworks. People could use them as-is, or just have a look and do their own version.

Question is: does anyone of you out there use anything but libGDX or LWJGL3, and if yes, does it have its own means of loading shared libraries?

00-Evan commented 2 years ago

You might be interested in https://github.com/libgdx/gdx-jnigen , which is what libGDX uses for shared library loading now (they moved SharedLibraryLoader.java out of libGDX proper and into this library), and is much more lightweight than including all of libgdx as a dependency.

code-disaster commented 2 years ago

Oh, good point. I didn't even notice in my test that gdx pulls in gdx-jnigen-loader as a dependency.

code-disaster commented 1 year ago

Ok, it's gone. There's now a SteamLibraryLoader interface, and two new modules, steamworks4j-gdx and steamworks4j-lwjgl3. Both implement this interface using their respective backend.

SteamAPI.loadLibraries() takes an instance of this interface. Applications simply need to choose one of the two above, or implement their own.

Also uploaded a SNAPSHOT version to https://oss.sonatype.org/content/repositories/snapshots/com/code-disaster/steamworks4j/. In case someone wants to try it.

tlf30 commented 1 year ago

I only use LWJGL, so the LWJGL loader is fine for me.

dkoding commented 1 year ago

When can we find these changes in the maven repo?

code-disaster commented 1 year ago

Available via 1.10.0-SNAPSHOT (until I manage to deploy 1.10.0)