Java 类com.badlogic.gdx.backends.lwjgl3.Lwjgl3Window 实例源码

项目:skin-composer    文件:DesktopLauncher.java   
@Override
public void centerWindow(Graphics graphics) {
    Lwjgl3Graphics g = (Lwjgl3Graphics) graphics;
    Graphics.DisplayMode mode = g.getDisplayMode();
    Lwjgl3Window window = g.getWindow();
    window.setPosition(mode.width / 2 - g.getWidth() / 2, mode.height / 2 - g.getHeight() / 2);
}
项目:nvlist    文件:DesktopGraphicsUtil.java   
/**
 * @return The new windowed size for the application after applying the safe window size limits.
 */
public static Dim limitInitialWindowSize(Graphics graphics) {
    if (graphics.isFullscreen()) {

        // If fullscreen, we fill the entire screen already so nothing needs to be done

    } else {
        // Width/height of the window in physical pixels
        int w = graphics.getBackBufferWidth();
        int h = graphics.getBackBufferHeight();

        // Limit window size so it fits inside the current monitor (with a margin for OS bars/decorations)
        DisplayMode displayMode = graphics.getDisplayMode();
        int maxW = displayMode.width - 100;
        int maxH = displayMode.height - 150;

        int dw = Math.min(0, maxW - w);
        int dh = Math.min(0, maxH - h);
        graphics.setWindowedMode(w + dw, h + dh);

        // Also change the window's position so it's centered on its previous location
        Lwjgl3Window window = getCurrentWindow();
        window.setPosition(window.getPositionX() - dw / 2, window.getPositionY() - dh /  2);
    }

    return Dim.of(graphics.getBackBufferWidth(), graphics.getBackBufferHeight());
}
项目:Argent    文件:ArgentWindowFactory.java   
public Lwjgl3Window window(ApplicationListener listener, Lwjgl3WindowConfiguration cfg) {
    return app.newWindow(listener, cfg);
}
项目:Argent    文件:ArgentWindowFactory.java   
public Lwjgl3Window duplicateWindow(Lwjgl3WindowConfiguration cfg) {
    return app.newWindow(app.getApplicationListener(), cfg);
}
项目:Argent    文件:ArgentWindowFactory.java   
public Lwjgl3Window window(ApplicationListener listener) {
    return app.newWindow(listener, defaultCfg());
}
项目:Argent    文件:DetatchableFrame.java   
public DetatchableFrame(Lwjgl3Window primaryWindow) {
    this.primaryWindow = primaryWindow;
}
项目:nvlist    文件:DesktopGraphicsUtil.java   
private static Lwjgl3Window getCurrentWindow() {
    // Oddly, the only public way to get a reference to the main window is through the graphics object...
    Lwjgl3Graphics graphics = (Lwjgl3Graphics)Gdx.graphics;
    return graphics.getWindow();
}
项目:Argent    文件:IDetatchableScreen.java   
void attach(Lwjgl3Window window);
项目:Argent    文件:IDetatchableScreen.java   
Lwjgl3Window detatch();