Package org.lwjgl.system
Class Callback
- java.lang.Object
-
- org.lwjgl.system.Callback
-
- All Implemented Interfaces:
- java.lang.AutoCloseable, NativeResource, Pointer
- Direct Known Subclasses:
- EnumerationMutationHandler, WindowProc
public abstract class Callback extends java.lang.Object implements Pointer, 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 static java.lang.String
__stdcall(java.lang.String signature)
long
address()
Returns the raw pointer address as along
value.boolean
equals(java.lang.Object o)
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.int
hashCode()
java.lang.String
toString()
-
Methods inherited from interface org.lwjgl.system.NativeResource
close
-
-
-
-
Method Detail
-
address
public long address()
Description copied from interface:Pointer
Returns the raw pointer address as along
value.
-
free
public void free()
Description copied from interface:NativeResource
Frees any native resources held by this object.- Specified by:
free
in interfaceNativeResource
-
__stdcall
public static java.lang.String __stdcall(java.lang.String signature)
-
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
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-