diff --git a/src/main/java/org/warp/picalculator/gui/DisplayManager.java b/src/main/java/org/warp/picalculator/gui/DisplayManager.java index a141e1d8..1faeed82 100755 --- a/src/main/java/org/warp/picalculator/gui/DisplayManager.java +++ b/src/main/java/org/warp/picalculator/gui/DisplayManager.java @@ -1,8 +1,9 @@ package org.warp.picalculator.gui; import java.io.IOException; + import it.unimi.dsi.fastutil.objects.ObjectArrayList; - + import org.warp.picalculator.Main; import org.warp.picalculator.Utils; import org.warp.picalculator.device.Keyboard; @@ -11,10 +12,11 @@ import org.warp.picalculator.gui.graphicengine.RenderingLoop; import org.warp.picalculator.gui.graphicengine.Renderer; import org.warp.picalculator.gui.graphicengine.cpu.CPUEngine; import org.warp.picalculator.gui.graphicengine.gpu.GPUEngine; +import org.warp.picalculator.gui.graphicengine.headless.HeadlessEngine; import org.warp.picalculator.gui.graphicengine.BinaryFont; import org.warp.picalculator.gui.graphicengine.Skin; import org.warp.picalculator.gui.screens.Screen; - + import com.pi4j.wiringpi.Gpio; public final class DisplayManager implements RenderingLoop { @@ -82,6 +84,10 @@ public final class DisplayManager implements RenderingLoop { Utils.debug.println("Using CPU Graphic Engine"); return d; } + d = new HeadlessEngine(); + if (d.isSupported()) { + System.err.println("Using Headless Engine! This is a problem! No other graphic engines are available."); + } throw new UnsupportedOperationException("No graphic engines available."); } diff --git a/src/main/java/org/warp/picalculator/gui/graphicengine/gpu/GPUEngine.java b/src/main/java/org/warp/picalculator/gui/graphicengine/gpu/GPUEngine.java index c5a551e8..7da0b9fe 100755 --- a/src/main/java/org/warp/picalculator/gui/graphicengine/gpu/GPUEngine.java +++ b/src/main/java/org/warp/picalculator/gui/graphicengine/gpu/GPUEngine.java @@ -125,8 +125,15 @@ public class GPUEngine implements org.warp.picalculator.gui.graphicengine.Graphi @Override public boolean isSupported() { - final boolean available = GLProfile.isAvailable(GLProfile.GL2ES1); - if (!available) { + boolean available = false; + boolean errored = false; + try { + available = GLProfile.isAvailable(GLProfile.GL2ES1); + } catch (Exception ex) { + errored = true; + System.err.println(ex.getMessage()); + } + if (!available && !errored) { System.err.println(GLProfile.glAvailabilityToString()); } return available; diff --git a/src/main/java/org/warp/picalculator/gui/graphicengine/headless/HeadlessEngine.java b/src/main/java/org/warp/picalculator/gui/graphicengine/headless/HeadlessEngine.java new file mode 100755 index 00000000..ddf7e6fd --- /dev/null +++ b/src/main/java/org/warp/picalculator/gui/graphicengine/headless/HeadlessEngine.java @@ -0,0 +1,4 @@ +package org.warp.picalculator.gui.graphicengine.headless; + +public class HeadlessEngine implements org.warp.picalculator.gui.graphicengine.GraphicEngine { +} diff --git a/src/main/java/org/warp/picalculator/gui/graphicengine/headless/HeadlessRenderer.java b/src/main/java/org/warp/picalculator/gui/graphicengine/headless/HeadlessRenderer.java new file mode 100755 index 00000000..f386b974 --- /dev/null +++ b/src/main/java/org/warp/picalculator/gui/graphicengine/headless/HeadlessRenderer.java @@ -0,0 +1,5 @@ +package org.warp.picalculator.gui.graphicengine.headless; + +public class HeadlessRenderer implements Renderer { + +}