Search in sources :

Example 1 with LwjglOffscreenBufferVR

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);
}
Also used : AppSettings(com.jme3.system.AppSettings) LwjglOffscreenBufferVR(com.jme3.system.lwjgl.LwjglOffscreenBufferVR) LwjglDisplayVR(com.jme3.system.lwjgl.LwjglDisplayVR)

Aggregations

AppSettings (com.jme3.system.AppSettings)1 LwjglDisplayVR (com.jme3.system.lwjgl.LwjglDisplayVR)1 LwjglOffscreenBufferVR (com.jme3.system.lwjgl.LwjglOffscreenBufferVR)1