using .dylibs for devil on mac

This commit is contained in:
Brian Matzon 2005-05-22 11:14:00 +00:00
parent 322f35351b
commit 4ad9b565d5
5 changed files with 7 additions and 54 deletions

View File

@ -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();
}

View File

@ -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();

View File

@ -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();

View File

@ -11,9 +11,7 @@ static void* devILUhandle;
#include <mach-o/dyld.h>
#include <stdlib.h>
#include <string.h>
// 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;

View File

@ -11,9 +11,7 @@ static void* devILUThandle;
#include <mach-o/dyld.h>
#include <stdlib.h>
#include <string.h>
// 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;