diff --git a/src/java/org/lwjgl/devil/IL.java b/src/java/org/lwjgl/devil/IL.java index f8044ea0..730d5151 100644 --- a/src/java/org/lwjgl/devil/IL.java +++ b/src/java/org/lwjgl/devil/IL.java @@ -583,23 +583,13 @@ public class IL { String[] illPaths = LWJGLUtil.getLibraryPaths(new String[]{ "DevIL", "DevIL.dll", "IL", "libIL.so", - "IL", "IL"}, IL.class.getClassLoader()); + "IL", "libIL.dylib"}, IL.class.getClassLoader()); nCreate(illPaths); created = true; try { IL.initNativeStubs(); IL.ilInit(); - - // We need to initialize everything in one fell swoop on mac - if(LWJGLUtil.getPlatform() == LWJGLUtil.PLATFORM_MACOSX) { - ILU.initNativeStubs(); - ILU.setCreated(true); - - ILUT.initNativeStubs(); - ILUT.setCreated(true); - } - created = true; } catch (LWJGLException e) { destroy(); @@ -613,17 +603,6 @@ public class IL { public static void destroy() { resetNativeStubs(IL.class); - // We need to destroy everything on mac in one go - if(LWJGLUtil.getPlatform() == LWJGLUtil.PLATFORM_MACOSX) { - ILU.resetNativeStubs(ILU.class); - ILU.nDestroy(); - ILU.setCreated(false); - - ILUT.resetNativeStubs(ILUT.class); - ILUT.nDestroy(); - ILUT.setCreated(false); - } - if (created) { nDestroy(); } diff --git a/src/java/org/lwjgl/devil/ILU.java b/src/java/org/lwjgl/devil/ILU.java index f999b33e..e67c6acb 100644 --- a/src/java/org/lwjgl/devil/ILU.java +++ b/src/java/org/lwjgl/devil/ILU.java @@ -163,15 +163,10 @@ public class ILU { throw new LWJGLException("Cannot create ILU without having created IL instance"); } - // We need to do nothing when running on mac, since all is loaded in IL - if(LWJGLUtil.getPlatform() == LWJGLUtil.PLATFORM_MACOSX) { - return; - } - String[] iluPaths = LWJGLUtil.getLibraryPaths(new String[]{ "ILU", "ILU.dll", "ILU", "libILU.so", - "ILU", "ILU"}, ILU.class.getClassLoader()); + "ILU", "libILU.dylib"}, ILU.class.getClassLoader()); nCreate(iluPaths); created = true; @@ -193,12 +188,6 @@ public class ILU { * Exit cleanly by calling destroy. */ public static void destroy() { - - // We need to do nothing when running on mac, since all is destroyed in IL - if(LWJGLUtil.getPlatform() == LWJGLUtil.PLATFORM_MACOSX) { - return; - } - resetNativeStubs(ILU.class); if (created) { nDestroy(); diff --git a/src/java/org/lwjgl/devil/ILUT.java b/src/java/org/lwjgl/devil/ILUT.java index 0f31c4d1..8a039ae2 100644 --- a/src/java/org/lwjgl/devil/ILUT.java +++ b/src/java/org/lwjgl/devil/ILUT.java @@ -128,15 +128,10 @@ public class ILUT { throw new LWJGLException("Cannot create ILUT without having created IL instance"); } - // We need to do nothing when running on mac, since all is loaded in IL - if(LWJGLUtil.getPlatform() == LWJGLUtil.PLATFORM_MACOSX) { - return; - } - String[] ilutPaths = LWJGLUtil.getLibraryPaths(new String[]{ "ILUT", "ILUT.dll", "ILUT", "libILUT.so", - "ILUT", "IL"}, ILU.class.getClassLoader()); + "ILUT", "libILUT.dylib"}, ILUT.class.getClassLoader()); nCreate(ilutPaths); created = true; @@ -158,12 +153,6 @@ public class ILUT { * Exit cleanly by calling destroy. */ public static void destroy() { - - // We need to do nothing when running on mac, since all is destroyed in IL - if(LWJGLUtil.getPlatform() == LWJGLUtil.PLATFORM_MACOSX) { - return; - } - resetNativeStubs(ILUT.class); if (created) { nDestroy(); diff --git a/src/native/common/devil/extilu.c b/src/native/common/devil/extilu.c index 471c529c..04c829e7 100644 --- a/src/native/common/devil/extilu.c +++ b/src/native/common/devil/extilu.c @@ -11,9 +11,7 @@ static void* devILUhandle; #include #include #include -// note, we use the IL handle since it's all in one lib -extern const struct mach_header* devILhandle; -static const struct mach_header* devILUhandle; // never actually used, just makes it shut up +static const struct mach_header* devILUhandle; #include "extilu.h" #endif @@ -34,7 +32,7 @@ static void *NativeGetFunctionPointer(const char *function) { return NULL; mac_symbol_name[0] = '_'; strcpy(&(mac_symbol_name[1]), function); - NSSymbol symbol = NSLookupSymbolInImage(devILhandle, mac_symbol_name, NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR); + NSSymbol symbol = NSLookupSymbolInImage(devILUhandle, mac_symbol_name, NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR); free(mac_symbol_name); if (symbol == NULL) return NULL; diff --git a/src/native/common/devil/extilut.c b/src/native/common/devil/extilut.c index c4fdfc02..35544e58 100644 --- a/src/native/common/devil/extilut.c +++ b/src/native/common/devil/extilut.c @@ -11,9 +11,7 @@ static void* devILUThandle; #include #include #include -// note, we use the IL handle since it's all in one lib -extern const struct mach_header* devILhandle; -static const struct mach_header* devILUThandle; // never actually used, just makes it shut up +static const struct mach_header* devILUThandle; #include "extilut.h" #endif @@ -34,7 +32,7 @@ static void *NativeGetFunctionPointer(const char *function) { return NULL; mac_symbol_name[0] = '_'; strcpy(&(mac_symbol_name[1]), function); - NSSymbol symbol = NSLookupSymbolInImage(devILhandle, mac_symbol_name, NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR); + NSSymbol symbol = NSLookupSymbolInImage(devILUThandle, mac_symbol_name, NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR); free(mac_symbol_name); if (symbol == NULL) return NULL;