org.lwjgl.glfw.GLFW.glfwSetWindowPos()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(5.2k)|赞(0)|评价(0)|浏览(243)

本文整理了Java中org.lwjgl.glfw.GLFW.glfwSetWindowPos()方法的一些代码示例,展示了GLFW.glfwSetWindowPos()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GLFW.glfwSetWindowPos()方法的具体详情如下:
包路径:org.lwjgl.glfw.GLFW
类名称:GLFW
方法名:glfwSetWindowPos

GLFW.glfwSetWindowPos介绍

[英]Sets the position, in screen coordinates, of the upper-left corner of the client area of the specified windowed mode window. If the window is a full screen window, this function does nothing.

Do not use this function to move an already visible window unless you have very good reasons for doing so, as it will confuse and annoy the user.

The window manager may put limits on what positions are allowed. GLFW cannot and should not override these limits.

Notes:

  • This function must only be called from the main thread.
  • Wayland: There is no way for an application to set the global position of its windows, this function will always emit #GLFW_PLATFORM_ERROR.
    [中]设置指定窗口模式窗口的客户端区域左上角的位置(以屏幕坐标为单位)。如果窗口是全屏窗口,则此功能不起任何作用。
    除非你有很好的理由这样做,否则不要使用此功能移动已经可见的窗口,因为它会让用户感到困惑和烦恼。
    窗口管理器可能会对允许的位置设置限制。GLFW不能也不应超越这些限制。
    笔记:
    *只能从主线程调用此函数。
    *Wayland:应用程序无法设置其窗口的全局位置,此函数将始终发出#GLFW_PLATFORM_错误。

代码示例

代码示例来源:origin: libgdx/libgdx

/** Sets the position of the window in logical coordinates. All monitors
 * span a virtual surface together. The coordinates are relative to
 * the first monitor in the virtual surface. **/
public void setPosition(int x, int y) {
  GLFW.glfwSetWindowPos(windowHandle, x, y);
}

代码示例来源:origin: libgdx/libgdx

/** Sets the position of the window in logical coordinates. All monitors
 * span a virtual surface together. The coordinates are relative to
 * the first monitor in the virtual surface. **/
public void setPosition(int x, int y) {
  GLFW.glfwSetWindowPos(windowHandle, x, y);
}

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

org.lwjgl.glfw.GLFW.glfwSetWindowPos(window, origWidth - (int)windowSize.x, 32);

代码示例来源:origin: libgdx/libgdx

if (config.windowMaxHeight > -1) windowHeight = Math.min(windowHeight, config.windowMaxHeight);
  GLFWVidMode vidMode = GLFW.glfwGetVideoMode(GLFW.glfwGetPrimaryMonitor());
  GLFW.glfwSetWindowPos(windowHandle, vidMode.width() / 2 - windowWidth / 2, vidMode.height() / 2 - windowHeight / 2);
} else {
  GLFW.glfwSetWindowPos(windowHandle, config.windowX, config.windowY);

代码示例来源:origin: libgdx/libgdx

if (config.windowMaxHeight > -1) windowHeight = Math.min(windowHeight, config.windowMaxHeight);
  GLFWVidMode vidMode = GLFW.glfwGetVideoMode(GLFW.glfwGetPrimaryMonitor());
  GLFW.glfwSetWindowPos(windowHandle, vidMode.width() / 2 - windowWidth / 2, vidMode.height() / 2 - windowHeight / 2);
} else {
  GLFW.glfwSetWindowPos(windowHandle, config.windowX, config.windowY);

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

glfwSetWindowPos(window,
    (videoMode.width() - settings.getWidth()) / 2,
    (videoMode.height() - settings.getHeight()) / 2);

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

glfwSetWindowPos(window,
    (videoMode.width() - settings.getWidth()) / 2,
    (videoMode.height() - settings.getHeight()) / 2);

代码示例来源:origin: Renanse/Ardor3D

@Override
public void moveWindowTo(final int locX, final int locY) {
  GLFW.glfwSetWindowPos(_windowId, locX, locY);
}

代码示例来源:origin: com.badlogicgames.gdx/gdx-backend-lwjgl3

/** Sets the position of the window in logical coordinates. All monitors
 * span a virtual surface together. The coordinates are relative to
 * the first monitor in the virtual surface. **/
public void setPosition(int x, int y) {
  GLFW.glfwSetWindowPos(windowHandle, x, y);
}

代码示例来源:origin: sriharshachilakapati/SilenceEngine

/**
 * <p> This method sets the position, in screen coordinates, of the upper-left corner of the client area of this
 * windowed mode window. If the window is a full screen window, this function does nothing.</p>
 *
 * <p> <b>Do not use this method</b> to move an already visible window unless you have very good reasons for doing
 * so, as it will confuse and annoy the user.</p>
 *
 * <p> The window manager may put limits on what positions are allowed. GLFW cannot and should not override these
 * limits.</p>
 *
 * @param position The new position of this window.
 */
public void setPosition(Vector2 position)
{
  this.position.set(position);
  glfwSetWindowPos(handle, (int) position.x, (int) position.y);
}

代码示例来源:origin: WarmfulDevelopment/LWJGL-3-Tutorial

public void createWindow(String title) {
  window = glfwCreateWindow(width, height, title, fullscreen ? glfwGetPrimaryMonitor() : 0, 0);
  
  if (window == 0) throw new IllegalStateException("Failed to create window!");
  
  if (!fullscreen) {
    GLFWVidMode vid = glfwGetVideoMode(glfwGetPrimaryMonitor());
    glfwSetWindowPos(window, (vid.width() - width) / 2, (vid.height() - height) / 2);
  }
  
  glfwShowWindow(window);
  
  glfwMakeContextCurrent(window);
  
  input = new Input(window);
  setLocalCallbacks();
}

代码示例来源:origin: badlogic/lwjgl3-maven-gradle

glfwSetWindowPos(
  window,
  (GLFWvidmode.width(vidmode) - WIDTH) / 2,

代码示例来源:origin: badlogic/lwjgl3-maven-gradle

glfwSetWindowPos(
  window,
  (GLFWvidmode.width(vidmode) - WIDTH) / 2,

代码示例来源:origin: playn/playn

input = new GLFWInput(this, window);
glfwSetWindowPos(window, (vidMode.width() - width) / 2, (vidMode.height() - height) / 2);
glfwMakeContextCurrent(window);
glfwSwapInterval(1);

代码示例来源:origin: lwjglgamedev/lwjglbook

glfwSetWindowPos(
    windowHandle,
    (vidmode.width() - width) / 2,

代码示例来源:origin: lwjglgamedev/lwjglbook

glfwSetWindowPos(
    windowHandle,
    (vidmode.width() - width) / 2,

代码示例来源:origin: lwjglgamedev/lwjglbook

glfwSetWindowPos(
    windowHandle,
    (vidmode.width() - width) / 2,

代码示例来源:origin: lwjglgamedev/lwjglbook

glfwSetWindowPos(
    windowHandle,
    (vidmode.width() - width) / 2,

代码示例来源:origin: lwjglgamedev/lwjglbook

glfwSetWindowPos(
    windowHandle,
    (vidmode.width() - width) / 2,

代码示例来源:origin: lwjglgamedev/lwjglbook

glfwSetWindowPos(
    windowHandle,
    (vidmode.width() - width) / 2,

相关文章

GLFW类方法