Package org.lwjgl.system
Class Callback
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Callback
-
- All Implemented Interfaces:
- java.lang.AutoCloseable, NativeResource, Pointer
- Direct Known Subclasses:
- ChunkAlloc, ChunkCommit, ChunkDalloc, ChunkDecommit, ChunkMerge, ChunkPurge, ChunkSplit, CLContextCallback, CLEventCallback, CLMemObjectDestructorCallback, CLNativeKernel, CLProgramCallback, CLReportLiveObjectsAlteraCallback, CLSVMFreeCallback, EGLDebugMessageKHRCallback, EGLGetBlobFuncANDROID, EGLSetBlobFuncANDROID, EnumerationMutationHandler, GLDebugMessageAMDCallback, GLDebugMessageARBCallback, GLDebugMessageCallback, GLDebugMessageCallback, GLDebugMessageKHRCallback, GLFWCharCallback, GLFWCharModsCallback, GLFWCursorEnterCallback, GLFWCursorPosCallback, GLFWDropCallback, GLFWErrorCallback, GLFWFramebufferSizeCallback, GLFWJoystickCallback, GLFWKeyCallback, GLFWMonitorCallback, GLFWMouseButtonCallback, GLFWScrollCallback, GLFWWindowCloseCallback, GLFWWindowFocusCallback, GLFWWindowIconifyCallback, GLFWWindowPosCallback, GLFWWindowRefreshCallback, GLFWWindowSizeCallback, MallocMessageCallback, OVRLogCallback, STBIEOFCallback, STBIReadCallback, STBISkipCallback, STBIWriteCallback, VkAllocationFunction, VkDebugReportCallbackEXT, VkFreeFunction, VkInternalAllocationNotification, VkInternalFreeNotification, VkReallocationFunction, WindowProc
public abstract class Callback extends Pointer.Default implements NativeResource
Base class for dynamically created native functions that call into Java code.Callback instances use native resources and must be explicitly freed when no longer used by calling the
Callback.free()
method.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer
Pointer.Default
-
-
Field Summary
-
Fields inherited from interface org.lwjgl.system.Pointer
POINTER_SHIFT, POINTER_SIZE
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description void
free()
Frees any native resources held by this object.static void
free(long functionPointer)
Frees any resources held by the specified function pointer.static <T extends CallbackI>
Tget(long functionPointer)
Converts the specified function pointer to theCallbackI
instance associated with it.-
Methods inherited from class org.lwjgl.system.Pointer.Default
address, equals, hashCode, toString
-
Methods inherited from interface org.lwjgl.system.NativeResource
close
-
-
-
-
Method Detail
-
free
public void free()
Description copied from interface:NativeResource
Frees any native resources held by this object.- Specified by:
free
in interfaceNativeResource
-
get
public static <T extends CallbackI> T get(long functionPointer)
Converts the specified function pointer to theCallbackI
instance associated with it.- Type Parameters:
T
- theCallbackI
instance type- Parameters:
functionPointer
- a function pointer- Returns:
- the
CallbackI
instance, or null if the function pointer isNULL
.
-
free
public static void free(long functionPointer)
Frees any resources held by the specified function pointer.- Parameters:
functionPointer
- the function pointer
-
-