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. */
|
||||
static long getFunctionAddress(String 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);
|
||||
|
||||
|
|
|
@ -204,7 +204,9 @@ public final class GLContext {
|
|||
/** Helper method to get a pointer to a named function in the OpenGL library. */
|
||||
public static long getFunctionAddress(String 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);
|
||||
|
||||
|
|
|
@ -270,8 +270,10 @@ bool ext_InitializeFunctions(ExtGetProcAddressPROC gpa, int num_functions, ExtFu
|
|||
ExtFunction *function = functions + i;
|
||||
if (function->ext_function_name != NULL) {
|
||||
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;
|
||||
}
|
||||
ext_function_pointer_pointer = function->ext_function_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) {
|
||||
ext_func_pointer = gpa(function->ext_function_name);
|
||||
if (ext_func_pointer == NULL) {
|
||||
printfDebug("Could not locate symbol %s\n", function->ext_function_name);
|
||||
|
||||
if ( function->optional )
|
||||
continue;
|
||||
|
||||
|
|
|
@ -65,9 +65,6 @@ void* extal_GetProcAddress(const char* function) {
|
|||
/* p = alGetProcAddress((const ALubyte*)function);
|
||||
if (p == NULL) {*/
|
||||
p = extal_NativeGetFunctionPointer(function);
|
||||
if (p == NULL) {
|
||||
printfDebug("Could not locate symbol %s\n", function);
|
||||
}
|
||||
// }
|
||||
return p;
|
||||
}
|
||||
|
|
|
@ -252,9 +252,6 @@ void *extgl_GetProcAddress(const char *name) {
|
|||
void *t = (void*)lwjgl_glXGetProcAddressARB((const GLubyte*)name);
|
||||
if (t == NULL) {
|
||||
t = dlsym(lib_gl_handle, name);
|
||||
if (t == NULL) {
|
||||
printfDebug("Could not locate symbol %s\n", name);
|
||||
}
|
||||
}
|
||||
return t;
|
||||
}
|
||||
|
|
|
@ -58,8 +58,6 @@ void *extgl_GetProcAddress(const char *name) {
|
|||
|
||||
if ( t == NULL ) {
|
||||
t = dlsym(lib_gl_handle, name);
|
||||
if ( t == NULL )
|
||||
printfDebug("Could not locate symbol %s\n", name);
|
||||
}
|
||||
|
||||
//if ( t != NULL )
|
||||
|
|
|
@ -46,8 +46,6 @@ void *extgl_GetProcAddress(const char *name) {
|
|||
CFStringRef cf_name = CFStringCreateWithCString(NULL, name, kCFStringEncodingUTF8);
|
||||
void *address = CFBundleGetFunctionPointerForName(opengl_bundle, cf_name);
|
||||
CFRelease(cf_name);
|
||||
if (address == NULL)
|
||||
printfDebug("Could not locate symbol %s\n", name);
|
||||
return address;
|
||||
}
|
||||
|
||||
|
|
|
@ -45,10 +45,6 @@ void *extgl_GetProcAddress(const char *name) {
|
|||
if (t == NULL)
|
||||
{
|
||||
t = GetProcAddress(lib_gl_handle, name);
|
||||
if (t == NULL)
|
||||
{
|
||||
printfDebug("Could not locate symbol %s\n", name);
|
||||
}
|
||||
}
|
||||
return t;
|
||||
}
|
||||
|
|
|
@ -44,10 +44,6 @@ void *extgl_GetProcAddress(const char *name) {
|
|||
if (t == NULL)
|
||||
{
|
||||
t = GetProcAddress(lib_gl_handle, name);
|
||||
if (t == NULL)
|
||||
{
|
||||
printfDebug("Could not locate symbol %s\n", name);
|
||||
}
|
||||
}
|
||||
return t;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue