using .dylibs for devil on mac
This commit is contained in:
parent
322f35351b
commit
4ad9b565d5
|
@ -583,23 +583,13 @@ public class IL {
|
||||||
String[] illPaths = LWJGLUtil.getLibraryPaths(new String[]{
|
String[] illPaths = LWJGLUtil.getLibraryPaths(new String[]{
|
||||||
"DevIL", "DevIL.dll",
|
"DevIL", "DevIL.dll",
|
||||||
"IL", "libIL.so",
|
"IL", "libIL.so",
|
||||||
"IL", "IL"}, IL.class.getClassLoader());
|
"IL", "libIL.dylib"}, IL.class.getClassLoader());
|
||||||
nCreate(illPaths);
|
nCreate(illPaths);
|
||||||
created = true;
|
created = true;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
IL.initNativeStubs();
|
IL.initNativeStubs();
|
||||||
IL.ilInit();
|
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;
|
created = true;
|
||||||
} catch (LWJGLException e) {
|
} catch (LWJGLException e) {
|
||||||
destroy();
|
destroy();
|
||||||
|
@ -613,17 +603,6 @@ public class IL {
|
||||||
public static void destroy() {
|
public static void destroy() {
|
||||||
resetNativeStubs(IL.class);
|
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) {
|
if (created) {
|
||||||
nDestroy();
|
nDestroy();
|
||||||
}
|
}
|
||||||
|
|
|
@ -163,15 +163,10 @@ public class ILU {
|
||||||
throw new LWJGLException("Cannot create ILU without having created IL instance");
|
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[]{
|
String[] iluPaths = LWJGLUtil.getLibraryPaths(new String[]{
|
||||||
"ILU", "ILU.dll",
|
"ILU", "ILU.dll",
|
||||||
"ILU", "libILU.so",
|
"ILU", "libILU.so",
|
||||||
"ILU", "ILU"}, ILU.class.getClassLoader());
|
"ILU", "libILU.dylib"}, ILU.class.getClassLoader());
|
||||||
nCreate(iluPaths);
|
nCreate(iluPaths);
|
||||||
created = true;
|
created = true;
|
||||||
|
|
||||||
|
@ -193,12 +188,6 @@ public class ILU {
|
||||||
* Exit cleanly by calling destroy.
|
* Exit cleanly by calling destroy.
|
||||||
*/
|
*/
|
||||||
public static void 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);
|
resetNativeStubs(ILU.class);
|
||||||
if (created) {
|
if (created) {
|
||||||
nDestroy();
|
nDestroy();
|
||||||
|
|
|
@ -128,15 +128,10 @@ public class ILUT {
|
||||||
throw new LWJGLException("Cannot create ILUT without having created IL instance");
|
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[]{
|
String[] ilutPaths = LWJGLUtil.getLibraryPaths(new String[]{
|
||||||
"ILUT", "ILUT.dll",
|
"ILUT", "ILUT.dll",
|
||||||
"ILUT", "libILUT.so",
|
"ILUT", "libILUT.so",
|
||||||
"ILUT", "IL"}, ILU.class.getClassLoader());
|
"ILUT", "libILUT.dylib"}, ILUT.class.getClassLoader());
|
||||||
nCreate(ilutPaths);
|
nCreate(ilutPaths);
|
||||||
created = true;
|
created = true;
|
||||||
|
|
||||||
|
@ -158,12 +153,6 @@ public class ILUT {
|
||||||
* Exit cleanly by calling destroy.
|
* Exit cleanly by calling destroy.
|
||||||
*/
|
*/
|
||||||
public static void 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);
|
resetNativeStubs(ILUT.class);
|
||||||
if (created) {
|
if (created) {
|
||||||
nDestroy();
|
nDestroy();
|
||||||
|
|
|
@ -11,9 +11,7 @@ static void* devILUhandle;
|
||||||
#include <mach-o/dyld.h>
|
#include <mach-o/dyld.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
// note, we use the IL handle since it's all in one lib
|
static const struct mach_header* devILUhandle;
|
||||||
extern const struct mach_header* devILhandle;
|
|
||||||
static const struct mach_header* devILUhandle; // never actually used, just makes it shut up
|
|
||||||
#include "extilu.h"
|
#include "extilu.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -34,7 +32,7 @@ static void *NativeGetFunctionPointer(const char *function) {
|
||||||
return NULL;
|
return NULL;
|
||||||
mac_symbol_name[0] = '_';
|
mac_symbol_name[0] = '_';
|
||||||
strcpy(&(mac_symbol_name[1]), function);
|
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);
|
free(mac_symbol_name);
|
||||||
if (symbol == NULL)
|
if (symbol == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
@ -11,9 +11,7 @@ static void* devILUThandle;
|
||||||
#include <mach-o/dyld.h>
|
#include <mach-o/dyld.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
// note, we use the IL handle since it's all in one lib
|
static const struct mach_header* devILUThandle;
|
||||||
extern const struct mach_header* devILhandle;
|
|
||||||
static const struct mach_header* devILUThandle; // never actually used, just makes it shut up
|
|
||||||
#include "extilut.h"
|
#include "extilut.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -34,7 +32,7 @@ static void *NativeGetFunctionPointer(const char *function) {
|
||||||
return NULL;
|
return NULL;
|
||||||
mac_symbol_name[0] = '_';
|
mac_symbol_name[0] = '_';
|
||||||
strcpy(&(mac_symbol_name[1]), function);
|
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);
|
free(mac_symbol_name);
|
||||||
if (symbol == NULL)
|
if (symbol == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
Loading…
Reference in New Issue