use of org.terasology.engine.subsystem.lwjgl.LwjglGraphics 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());
}
use of org.terasology.engine.subsystem.lwjgl.LwjglGraphics 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);
}
}
Aggregations