Move more logging to Java side

This commit is contained in:
Michael Pfaff 2022-10-05 18:08:45 -04:00
parent e9b94885d9
commit 02f595e0b9
Signed by: michael
GPG Key ID: CF402C4A012AA9D4
9 changed files with 12 additions and 22 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -58,12 +58,10 @@ 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 )
//printfDebug("Located symbol %s\n", name);
return t;
}
}

View File

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

View File

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

View File

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