Works fine for me on windows, after running 'dub upgrade'.
I tested the SharedLibVersion with a 2.0.1 and a 2.0.3 SDL dll.
With the 2.0.3 dll, I could call functions added in SDL 2.0.2
even when using SharedLibVersion(2, 0, 0) - is this intended
With the 2.0.1 DLL I got the expected 'Failed to load symbol'
error without using the SharedLibVersion, or using
SharedLibVersion(2, 0, 2).
However, if I call one of the functions added in SDL 2.0.2 when
loading the 2.0.1 context, I get an 'object.Error@(0): Access
violation' error. Would it be possible to get a more informative
error message in this case?
Highly appreciate your work on Derelict, BTW.
On Wednesday, 31 December 2014 at 01:35:32 UTC, Mike Parker wrote:
I've added a new feature to Derelict that I'd appreciate some
feedback on. It works for me, but I want to verify that it
works in the wild before I expand it to other packages and move
forward with another feature I plan to add. You can read more
about it in my blog post at .
If you are using DerelictSDL2 in a project, I'd appreciate it
if you'd change your dependency to "derelict-sdl2": ">=1.9.0"
and let me know if it breaks your build or not. And if you
aren't using any of the functions added in SDL 2.0.2, then I'd
also appreciate it if you'd test the new feature as described
in the blog post:
// If you require functions in 2.0.1
DerelictSDL2.load( SharedLibVersion( 2, 0, 1 ));
// If you don't need any functions beyond 2.0.0
DerelictSDL2.load( SharedLibVersion( 2, 0, 0 ));
The goal is to allow you to load any version of SDL that your
app can support from one package. I've noticed that most people
tend to use the highest version of DerelictSDL2 (1.2.x), which
only loads SDL 2.0.2 and 2.0.3 and will fail with the lower
versions, even though they aren't using any of the newer API
If you have a package you maintain that uses DerelictUtil for
loading, you do not need to implement this yourself. It is
entirely optional. Not all DerelictOrg packages will get this.
However, if it makes sense in the context of the library you
are loading, please consider implementing it and letting me
know how it goes. Essentially, you'll need to change your
dependency to "derelict-util":">=1.9.0" and override the new
protected method configureMinimumVersion in your loader to
install a library-specific MissingSymbolCallback. I've linked
an example in the blog post.