use of org.terasology.engine.core.subsystem.headless.renderer.HeadlessCanvasRenderer in project Terasology by MovingBlocks.
the class HeadlessGraphics method postInitialise.
@Override
public void postInitialise(Context context) {
context.put(RenderingSubsystemFactory.class, new HeadlessRenderingSubsystemFactory());
HeadlessDisplayDevice headlessDisplay = new HeadlessDisplayDevice();
context.put(DisplayDevice.class, headlessDisplay);
initHeadless(context);
context.put(CanvasRenderer.class, new HeadlessCanvasRenderer());
}
use of org.terasology.engine.core.subsystem.headless.renderer.HeadlessCanvasRenderer in project Terasology by MovingBlocks.
the class ContextMenuUtilsTest method setupInput.
@BeforeAll
public static void setupInput() {
context.put(InputSystem.class, new InputSystem());
context.put(TranslationSystem.class, new TranslationSystemImpl(context));
context.put(CanvasRenderer.class, new HeadlessCanvasRenderer());
context.put(NUIManager.class, new NUIManagerInternal((TerasologyCanvasRenderer) context.get(CanvasRenderer.class), context));
File file = new File(ContextMenuUtilsTest.class.getClassLoader().getResource("contextMenuBuilderInput.ui").getFile());
String content = null;
try {
content = Files.asCharSource(file, Charsets.UTF_8).read();
} catch (IOException e) {
fail("Could not load input file", e);
}
inputTree = JsonTreeConverter.serialize(new JsonParser().parse(content));
}
Aggregations