JuliaMultimedia / SimpleDirectMediaLayer.jl

SDL2
MIT License
81 stars 18 forks source link

Enable libSDL2_ttf, libSDL2_mixer on windows. #19

Closed NHDaly closed 6 years ago

NHDaly commented 6 years ago

Turn on TTF and Mixer support on Windows. Removes all is_apple / is_windows checks everywhere except build.jl.

This should hopefully bring Mac and Windows to be equally supported! :)


Getting BinDeps to be happy required a few hacks. On windows, SDL2_ttf.dll and SDL2_mixer.dll won't load unless SDL2.dll is already loaded, and there doesn't seem to be a way to force BinDeps to load them in-order. Fixing this required the following HACKs:

NHDaly commented 6 years ago

I asked on Slack if anyone knows how to force BinDeps to honor the required load order, but didn't hear back yet (it's late).

Maybe we can open an issue on BinDeps directly if I don't hear from anyone tomorrow..

jonathanBieler commented 6 years ago

It's nice you've figured out that windows issue, but the

Libdl.dlopen(joinpath(@__DIR__, "libSDL2", "SDL2.dll"))

Fails because the library is not installed at that point. Maybe we need a two step install, first install libSDL2, then open it, then install the two others. I don't know if having two install blocks work though.

Apparently there's also a new way of providing binary dependencies:

https://discourse.julialang.org/t/bindeps2-bbuilder-bprovider/8785

NHDaly commented 6 years ago

Libdl.dlopen Fails because the library is not installed at that point. Maybe we need a two step install, first install libSDL2, then open it, then install the two others. I don't know if having two install blocks work though.

Ah, yeah, good point, thanks. I had gotten lazy in my testing and stopped blowing away the deps dir every time I tested. :)

Haha it's ugly, but yeah having two separate install blocks seems to have worked okay! Good idea! :) Glad this is taken care of finally!


bindeps2

Yeah huh, cool. I'll look into that. But for now, I'm happy to have it working and I don't want to learn a whole new build tool if I don't have to... -_-

jonathanBieler commented 6 years ago

Nice, as I understand the new system is supposed to handle all these system specific issues. It doesn't look very mature yet, but I'll have a look at some point.

NHDaly commented 6 years ago

Cool, yeah, hopefully it does! Cheers. :)