-
-
Notifications
You must be signed in to change notification settings - Fork 957
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Adjust freeimage to all platforms #2303
Conversation
sources/tools/Stride.TextureConverter/Backend/Wrappers/FINetWrapper/FreeImageStaticImports.cs
Outdated
Show resolved
Hide resolved
TC is complaining, might need to adjust those texture extensions you removed to get loaded by freeimage instead ? |
@Eideren Glad the tests caught the error 😅 According to the documentation, it seems that FreeImage has dedicated both Unicode and Non-Unicode methods that should be used accordingly on Windows or Unix systems.
|
I started looking for inspiration and it looks like our friends at Monogame fixed this by using appropriate method depending on the system. I will try to go in this direction [DllImport(NativeLibName, CharSet = CharSet.Unicode, EntryPoint = "FreeImage_LoadU")]
public static extern IntPtr LoadU(FREE_IMAGE_FORMAT fif, string filename, int flags);
[DllImport(NativeLibName, EntryPoint = "FreeImage_Load")]
public static extern IntPtr LoadS(FREE_IMAGE_FORMAT fif, string filename, int flags);
public static IntPtr Load(FREE_IMAGE_FORMAT fif, string filename, int flags)
{
if (CurrentPlatform.OS == OS.Windows)
return LoadU(fif, filename, flags);
else
return LoadS(fif, filename, flags);
} |
f088f60
to
3d6c94d
Compare
825dee9
to
881d95f
Compare
Done! @Eideren, Could you try to run tests again? |
We have a certificate issue right now that xen is looking into, I'll get back to you once it's done :) |
Thanks ! |
PR Details
This PR adjust FreeImage loading for macos and linux distributions (these operating systems load this dependency from packages).
From now, FreeImage is handling image files instead of DirectXTex library (LoadWICFile method is only available for Windows) .
Types of changes
Checklist