- All Known Subinterfaces:
GLDebugProc
,GLDebugProcAMD
,IGLFWCharFun
,IGLFWCursorEnterFun
,IGLFWCursorPosFun
,IGLFWDropFun
,IGLFWErrorFun
,IGLFWFramebufferSizeFun
,IGLFWJoystickFun
,IGLFWKeyFun
,IGLFWMonitorFun
,IGLFWMouseButtonFun
,IGLFWScrollFun
,IGLFWWindowCloseFun
,IGLFWWindowContentScaleFun
,IGLFWWindowFocusFun
,IGLFWWindowIconifyFun
,IGLFWWindowMaximizeFun
,IGLFWWindowPosFun
,IGLFWWindowRefreshFun
,IGLFWWindowSizeFun
,STBIIoCallbacks.Eof
,STBIIoCallbacks.Read
,STBIIoCallbacks.Skip
,STBIWriteFunc
public interface Callback
Callback
relies on preview features of the Java platform:
Callback
refers to one or more preview APIs:Arena
,FunctionDescriptor
,MemorySegment
.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
The upcall stub which can be passed to other foreign functions as a function pointer,
with the given arena.
- Since:
- 0.1.0
- Author:
- squid233
-
Method Summary
Modifier and TypeMethodDescriptiondefault MemorySegmentPREVIEW
Gets the address with the given arena.Returns the function descriptor of this callback.handle
(MethodHandles.Lookup lookup) Finds the method handle from the given method handles lookup.default MemorySegmentPREVIEW
segment
(ArenaPREVIEW arena, FunctionDescriptorPREVIEW function) Gets the memory segment of the upcall stub with the given arena.
-
Method Details
-
address
Gets the address with the given arena.- Parameters:
arena
- the arena.- Returns:
- the memory address.
-
descriptor
FunctionDescriptorPREVIEW descriptor()Returns the function descriptor of this callback.- Returns:
- the function descriptor of this callback
-
handle
MethodHandle handle(MethodHandles.Lookup lookup) throws NoSuchMethodException, IllegalAccessException Finds the method handle from the given method handles lookup.- Parameters:
lookup
- the lookup- Returns:
- the method handle
- Throws:
NoSuchMethodException
- if the method does not existIllegalAccessException
- if access checking fails, or if the method isstatic
, or if the method's variable arity modifier bit is set andasVarargsCollector
fails
-
segment
Gets the memory segment of the upcall stub with the given arena.- Parameters:
arena
- the arena.function
- the function descriptor.- Returns:
- the memory segment.
-
Callback
when preview features are enabled.