/** * Returns true if mouse emulation is enabled, false otherwise. * * @return Mouse emulation mode. */ public boolean isEmulateMouse() { return getBoolean("TouchEmulateMouse"); }
/** * Get the vsync state * @see #setVSync(boolean) */ public boolean isVSync() { return getBoolean("VSync"); }
/** * Get the fullscreen state * @see #setFullscreen(boolean) */ public boolean isFullscreen() { return getBoolean("Fullscreen"); }
/** * Determine if the display window can be resized by dragging its edges. * * @return True if the window is resizable, false if it is fixed size. * * @see #setResizable(boolean) */ public boolean isResizable() { return getBoolean("Resizable"); }
/** * Get the use joysticks state * @see #setUseJoysticks(boolean) */ public boolean useJoysticks() { return !getBoolean("DisableJoysticks"); }
/** * Determine if the display context will swap buffers every frame. * * @return True if buffer swapping is enabled, false otherwise. * * @see #setSwapBuffers(boolean) */ public boolean isSwapBuffers() { return getBoolean("SwapBuffers"); }
/** * Returns true if keyboard emulation is enabled, false otherwise. * * @return Soft keyboard emulation mode. */ public boolean isEmulateKeyboard() { return getBoolean("TouchEmulateKeyboard"); }
/** * Get the use input state. * @see #setUseInput(boolean) */ public boolean useInput() { return getBoolean("UseInput"); }
/** * Get the stereo 3D state * @see #setStereo3D(boolean) */ public boolean useStereo3D(){ return getBoolean("Stereo3D"); }
public boolean isOpenCLSupport() { return getBoolean("OpenCL"); }
public boolean isGammaCorrection() { return getBoolean("GammaCorrection"); }
public boolean isEmulateMouseFlipX() { return getBoolean("TouchEmulateMouseFlipX"); }
public boolean isEmulateMouseFlipY() { return getBoolean("TouchEmulateMouseFlipY"); }
/** * Process the attached settings and apply changes to this app state. * @param settings the app settings to process. */ protected void processSettings(AppSettings settings){ if (settings != null){ if (settings.get(VRConstants.SETTING_DISABLE_VR) != null){ DISABLE_VR = settings.getBoolean(VRConstants.SETTING_DISABLE_VR); } } } }
protected void initInThread() { created.set(true); logger.fine("OGLESContext create"); logger.log(Level.FINE, "Running on thread: {0}", Thread.currentThread().getName()); // Setup unhandled Exception Handler Thread.currentThread().setUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() { public void uncaughtException(Thread thread, Throwable thrown) { listener.handleError("Exception thrown in " + thread.toString(), thrown); } }); timer = new NanoTimer(); Object gl = new AndroidGL(); if (settings.getBoolean("GraphicsDebug")) { gl = new GLDebugES((GL) gl, (GLExt) gl, (GLFbo) gl); } if (settings.getBoolean("GraphicsTrace")) { gl = GLTracer.createGlesTracer(gl, GL.class, GLFbo.class, GLExt.class); } renderer = new GLRenderer((GL)gl, (GLExt)gl, (GLFbo)gl); renderer.initialize(); JmeSystem.setSoftTextDialogInput(this); needClose.set(false); }
protected ContextAttribs createContextAttribs() { if (settings.getBoolean("GraphicsDebug") || settings.getRenderer().equals(AppSettings.LWJGL_OPENGL3)) { ContextAttribs attr; if (settings.getRenderer().equals(AppSettings.LWJGL_OPENGL3)) { attr = new ContextAttribs(3, 2); attr = attr.withProfileCore(true).withForwardCompatible(true).withProfileCompatibility(false); } else { attr = new ContextAttribs(); } if (settings.getBoolean("GraphicsDebug")) { attr = attr.withDebug(true); } return attr; } else { return null; } } protected int determineMaxSamples(int requestedSamples) {
assertEqual(loadedSettings.getBoolean("TestBool"), true); assertEqual(loadedSettings.getInteger("TestInt"), 123); assertEqual(loadedSettings.getString("TestStr"), "HelloWorld");
/** * Initializes mouse and keyboard input. Also * initializes joystick input if joysticks are enabled in the * AppSettings. */ private void initInput(){ mouseInput = context.getMouseInput(); if (mouseInput != null) mouseInput.initialize(); keyInput = context.getKeyInput(); if (keyInput != null) keyInput.initialize(); touchInput = context.getTouchInput(); if (touchInput != null) touchInput.initialize(); if (!settings.getBoolean("DisableJoysticks")){ joyInput = context.getJoyInput(); if (joyInput != null) joyInput.initialize(); } inputManager = new InputManager(mouseInput, keyInput, joyInput, touchInput); }
/** * Initializes mouse and keyboard input. Also * initializes joystick input if joysticks are enabled in the * AppSettings. */ private void initInput(){ mouseInput = context.getMouseInput(); if (mouseInput != null) mouseInput.initialize(); keyInput = context.getKeyInput(); if (keyInput != null) keyInput.initialize(); touchInput = context.getTouchInput(); if (touchInput != null) touchInput.initialize(); if (!settings.getBoolean("DisableJoysticks")){ joyInput = context.getJoyInput(); if (joyInput != null) joyInput.initialize(); } inputManager = new InputManager(mouseInput, keyInput, joyInput, touchInput); }
/** * Tests preference based AppSettings. */ private static void testPreferenceSettings() { AppSettings settings = new AppSettings(false); settings.putBoolean("TestBool", true); settings.putInteger("TestInt", 123); settings.putString("TestStr", "HelloWorld"); settings.putFloat("TestFloat", 123.567f); settings.put("TestObj", new Mesh()); // Objects not supported by preferences try { settings.save(APPSETTINGS_KEY); } catch (BackingStoreException ex) { ex.printStackTrace(); } AppSettings loadedSettings = new AppSettings(false); try { loadedSettings.load(APPSETTINGS_KEY); } catch (BackingStoreException ex) { ex.printStackTrace(); } assertEqual(loadedSettings.getBoolean("TestBool"), true); assertEqual(loadedSettings.getInteger("TestInt"), 123); assertEqual(loadedSettings.getString("TestStr"), "HelloWorld"); assertEqual(loadedSettings.get("TestFloat"), 123.567f); }