- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
GLLoadFunc
relies on preview features of the Java platform:
GLLoadFunc
refers to one or more preview APIs:MemorySegment
.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
The OpenGL loading function.
Example
// loads OpenGL compatibility profile
if (GLLoader.load(GLFW::getProcAddress, true) == null)
throw new IllegalStateException("Failed to load OpenGL");
- Since:
- 0.1.0
- Author:
- squid233
-
Method Summary
Modifier and TypeMethodDescriptionGets the function pointer of the given GL function.default @Nullable MethodHandle
invoke
(String procName, FunctionDescriptors function, Linker.OptionPREVIEW... options) Load a function by the given name and creates a downcall handle ornull
.default MethodHandle
trivialHandle
(String procName, FunctionDescriptors function) Load a trivial function by the given name and creates a downcall handle ornull
.
-
Method Details
-
invoke
Gets the function pointer of the given GL function.- Parameters:
string
- the name of the function.- Returns:
- the function pointer.
-
invoke
@Nullable default @Nullable MethodHandle invoke(String procName, FunctionDescriptors function, Linker.OptionPREVIEW... options) Load a function by the given name and creates a downcall handle ornull
.- Parameters:
procName
- the function namefunction
- the function descriptor of the target function.options
- the linker options associated with this linkage request.- Returns:
- a downcall method handle, or
null
if the symbol isMemorySegment.NULL
PREVIEW
-
trivialHandle
Load a trivial function by the given name and creates a downcall handle ornull
.- Parameters:
procName
- the function namefunction
- the function descriptor of the target function.- Returns:
- a downcall method handle, or
null
if the symbol isMemorySegment.NULL
PREVIEW
-
GLLoadFunc
when preview features are enabled.