Search in sources :

Example 1 with HeadlessCanvasRenderer

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());
}
Also used : HeadlessRenderingSubsystemFactory(org.terasology.engine.core.subsystem.headless.renderer.HeadlessRenderingSubsystemFactory) HeadlessDisplayDevice(org.terasology.engine.core.subsystem.headless.device.HeadlessDisplayDevice) HeadlessCanvasRenderer(org.terasology.engine.core.subsystem.headless.renderer.HeadlessCanvasRenderer)

Example 2 with 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));
}
Also used : TranslationSystemImpl(org.terasology.engine.i18n.TranslationSystemImpl) CanvasRenderer(org.terasology.nui.canvas.CanvasRenderer) TerasologyCanvasRenderer(org.terasology.engine.rendering.nui.internal.TerasologyCanvasRenderer) HeadlessCanvasRenderer(org.terasology.engine.core.subsystem.headless.renderer.HeadlessCanvasRenderer) InputSystem(org.terasology.engine.input.InputSystem) IOException(java.io.IOException) TerasologyCanvasRenderer(org.terasology.engine.rendering.nui.internal.TerasologyCanvasRenderer) File(java.io.File) HeadlessCanvasRenderer(org.terasology.engine.core.subsystem.headless.renderer.HeadlessCanvasRenderer) NUIManagerInternal(org.terasology.engine.rendering.nui.internal.NUIManagerInternal) JsonParser(com.google.gson.JsonParser) BeforeAll(org.junit.jupiter.api.BeforeAll)

Aggregations

HeadlessCanvasRenderer (org.terasology.engine.core.subsystem.headless.renderer.HeadlessCanvasRenderer)2 JsonParser (com.google.gson.JsonParser)1 File (java.io.File)1 IOException (java.io.IOException)1 BeforeAll (org.junit.jupiter.api.BeforeAll)1 HeadlessDisplayDevice (org.terasology.engine.core.subsystem.headless.device.HeadlessDisplayDevice)1 HeadlessRenderingSubsystemFactory (org.terasology.engine.core.subsystem.headless.renderer.HeadlessRenderingSubsystemFactory)1 TranslationSystemImpl (org.terasology.engine.i18n.TranslationSystemImpl)1 InputSystem (org.terasology.engine.input.InputSystem)1 NUIManagerInternal (org.terasology.engine.rendering.nui.internal.NUIManagerInternal)1 TerasologyCanvasRenderer (org.terasology.engine.rendering.nui.internal.TerasologyCanvasRenderer)1 CanvasRenderer (org.terasology.nui.canvas.CanvasRenderer)1