Search in sources :

Example 1 with LwjglInput

use of org.terasology.engine.subsystem.lwjgl.LwjglInput in project Terasology by MovingBlocks.

the class Terasology method populateSubsystems.

private static void populateSubsystems(TerasologyEngineBuilder builder) {
    if (isHeadless) {
        builder.add(new HeadlessGraphics()).add(new HeadlessTimer()).add(new HeadlessAudio()).add(new HeadlessInput());
    } else {
        EngineSubsystem audio = soundEnabled ? new LwjglAudio() : new HeadlessAudio();
        builder.add(audio).add(new LwjglGraphics()).add(new LwjglTimer()).add(new LwjglInput()).add(new BindsSubsystem()).add(new OpenVRInput());
    }
    builder.add(new HibernationSubsystem());
}
Also used : LwjglAudio(org.terasology.engine.subsystem.lwjgl.LwjglAudio) HeadlessTimer(org.terasology.engine.subsystem.headless.HeadlessTimer) BindsSubsystem(org.terasology.engine.subsystem.config.BindsSubsystem) HeadlessGraphics(org.terasology.engine.subsystem.headless.HeadlessGraphics) EngineSubsystem(org.terasology.engine.subsystem.EngineSubsystem) OpenVRInput(org.terasology.engine.subsystem.openvr.OpenVRInput) LwjglTimer(org.terasology.engine.subsystem.lwjgl.LwjglTimer) LwjglInput(org.terasology.engine.subsystem.lwjgl.LwjglInput) LwjglGraphics(org.terasology.engine.subsystem.lwjgl.LwjglGraphics) HeadlessInput(org.terasology.engine.subsystem.headless.HeadlessInput) HeadlessAudio(org.terasology.engine.subsystem.headless.HeadlessAudio) HibernationSubsystem(org.terasology.engine.subsystem.common.hibernation.HibernationSubsystem)

Example 2 with LwjglInput

use of org.terasology.engine.subsystem.lwjgl.LwjglInput in project Terasology by MovingBlocks.

the class TeraEd method run.

public void run() {
    JPopupMenu.setDefaultLightWeightPopupEnabled(false);
    try {
        for (UIManager.LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
            if ("Nimbus".equals(info.getName())) {
                UIManager.setLookAndFeel(info.getClassName());
                break;
            }
        }
    } catch (Exception e) {
        // If Nimbus is not available, you can set the GUI to another look and feel.
        logger.warn("Failed to set look and feel to Nimbus", e);
    }
    try {
        LwjglPortlet lwjglPortlet = new LwjglPortlet();
        PathManager.getInstance().useDefaultHomePath();
        engine = new TerasologyEngineBuilder().add(new LwjglGraphics()).add(new LwjglTimer()).add(new LwjglAudio()).add(new LwjglInput()).add(lwjglPortlet).build();
        sceneProperties = new SceneProperties(engine);
        mainWindow = new MainWindow(this, engine);
        lwjglPortlet.setCustomViewport(mainWindow.getViewport());
        engine.subscribeToStateChange(mainWindow);
        engine.run(new StateMainMenu());
    } catch (Throwable t) {
        logger.error("Uncaught Exception", t);
    }
}
Also used : LwjglPortlet(org.terasology.engine.subsystem.lwjgl.LwjglPortlet) LwjglAudio(org.terasology.engine.subsystem.lwjgl.LwjglAudio) TerasologyEngineBuilder(org.terasology.engine.TerasologyEngineBuilder) UIManager(javax.swing.UIManager) StateMainMenu(org.terasology.engine.modes.StateMainMenu) SceneProperties(org.terasology.editor.properties.SceneProperties) MainWindow(org.terasology.editor.ui.MainWindow) LwjglTimer(org.terasology.engine.subsystem.lwjgl.LwjglTimer) LwjglInput(org.terasology.engine.subsystem.lwjgl.LwjglInput) LwjglGraphics(org.terasology.engine.subsystem.lwjgl.LwjglGraphics)

Aggregations

LwjglAudio (org.terasology.engine.subsystem.lwjgl.LwjglAudio)2 LwjglGraphics (org.terasology.engine.subsystem.lwjgl.LwjglGraphics)2 LwjglInput (org.terasology.engine.subsystem.lwjgl.LwjglInput)2 LwjglTimer (org.terasology.engine.subsystem.lwjgl.LwjglTimer)2 UIManager (javax.swing.UIManager)1 SceneProperties (org.terasology.editor.properties.SceneProperties)1 MainWindow (org.terasology.editor.ui.MainWindow)1 TerasologyEngineBuilder (org.terasology.engine.TerasologyEngineBuilder)1 StateMainMenu (org.terasology.engine.modes.StateMainMenu)1 EngineSubsystem (org.terasology.engine.subsystem.EngineSubsystem)1 HibernationSubsystem (org.terasology.engine.subsystem.common.hibernation.HibernationSubsystem)1 BindsSubsystem (org.terasology.engine.subsystem.config.BindsSubsystem)1 HeadlessAudio (org.terasology.engine.subsystem.headless.HeadlessAudio)1 HeadlessGraphics (org.terasology.engine.subsystem.headless.HeadlessGraphics)1 HeadlessInput (org.terasology.engine.subsystem.headless.HeadlessInput)1 HeadlessTimer (org.terasology.engine.subsystem.headless.HeadlessTimer)1 LwjglPortlet (org.terasology.engine.subsystem.lwjgl.LwjglPortlet)1 OpenVRInput (org.terasology.engine.subsystem.openvr.OpenVRInput)1