Package org.terasology.engine.subsystem

Examples of org.terasology.engine.subsystem.DisplayDevice


    private boolean shouldUpdateWorld() {
        return !pauseGame;
    }

    public void render() {
        DisplayDevice displayDevice = CoreRegistry.get(DisplayDevice.class);
        displayDevice.prepareToRender();

        if (worldRenderer != null) {
            if (!CoreRegistry.get(Config.class).getRendering().isOculusVrSupport()) {
                worldRenderer.render(DefaultRenderingProcess.StereoRenderState.MONO);
            } else {
View Full Code Here


    }

    private void mainLoop() {
        NetworkSystem networkSystem = CoreRegistry.get(NetworkSystem.class);

        DisplayDevice display = CoreRegistry.get(DisplayDevice.class);

        PerformanceMonitor.startActivity("Other");
        // MAIN GAME LOOP
        while (running && !display.isCloseRequested()) {

            // Only process rendering and updating once a second
            if (!display.isActive() && isHibernationAllowed()) {
                time.setPaused(true);
                Iterator<Float> updateCycles = time.tick();
                while (updateCycles.hasNext()) {
                    updateCycles.next();
                }
                try {
                    Thread.sleep(100);
                } catch (InterruptedException e) {
                    logger.warn("Display inactivity sleep interrupted", e);
                }

                display.processMessages();
                time.setPaused(false);
                continue;
            }

            processStateChanges();
View Full Code Here

    }

    public void setFullscreen(boolean state) {
        if (config.getRendering().isFullscreen() != state) {
            config.getRendering().setFullscreen(state);
            DisplayDevice display = CoreRegistry.get(DisplayDevice.class);
            display.setFullscreen(state);
        }
    }
View Full Code Here

        this.hibernationAllowed = allowed;
    }

    @Override
    public boolean hasFocus() {
        DisplayDevice display = CoreRegistry.get(DisplayDevice.class);
        return gameFocused && display.isActive();
    }
View Full Code Here

    public ComponentSystemManager() {
    }

    public void loadSystems(ModuleEnvironment environment, NetworkMode netMode) {
        DisplayDevice displayDevice = CoreRegistry.get(DisplayDevice.class);
        boolean isHeadless = displayDevice.isHeadless();

        ListMultimap<Name, Class<?>> systemsByModule = ArrayListMultimap.create();
        for (Class<?> type : environment.getTypesAnnotatedWith(RegisterSystem.class)) {
            if (!ComponentSystem.class.isAssignableFrom(type)) {
                logger.error("Cannot load {}, must be a subclass of ComponentSystem", type.getSimpleName());
View Full Code Here

TOP

Related Classes of org.terasology.engine.subsystem.DisplayDevice

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.