本文整理了Java中org.lwjgl.glfw.GLFW.nglfwGetMonitorPos()
方法的一些代码示例,展示了GLFW.nglfwGetMonitorPos()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GLFW.nglfwGetMonitorPos()
方法的具体详情如下:
包路径:org.lwjgl.glfw.GLFW
类名称:GLFW
方法名:nglfwGetMonitorPos
[英]Unsafe version of: #glfwGetMonitorPos
[中]不安全版本:#glfwGetMonitorPos
代码示例来源:origin: sriharshachilakapati/SilenceEngine
/**
* This method returns the position, in screen coordinates, of the upper-left corner of the specified monitor. If
* there is any error, the position is set to zero, or the origin.
*
* @return The virtual position of this monitor.
*/
public Vector2 getVirtualPosition()
{
IntBuffer posBuffer = BufferUtils.createIntBuffer(2);
long posX = MemoryUtil.memAddress(posBuffer);
long posY = posX + Integer.BYTES;
nglfwGetMonitorPos(handle, posX, posY);
Vector2 position = new Vector2(posBuffer.get(0), posBuffer.get(1));
return position;
}
代码示例来源:origin: org.lwjgl.osgi/org.lwjgl.glfw
/**
* Returns the position, in screen coordinates, of the upper-left corner of the specified monitor.
*
* <p>Any or all of the position arguments may be {@code NULL}. If an error occurs, all non-{@code NULL} position arguments will be set to zero.</p>
*
* <p>This function must only be called from the main thread.</p>
*
* @param monitor the monitor to query
* @param xpos where to store the monitor x-coordinate, or {@code NULL}
* @param ypos where to store the monitor y-coordinate, or {@code NULL}
*
* @since version 3.0
*/
public static void glfwGetMonitorPos(@NativeType("GLFWmonitor *") long monitor, @Nullable @NativeType("int *") IntBuffer xpos, @Nullable @NativeType("int *") IntBuffer ypos) {
if (CHECKS) {
checkSafe(xpos, 1);
checkSafe(ypos, 1);
}
nglfwGetMonitorPos(monitor, memAddressSafe(xpos), memAddressSafe(ypos));
}
内容来源于网络,如有侵权,请联系作者删除!