From 90649456e038c85279463af021300bd61e089b5f Mon Sep 17 00:00:00 2001 From: javasabr Date: Sun, 1 Jan 2017 20:00:01 +0300 Subject: [PATCH] added checking property existing. --- .../main/java/com/jme3/system/lwjgl/LwjglContext.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/jme3-lwjgl3/src/main/java/com/jme3/system/lwjgl/LwjglContext.java b/jme3-lwjgl3/src/main/java/com/jme3/system/lwjgl/LwjglContext.java index 23227d652..1add5a529 100644 --- a/jme3-lwjgl3/src/main/java/com/jme3/system/lwjgl/LwjglContext.java +++ b/jme3-lwjgl3/src/main/java/com/jme3/system/lwjgl/LwjglContext.java @@ -72,7 +72,9 @@ import com.jme3.util.LWJGLBufferAllocator; import org.lwjgl.PointerBuffer; import org.lwjgl.glfw.GLFW; -import org.lwjgl.opencl.*; +import org.lwjgl.opencl.APPLEGLSharing; +import org.lwjgl.opencl.CL10; +import org.lwjgl.opencl.KHRGLSharing; import org.lwjgl.opengl.ARBDebugOutput; import org.lwjgl.opengl.ARBFramebufferObject; import org.lwjgl.opengl.EXTFramebufferMultisample; @@ -94,7 +96,10 @@ public abstract class LwjglContext implements JmeContext { private static final Logger logger = Logger.getLogger(LwjglContext.class.getName()); static { - System.setProperty(BufferAllocatorFactory.PROPERTY_BUFFER_ALLOCATOR_IMPLEMENTATION, LWJGLBufferAllocator.class.getName()); + final String implementation = BufferAllocatorFactory.PROPERTY_BUFFER_ALLOCATOR_IMPLEMENTATION; + if(System.getProperty(implementation) == null) { + System.setProperty(implementation, LWJGLBufferAllocator.class.getName()); + } } public static final boolean CL_GL_SHARING_POSSIBLE = true;