public class AWT extends Object implements AutoCloseable
Example 1:
Component c = ...;
try(AWT awt = new AWT(c)) {
long pPlatformInfo = awt.getPlatformInfo();
// ... do something with the platform info
}
// The AWT object is automatically freed!
Example 2:
Component c = ...;
AWT awt = new AWT(c);
long pPlatformInfo = awt.getPlatformInfo();
// ... do something with the platform info
awt.close();
| Constructor and Description |
|---|
AWT(Component component)
Initializes native window handlers from the desired AWT component.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Frees memory and unlocks the drawing surface.
|
org.lwjgl.system.jawt.JAWTDrawingSurfaceInfo |
getDrawingSurfaceInfo()
Gets the underlying platform drawing surface struct.
|
long |
getPlatformInfo()
Returns a pointer to a platform-specific struct with platform-specific information.
|
static boolean |
isPlatformSupported()
Checks if the platform is supported using lwjgl3-awt.
|
public AWT(Component component) throws AWTException
Component, but should be a canvas
or window for native rendering.
If not used in a try-with-resources block, call close() when done.
component - a component to render ontoAWTException - Fails for one of the provided reasons:
public static boolean isPlatformSupported()
public long getPlatformInfo()
The pointer can be safely used as a JAWTWin32DrawingSurfaceInfo
or JAWTX11DrawingSurfaceInfo struct, or--if on MacOS--
a pointer to an NSObject.
On win32 or X11 platforms, this can easily be created in Java via LWJGL's
#create(long) method.
public org.lwjgl.system.jawt.JAWTDrawingSurfaceInfo getDrawingSurfaceInfo()
public void close()
close in interface AutoCloseableCopyright © 2016–2024 LWJGLX. All rights reserved.