public int getX () { return (int)(Mouse.getX() * Display.getPixelScaleFactor()); }
public int getX () { return (int)(Mouse.getX() * Display.getPixelScaleFactor()); }
public int getWidth () { if (canvas != null) return Math.max(1, canvas.getWidth()); else return (int)(Display.getWidth() * Display.getPixelScaleFactor()); }
public int getHeight () { if (canvas != null) return Math.max(1, canvas.getHeight()); else return (int)(Display.getHeight() * Display.getPixelScaleFactor()); }
public int getWidth () { if (canvas != null) return Math.max(1, canvas.getWidth()); else return (int)(Display.getWidth() * Display.getPixelScaleFactor()); }
public int getHeight () { if (canvas != null) return Math.max(1, canvas.getHeight()); else return (int)(Display.getHeight() * Display.getPixelScaleFactor()); }
public int getY () { return Gdx.graphics.getHeight() - 1 - (int)(Mouse.getY() * Display.getPixelScaleFactor()); }
public int getY () { return Gdx.graphics.getHeight() - 1 - (int)(Mouse.getY() * Display.getPixelScaleFactor()); }
protected void printContextInitInfo() { logger.log(Level.INFO, "LWJGL {0} context running on thread {1}\n" + " * Graphics Adapter: {2}\n" + " * Driver Version: {3}\n" + " * Scaling Factor: {4}", new Object[]{Sys.getVersion(), Thread.currentThread().getName(), Display.getAdapter(), Display.getVersion(), Display.getPixelScaleFactor()}); }
while (Mouse.next()) { events++; int x = (int)(Mouse.getEventX() * Display.getPixelScaleFactor()); int y = Gdx.graphics.getHeight() - (int)(Mouse.getEventY() * Display.getPixelScaleFactor()) - 1; int button = Mouse.getEventButton(); int gdxButton = toGdxButton(button); mouseX = event.x; mouseY = event.y; deltaX = (int)(Mouse.getEventDX() * Display.getPixelScaleFactor()); deltaY = (int)(Mouse.getEventDY() * Display.getPixelScaleFactor());
while (Mouse.next()) { events++; int x = (int)(Mouse.getEventX() * Display.getPixelScaleFactor()); int y = Gdx.graphics.getHeight() - (int)(Mouse.getEventY() * Display.getPixelScaleFactor()) - 1; int button = Mouse.getEventButton(); int gdxButton = toGdxButton(button); mouseX = event.x; mouseY = event.y; deltaX = (int)(Mouse.getEventDX() * Display.getPixelScaleFactor()); deltaY = (int)(Mouse.getEventDY() * Display.getPixelScaleFactor());
@Override public boolean setFullscreenMode (DisplayMode displayMode) { org.lwjgl.opengl.DisplayMode mode = ((LwjglDisplayMode)displayMode).mode; try { if (!mode.isFullscreenCapable()) { Display.setDisplayMode(mode); } else { Display.setDisplayModeAndFullscreen(mode); } float scaleFactor = Display.getPixelScaleFactor(); config.width = (int)(mode.getWidth() * scaleFactor); config.height = (int)(mode.getHeight() * scaleFactor); if (Gdx.gl != null) Gdx.gl.glViewport(0, 0, config.width, config.height); resize = true; return true; } catch (LWJGLException e) { return false; } }
@Override public boolean setFullscreenMode (DisplayMode displayMode) { org.lwjgl.opengl.DisplayMode mode = ((LwjglDisplayMode)displayMode).mode; try { if (!mode.isFullscreenCapable()) { Display.setDisplayMode(mode); } else { Display.setDisplayModeAndFullscreen(mode); } float scaleFactor = Display.getPixelScaleFactor(); config.width = (int)(mode.getWidth() * scaleFactor); config.height = (int)(mode.getHeight() * scaleFactor); if (Gdx.gl != null) Gdx.gl.glViewport(0, 0, config.width, config.height); resize = true; return true; } catch (LWJGLException e) { return false; } }
graphics.config.y = Display.getY(); if (graphics.resize || Display.wasResized() || (int)(Display.getWidth() * Display.getPixelScaleFactor()) != graphics.config.width || (int)(Display.getHeight() * Display.getPixelScaleFactor()) != graphics.config.height) { graphics.resize = false; graphics.config.width = (int)(Display.getWidth() * Display.getPixelScaleFactor()); graphics.config.height = (int)(Display.getHeight() * Display.getPixelScaleFactor()); Gdx.gl.glViewport(0, 0, graphics.config.width, graphics.config.height); if (listener != null) listener.resize(graphics.config.width, graphics.config.height);
graphics.config.y = Display.getY(); if (graphics.resize || Display.wasResized() || (int)(Display.getWidth() * Display.getPixelScaleFactor()) != graphics.config.width || (int)(Display.getHeight() * Display.getPixelScaleFactor()) != graphics.config.height) { graphics.resize = false; graphics.config.width = (int)(Display.getWidth() * Display.getPixelScaleFactor()); graphics.config.height = (int)(Display.getHeight() * Display.getPixelScaleFactor()); Gdx.gl.glViewport(0, 0, graphics.config.width, graphics.config.height); if (listener != null) listener.resize(graphics.config.width, graphics.config.height);
float scaleFactor = Display.getPixelScaleFactor(); config.width = (int)(targetDisplayMode.getWidth() * scaleFactor); config.height = (int)(targetDisplayMode.getHeight() * scaleFactor);
float scaleFactor = Display.getPixelScaleFactor(); config.width = (int)(targetDisplayMode.getWidth() * scaleFactor); config.height = (int)(targetDisplayMode.getHeight() * scaleFactor);
public int getWidth () { if (canvas != null) return Math.max(1, canvas.getWidth()); else return (int)(Display.getWidth() * Display.getPixelScaleFactor()); }
public int getHeight () { if (canvas != null) return Math.max(1, canvas.getHeight()); else return (int)(Display.getHeight() * Display.getPixelScaleFactor()); }
void checkScaleFactor () { float scaleFactor = Display.getPixelScaleFactor(); if (scaleFactor != scale().factor) updateViewport( new Scale(scaleFactor), Display.getWidth(), Display.getHeight()); }