public boolean isKeyPressed (int key) { if (!Keyboard.isCreated()) return false; if (key == Input.Keys.ANY_KEY) return pressedKeys > 0; else return Keyboard.isKeyDown(getLwjglKeyCode(key)); }
@Override public float getPressure () { return getPressure(0); }
public int getX (int pointer) { if (pointer > 0) return 0; else return getX(); }
input.update(); shouldRender |= graphics.shouldRender(); input.processEvents(); if (audio != null) audio.update();
public LwjglApplication (ApplicationListener listener, LwjglApplicationConfiguration config, LwjglGraphics graphics) { LwjglNativesLoader.load(); setApplicationLogger(new LwjglApplicationLogger()); if (config.title == null) config.title = listener.getClass().getSimpleName(); this.graphics = graphics; if (!LwjglApplicationConfiguration.disableAudio) { try { audio = new OpenALAudio(config.audioDeviceSimultaneousSources, config.audioDeviceBufferCount, config.audioDeviceBufferSize); } catch (Throwable t) { log("LwjglApplication", "Couldn't initialize audio, disabling audio", t); LwjglApplicationConfiguration.disableAudio = true; } } files = new LwjglFiles(); input = new LwjglInput(); net = new LwjglNet(config); this.listener = listener; this.preferencesdir = config.preferencesDirectory; this.preferencesFileType = config.preferencesFileType; Gdx.app = this; Gdx.graphics = graphics; Gdx.audio = audio; Gdx.files = files; Gdx.input = input; Gdx.net = net; initialize(); }
@Override public float getPressure (int pointer) { return isTouched(pointer) ? 1 : 0; }
public int getY (int pointer) { if (pointer > 0) return 0; else return getY(); }
int y = Gdx.graphics.getHeight() - (int)(Mouse.getEventY() * Display.getPixelScaleFactor()) - 1; int button = Mouse.getEventButton(); int gdxButton = toGdxButton(button); if (button != -1 && gdxButton == -1) continue; // Ignore unknown button.
int keyCode = getGdxKeyCode(Keyboard.getEventKey()); char keyChar = Keyboard.getEventCharacter(); if (Keyboard.getEventKeyState() || (keyCode == 0 && keyChar != 0 && Character.isDefined(keyChar))) {
input.update(); shouldRender |= graphics.shouldRender(); input.processEvents(); if (audio != null) audio.update();
public LwjglApplication (ApplicationListener listener, LwjglApplicationConfiguration config, LwjglGraphics graphics) { LwjglNativesLoader.load(); setApplicationLogger(new LwjglApplicationLogger()); if (config.title == null) config.title = listener.getClass().getSimpleName(); this.graphics = graphics; if (!LwjglApplicationConfiguration.disableAudio) { try { audio = new OpenALAudio(config.audioDeviceSimultaneousSources, config.audioDeviceBufferCount, config.audioDeviceBufferSize); } catch (Throwable t) { log("LwjglApplication", "Couldn't initialize audio, disabling audio", t); LwjglApplicationConfiguration.disableAudio = true; } } files = new LwjglFiles(); input = new LwjglInput(); net = new LwjglNet(config); this.listener = listener; this.preferencesdir = config.preferencesDirectory; this.preferencesFileType = config.preferencesFileType; Gdx.app = this; Gdx.graphics = graphics; Gdx.audio = audio; Gdx.files = files; Gdx.input = input; Gdx.net = net; initialize(); }
public boolean isTouched (int pointer) { if (pointer > 0) return false; else return isTouched(); }
public int getY (int pointer) { if (pointer > 0) return 0; else return getY(); }
int y = Gdx.graphics.getHeight() - (int)(Mouse.getEventY() * Display.getPixelScaleFactor()) - 1; int button = Mouse.getEventButton(); int gdxButton = toGdxButton(button); if (button != -1 && gdxButton == -1) continue; // Ignore unknown button.
int keyCode = getGdxKeyCode(Keyboard.getEventKey()); char keyChar = Keyboard.getEventCharacter(); if (Keyboard.getEventKeyState() || (keyCode == 0 && keyChar != 0 && Character.isDefined(keyChar))) {
input.update(); shouldRender |= graphics.shouldRender(); input.processEvents(); if (audio != null) audio.update();
if (!LwjglApplicationConfiguration.disableAudio) audio = new OpenALAudio(); files = new LwjglFiles(); input = new LwjglInput(); net = new LwjglNet(config); this.listener = listener;
@Override public float getPressure (int pointer) { return isTouched(pointer) ? 1 : 0; }
public boolean isKeyPressed (int key) { if (!Keyboard.isCreated()) return false; if (key == Input.Keys.ANY_KEY) return pressedKeys > 0; else return Keyboard.isKeyDown(getLwjglKeyCode(key)); }
public int getY (int pointer) { if (pointer > 0) return 0; else return getY(); }