From 68c2395b3098f374973e66ca962a0bde929e0a1d Mon Sep 17 00:00:00 2001 From: Harvey Harrison Date: Fri, 28 Oct 2016 16:13:28 -0700 Subject: j3dcore: allow Java3D to operate in headless mode when using the noop renderer [Suggested by Emmanuel Puybaret] Signed-off-by: Harvey Harrison --- src/javax/media/j3d/MasterControl.java | 5 +++++ src/javax/media/j3d/VirtualUniverse.java | 7 ------- 2 files changed, 5 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/javax/media/j3d/MasterControl.java b/src/javax/media/j3d/MasterControl.java index 0d7af66..c63dfd9 100644 --- a/src/javax/media/j3d/MasterControl.java +++ b/src/javax/media/j3d/MasterControl.java @@ -833,6 +833,11 @@ private static String getProperty(final String prop) { // Use default pipeline } + // Java 3D cannot run in headless mode unless using the noop renderer + if (java.awt.GraphicsEnvironment.isHeadless() && pipelineType != Pipeline.Type.NOOP) { + throw new java.awt.HeadlessException(); + } + // Construct the singleton Pipeline instance Pipeline.createPipeline(pipelineType); diff --git a/src/javax/media/j3d/VirtualUniverse.java b/src/javax/media/j3d/VirtualUniverse.java index 624bccb..42e3725 100644 --- a/src/javax/media/j3d/VirtualUniverse.java +++ b/src/javax/media/j3d/VirtualUniverse.java @@ -262,13 +262,6 @@ ArrayList viewIdFreeList = new ArrayList(); } } - // Java 3D cannot run in headless mode, so we will throw a - // HeadlessException if isHeadless() is true. This avoids a - // cryptic error message from MasterControl.loadLibraries(). - if (java.awt.GraphicsEnvironment.isHeadless()) { - throw new java.awt.HeadlessException(); - } - // Load the native libraries and create the static // MasterControl object MasterControl.loadLibraries(); -- cgit v1.2.3