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

项目:gdx-splash    文件:SplashScreen.java   
@Override
public void create() {
    VisUI.load();
    batch = new SpriteBatch();
    shapeRenderer = new ShapeRenderer();
    img = new Texture("splash.png");
    font = new BitmapFont(Gdx.files.internal("font/openSans.fnt"), Gdx.files.internal("font/openSans.png"), false, true);

    window = ((Lwjgl3Graphics) Gdx.graphics).getWindow();

    // start loading
    loadingTask = new LoadingTask();
    try {
        loadingTask.execute();
    } catch (Exception e) {
        e.printStackTrace();
    }
}
项目: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   
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();
}