/**
  * The {@code ARBDebugOutputCallback.Handler} implementation passed to this method will be used
  * for ARB_debug_output messages. If callback is null, any previously registered handler for the
  * current thread will be unregistered and stop receiving messages.
  *
  * <p>
  *
  * @param callback the callback function to use
  */
 public static void glDebugMessageCallbackARB(ARBDebugOutputCallback callback) {
   ContextCapabilities caps = GLContext.getCapabilities();
   long function_pointer = caps.glDebugMessageCallbackARB;
   BufferChecks.checkFunctionAddress(function_pointer);
   long userParam = callback == null ? 0 : CallbackUtil.createGlobalRef(callback.getHandler());
   CallbackUtil.registerContextCallbackARB(userParam);
   nglDebugMessageCallbackARB(
       callback == null ? 0 : callback.getPointer(), userParam, function_pointer);
 }
示例#2
0
 public static int clSetMemObjectDestructorCallback(
     CLMem memobj, CLMemObjectDestructorCallback pfn_notify) {
   long function_pointer = CLCapabilities.clSetMemObjectDestructorCallback;
   BufferChecks.checkFunctionAddress(function_pointer);
   long user_data = CallbackUtil.createGlobalRef(pfn_notify);
   int __result = 0;
   try {
     __result =
         nclSetMemObjectDestructorCallback(
             memobj.getPointer(), pfn_notify.getPointer(), user_data, function_pointer);
     return __result;
   } finally {
     CallbackUtil.checkCallback(__result, user_data);
   }
 }
示例#3
0
 public static int clSetEventCallback(
     CLEvent event, int command_exec_callback_type, CLEventCallback pfn_notify) {
   long function_pointer = CLCapabilities.clSetEventCallback;
   BufferChecks.checkFunctionAddress(function_pointer);
   long user_data = CallbackUtil.createGlobalRef(pfn_notify);
   pfn_notify.setRegistry(event.getParentRegistry());
   int __result = 0;
   try {
     __result =
         nclSetEventCallback(
             event.getPointer(),
             command_exec_callback_type,
             pfn_notify.getPointer(),
             user_data,
             function_pointer);
     return __result;
   } finally {
     CallbackUtil.checkCallback(__result, user_data);
   }
 }