added a headless render stub
This commit is contained in:
parent
e4a0fbb48e
commit
144fb1593f
@ -1,6 +1,7 @@
|
|||||||
package org.warp.picalculator.gui;
|
package org.warp.picalculator.gui;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
import it.unimi.dsi.fastutil.objects.ObjectArrayList;
|
import it.unimi.dsi.fastutil.objects.ObjectArrayList;
|
||||||
|
|
||||||
import org.warp.picalculator.Main;
|
import org.warp.picalculator.Main;
|
||||||
@ -11,6 +12,7 @@ import org.warp.picalculator.gui.graphicengine.RenderingLoop;
|
|||||||
import org.warp.picalculator.gui.graphicengine.Renderer;
|
import org.warp.picalculator.gui.graphicengine.Renderer;
|
||||||
import org.warp.picalculator.gui.graphicengine.cpu.CPUEngine;
|
import org.warp.picalculator.gui.graphicengine.cpu.CPUEngine;
|
||||||
import org.warp.picalculator.gui.graphicengine.gpu.GPUEngine;
|
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.BinaryFont;
|
||||||
import org.warp.picalculator.gui.graphicengine.Skin;
|
import org.warp.picalculator.gui.graphicengine.Skin;
|
||||||
import org.warp.picalculator.gui.screens.Screen;
|
import org.warp.picalculator.gui.screens.Screen;
|
||||||
@ -82,6 +84,10 @@ public final class DisplayManager implements RenderingLoop {
|
|||||||
Utils.debug.println("Using CPU Graphic Engine");
|
Utils.debug.println("Using CPU Graphic Engine");
|
||||||
return d;
|
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.");
|
throw new UnsupportedOperationException("No graphic engines available.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -125,8 +125,15 @@ public class GPUEngine implements org.warp.picalculator.gui.graphicengine.Graphi
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isSupported() {
|
public boolean isSupported() {
|
||||||
final boolean available = GLProfile.isAvailable(GLProfile.GL2ES1);
|
boolean available = false;
|
||||||
if (!available) {
|
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());
|
System.err.println(GLProfile.glAvailabilityToString());
|
||||||
}
|
}
|
||||||
return available;
|
return available;
|
||||||
|
@ -0,0 +1,4 @@
|
|||||||
|
package org.warp.picalculator.gui.graphicengine.headless;
|
||||||
|
|
||||||
|
public class HeadlessEngine implements org.warp.picalculator.gui.graphicengine.GraphicEngine {
|
||||||
|
}
|
@ -0,0 +1,5 @@
|
|||||||
|
package org.warp.picalculator.gui.graphicengine.headless;
|
||||||
|
|
||||||
|
public class HeadlessRenderer implements Renderer {
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user