本文整理了Java中org.lwjgl.glfw.GLFW.glfwSwapInterval()
方法的一些代码示例,展示了GLFW.glfwSwapInterval()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GLFW.glfwSwapInterval()
方法的具体详情如下:
包路径:org.lwjgl.glfw.GLFW
类名称:GLFW
方法名:glfwSwapInterval
[英]Sets the swap interval for the current OpenGL or OpenGL ES context, i.e. the number of screen updates to wait from the time #glfwSwapBuffers was called before swapping the buffers and returning. This is sometimes called vertical synchronization, vertical retrace synchronization or just vsync.
A context that supports either of the WGL_EXT_swap_control_tear and GLX_EXT_swap_control_tear extensions also accepts negative swap intervals, which allows the driver to swap immediately even if a frame arrives a little bit late. You can check for these extensions with #glfwExtensionSupported. For more information about swap tearing, see the extension specifications.
A context must be current on the calling thread. Calling this function without a current context will cause a #GLFW_NO_CURRENT_CONTEXT error.
This function does not apply to Vulkan. If you are rendering with Vulkan, see the present mode of your swapchain instead.
代码示例来源:origin: libgdx/libgdx
@Override
public void setVSync(boolean vsync) {
GLFW.glfwSwapInterval(vsync ? 1 : 0);
}
代码示例来源:origin: libgdx/libgdx
@Override
public void setVSync(boolean vsync) {
GLFW.glfwSwapInterval(vsync ? 1 : 0);
}
代码示例来源:origin: libgdx/libgdx
GLFW.glfwSwapInterval(config.vSyncEnabled ? 1 : 0);
GL.createCapabilities();
代码示例来源:origin: libgdx/libgdx
GLFW.glfwSwapInterval(config.vSyncEnabled ? 1 : 0);
GL.createCapabilities();
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
glfwSwapInterval(1);
} else {
glfwSwapInterval(0);
代码示例来源:origin: jMonkeyEngine/jmonkeyengine
glfwSwapInterval(1);
} else {
glfwSwapInterval(0);
代码示例来源:origin: Renanse/Ardor3D
@Override
public void setVSyncEnabled(final boolean enabled) {
GLFW.glfwSwapInterval(enabled ? 1 : 0);
}
代码示例来源:origin: com.badlogicgames.gdx/gdx-backend-lwjgl3
@Override
public void setVSync(boolean vsync) {
GLFW.glfwSwapInterval(vsync ? 1 : 0);
}
代码示例来源:origin: Renanse/Ardor3D
@Override
public void setVSyncEnabled(final boolean enabled) {
GLFW.glfwSwapInterval(enabled ? 1 : 0);
}
代码示例来源:origin: sriharshachilakapati/SilenceEngine
/**
* <p> This function sets the swap interval for the current context, i.e. the number of screen updates to wait from
* the time {@link GLFW#glfwSwapBuffers(long)} was called before swapping the buffers and returning. This is
* sometimes called vertical synchronization, vertical retrace synchronization or just vsync.</p>
*
* <p> Contexts that support either of the {@code WGL_EXT_swap_control_tear} and
* {@code GLX_EXT_swap_control_tear} extensions also accept negative swap intervals, which allow the driver to
* swap even if a frame arrives a little bit late. You can check for the presence of these extensions using {@link
* GLFW#glfwExtensionSupported(CharSequence)}. For more information about swap tearing, see the extension
* specifications.</p>
*
* <p> A context must be current on the calling thread. Calling this function without a current context will cause a
* {@code GLFW_NO_CURRENT_CONTEXT} error.</p>
*
* @param i The number of screen updates to wait before swapping the buffers.
*/
public static void setSwapInterval(int i)
{
glfwSwapInterval(i);
}
代码示例来源:origin: jsettlers/settlers-remake
public void async_init() {
if(debug) {
ec = GLFWErrorCallback.createPrint(System.err);
GLFW.glfwSetErrorCallback(ec);
}
if(!GLFW.glfwInit()) throw new Error("glfwInit() failed!");
GLFW.glfwWindowHint(GLFW.GLFW_OPENGL_DEBUG_CONTEXT, debug ? GLFW.GLFW_TRUE : GLFW.GLFW_DONT_CARE);
GLFW.glfwWindowHint(GLFW.GLFW_STENCIL_BITS, 1);
glfw_wnd = GLFW.glfwCreateWindow(width + 1, width + 1, "lwjgl-offscreen", 0, 0);
GLFW.glfwMakeContextCurrent(glfw_wnd);
GLFW.glfwSwapInterval(0);
event_converter.registerCallbacks();
}
代码示例来源:origin: fynnfluegge/oreon-engine
public void create()
{
glfwWindowHint(GLFW_RESIZABLE, GL_TRUE);
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
setId(glfwCreateWindow(getWidth(), getHeight(), getTitle(), 0, 0));
if(getId() == 0) {
throw new RuntimeException("Failed to create window");
}
setIcon("textures/logo/oreon_lwjgl_icon32.png");
glfwMakeContextCurrent(getId());
glfwSwapInterval(0);
GL.createCapabilities();
}
代码示例来源:origin: badlogic/lwjgl3-maven-gradle
glfwSwapInterval(1);
代码示例来源:origin: badlogic/lwjgl3-maven-gradle
glfwSwapInterval(1);
代码示例来源:origin: playn/playn
glfwSwapInterval(1);
graphics.setSize(config.width, config.height, config.fullscreen);
glfwShowWindow(window);
代码示例来源:origin: lwjglgamedev/lwjglbook
glfwSwapInterval(1);
代码示例来源:origin: lwjglgamedev/lwjglbook
glfwSwapInterval(1);
代码示例来源:origin: lwjglgamedev/lwjglbook
glfwSwapInterval(1);
代码示例来源:origin: lwjglgamedev/lwjglbook
glfwSwapInterval(1);
代码示例来源:origin: lwjglgamedev/lwjglbook
glfwSwapInterval(1);
内容来源于网络,如有侵权,请联系作者删除!