use of com.jme3.system.lwjgl.LwjglOffscreenBufferVR in project jmonkeyengine by jMonkeyEngine.
the class VRApplication method start.
/**
* Starts the application.
* Creating a rendering context and executing the main loop in a separate thread.
* @param contextType the {@link com.jme3.system.JmeContext.Type type} of the context to create.
* @param waitFor if <code>true</code>, the method will wait until the application is started.
* @throws IllegalArgumentException if the context type is not supported.
*/
public void start(JmeContext.Type contextType, boolean waitFor) {
if (context != null && context.isCreated()) {
logger.warning("start() called when application already created!");
return;
}
if (settings == null) {
settings = new AppSettings(true);
}
logger.log(Level.FINE, "Starting application: {0}", getClass().getName());
// Create VR decicated context
if (contextType == Type.Display) {
context = new LwjglDisplayVR();
context.setSettings(settings);
} else if (contextType == Type.OffscreenSurface) {
context = new LwjglOffscreenBufferVR();
context.setSettings(settings);
} else {
logger.severe("Unsupported context type \"" + contextType + "\". Supported are \"Display\" and \"OffscreenSurface\"");
throw new IllegalArgumentException("Unsupported context type \"" + contextType + "\". Supported are \"Display\" and \"OffscreenSurface\"");
}
context.setSystemListener(this);
context.create(waitFor);
}
Aggregations