Package panamagl.platform.windows
Class NativeLibLoader_windows
java.lang.Object
panamagl.platform.windows.NativeLibLoader_windows
Load the DLL required by the Windows bindings.
opengl32 and glu32 are part of Windows and loaded by
load(). freeglut is not part of
Windows and optional : it is only loaded by loadGLUT(), which GLUT_windows
invokes at the first use of GLUT. It is loaded from the java.library.path if
available, otherwise from the freeglut.dll of the optional
panama-gl-bindings-windows-freeglut jar for the CPU of the JVM (x86_64 or
aarch64), which is extracted in the temporary directory before being loaded.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final StringThe optional jar embedding freeglut.dll.protected static booleanprotected static Stringstatic final StringOrigin of freeglut when loaded from thejava.library.path.static final StringFolder of the embedded native libraries in the classpath, followed by the CPU name. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PathExtract a resource of the classpath in a sub-folder of the given directory named after the hash of the resource content, and return the path of the extracted file.static StringWhere freeglut was loaded from :LIBRARY_PATH, or the path of the freeglut.dll extracted from the classpath.static booleanTrue once freeglut has been loaded byloadGLUT().static voidload()Load OpenGL related DLL : opengl32, glu32.static voidloadGLUT()Load freeglut from thejava.library.path, or from the freeglut.dll embedded in the optionalpanama-gl-bindings-windows-freeglutjar if not found there.static voidLoad required windows DLL : user32, gdi32, kernel32protected static StringnormalizeCPU(String cpu) Java reports amd64 on Intel/AMD CPUs and aarch64 on ARM64 CPUs.static StringPath of an embedded DLL in the classpath for the given CPU, as given by theos.archsystem property.protected static Stringsha256(byte[] content) protected static Path
-
Field Details
-
GLUT
- See Also:
-
NATIVES
Folder of the embedded native libraries in the classpath, followed by the CPU name.- See Also:
-
GLUT_ARTIFACT
-
LIBRARY_PATH
Origin of freeglut when loaded from thejava.library.path.- See Also:
-
glutLoaded
protected static boolean glutLoaded -
glutOrigin
-
-
Constructor Details
-
NativeLibLoader_windows
public NativeLibLoader_windows()
-
-
Method Details
-
load
public static void load()Load OpenGL related DLL : opengl32, glu32. freeglut is loaded byloadGLUT(). -
loadWindowsDLLs
public static void loadWindowsDLLs()Load required windows DLL : user32, gdi32, kernel32 -
loadGLUT
public static void loadGLUT()Load freeglut from thejava.library.path, or from the freeglut.dll embedded in the optionalpanama-gl-bindings-windows-freeglutjar if not found there. -
isGLUTLoaded
public static boolean isGLUTLoaded()True once freeglut has been loaded byloadGLUT(). -
getGLUTOrigin
Where freeglut was loaded from :LIBRARY_PATH, or the path of the freeglut.dll extracted from the classpath. Null if freeglut is not loaded. -
resource
-
normalizeCPU
-
extract
Extract a resource of the classpath in a sub-folder of the given directory named after the hash of the resource content, and return the path of the extracted file. A file already extracted by a previous run, possibly loaded by another running JVM, is reused instead of being written again, so that the temporary directory does not fill up with a copy per run.- Throws:
IOException
-
tempDirectory
-
sha256
-