Move more logging to Java side
This commit is contained in:
parent
e9b94885d9
commit
02f595e0b9
|
@ -147,7 +147,9 @@ public final class CL {
|
||||||
/** Helper method to get a pointer to a named function in the OpenCL library. */
|
/** Helper method to get a pointer to a named function in the OpenCL library. */
|
||||||
static long getFunctionAddress(String name) {
|
static long getFunctionAddress(String name) {
|
||||||
ByteBuffer buffer = MemoryUtil.encodeASCII(name);
|
ByteBuffer buffer = MemoryUtil.encodeASCII(name);
|
||||||
return ngetFunctionAddress(MemoryUtil.getAddress(buffer));
|
long address = ngetFunctionAddress(MemoryUtil.getAddress(buffer));
|
||||||
|
if (address == null) LWJGLUtil.logger().log(() -> "Could not locate symbol " + name);
|
||||||
|
return address;
|
||||||
}
|
}
|
||||||
private static native long ngetFunctionAddress(long name);
|
private static native long ngetFunctionAddress(long name);
|
||||||
|
|
||||||
|
|
|
@ -204,7 +204,9 @@ public final class GLContext {
|
||||||
/** Helper method to get a pointer to a named function in the OpenGL library. */
|
/** Helper method to get a pointer to a named function in the OpenGL library. */
|
||||||
public static long getFunctionAddress(String name) {
|
public static long getFunctionAddress(String name) {
|
||||||
ByteBuffer buffer = MemoryUtil.encodeASCII(name);
|
ByteBuffer buffer = MemoryUtil.encodeASCII(name);
|
||||||
return ngetFunctionAddress(MemoryUtil.getAddress(buffer));
|
long address = ngetFunctionAddress(MemoryUtil.getAddress(buffer));
|
||||||
|
if (address == null) LWJGLUtil.logger().log(() -> "Could not locate symbol " + name);
|
||||||
|
return address;
|
||||||
}
|
}
|
||||||
private static native long ngetFunctionAddress(long name);
|
private static native long ngetFunctionAddress(long name);
|
||||||
|
|
||||||
|
|
|
@ -270,8 +270,10 @@ bool ext_InitializeFunctions(ExtGetProcAddressPROC gpa, int num_functions, ExtFu
|
||||||
ExtFunction *function = functions + i;
|
ExtFunction *function = functions + i;
|
||||||
if (function->ext_function_name != NULL) {
|
if (function->ext_function_name != NULL) {
|
||||||
void *ext_func_pointer = gpa(function->ext_function_name);
|
void *ext_func_pointer = gpa(function->ext_function_name);
|
||||||
if (ext_func_pointer == NULL)
|
if (ext_func_pointer == NULL) {
|
||||||
|
printfDebug("Could not locate symbol %s\n", function->ext_function_name);
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
ext_function_pointer_pointer = function->ext_function_pointer;
|
ext_function_pointer_pointer = function->ext_function_pointer;
|
||||||
*ext_function_pointer_pointer = ext_func_pointer;
|
*ext_function_pointer_pointer = ext_func_pointer;
|
||||||
}
|
}
|
||||||
|
@ -308,6 +310,8 @@ void ext_InitializeClass(JNIEnv *env, jclass clazz, ExtGetProcAddressPROC gpa, i
|
||||||
if (function->ext_function_name != NULL) {
|
if (function->ext_function_name != NULL) {
|
||||||
ext_func_pointer = gpa(function->ext_function_name);
|
ext_func_pointer = gpa(function->ext_function_name);
|
||||||
if (ext_func_pointer == NULL) {
|
if (ext_func_pointer == NULL) {
|
||||||
|
printfDebug("Could not locate symbol %s\n", function->ext_function_name);
|
||||||
|
|
||||||
if ( function->optional )
|
if ( function->optional )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
|
|
@ -65,9 +65,6 @@ void* extal_GetProcAddress(const char* function) {
|
||||||
/* p = alGetProcAddress((const ALubyte*)function);
|
/* p = alGetProcAddress((const ALubyte*)function);
|
||||||
if (p == NULL) {*/
|
if (p == NULL) {*/
|
||||||
p = extal_NativeGetFunctionPointer(function);
|
p = extal_NativeGetFunctionPointer(function);
|
||||||
if (p == NULL) {
|
|
||||||
printfDebug("Could not locate symbol %s\n", function);
|
|
||||||
}
|
|
||||||
// }
|
// }
|
||||||
return p;
|
return p;
|
||||||
}
|
}
|
||||||
|
|
|
@ -252,9 +252,6 @@ void *extgl_GetProcAddress(const char *name) {
|
||||||
void *t = (void*)lwjgl_glXGetProcAddressARB((const GLubyte*)name);
|
void *t = (void*)lwjgl_glXGetProcAddressARB((const GLubyte*)name);
|
||||||
if (t == NULL) {
|
if (t == NULL) {
|
||||||
t = dlsym(lib_gl_handle, name);
|
t = dlsym(lib_gl_handle, name);
|
||||||
if (t == NULL) {
|
|
||||||
printfDebug("Could not locate symbol %s\n", name);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,12 +58,10 @@ void *extgl_GetProcAddress(const char *name) {
|
||||||
|
|
||||||
if ( t == NULL ) {
|
if ( t == NULL ) {
|
||||||
t = dlsym(lib_gl_handle, name);
|
t = dlsym(lib_gl_handle, name);
|
||||||
if ( t == NULL )
|
|
||||||
printfDebug("Could not locate symbol %s\n", name);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//if ( t != NULL )
|
//if ( t != NULL )
|
||||||
//printfDebug("Located symbol %s\n", name);
|
//printfDebug("Located symbol %s\n", name);
|
||||||
|
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,8 +46,6 @@ void *extgl_GetProcAddress(const char *name) {
|
||||||
CFStringRef cf_name = CFStringCreateWithCString(NULL, name, kCFStringEncodingUTF8);
|
CFStringRef cf_name = CFStringCreateWithCString(NULL, name, kCFStringEncodingUTF8);
|
||||||
void *address = CFBundleGetFunctionPointerForName(opengl_bundle, cf_name);
|
void *address = CFBundleGetFunctionPointerForName(opengl_bundle, cf_name);
|
||||||
CFRelease(cf_name);
|
CFRelease(cf_name);
|
||||||
if (address == NULL)
|
|
||||||
printfDebug("Could not locate symbol %s\n", name);
|
|
||||||
return address;
|
return address;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,10 +45,6 @@ void *extgl_GetProcAddress(const char *name) {
|
||||||
if (t == NULL)
|
if (t == NULL)
|
||||||
{
|
{
|
||||||
t = GetProcAddress(lib_gl_handle, name);
|
t = GetProcAddress(lib_gl_handle, name);
|
||||||
if (t == NULL)
|
|
||||||
{
|
|
||||||
printfDebug("Could not locate symbol %s\n", name);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,10 +44,6 @@ void *extgl_GetProcAddress(const char *name) {
|
||||||
if (t == NULL)
|
if (t == NULL)
|
||||||
{
|
{
|
||||||
t = GetProcAddress(lib_gl_handle, name);
|
t = GetProcAddress(lib_gl_handle, name);
|
||||||
if (t == NULL)
|
|
||||||
{
|
|
||||||
printfDebug("Could not locate symbol %s\n", name);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue