glfwSwapBuffers function

void glfwSwapBuffers(
  1. Pointer<GLFWwindow> window
)

! @brief Swaps the front and back buffers of the specified window.

This function swaps the front and back buffers of the specified window when rendering with OpenGL or OpenGL ES. If the swap interval is greater than zero, the GPU driver waits the specified number of screen updates before swapping the buffers.

The specified window must have an OpenGL or OpenGL ES context. Specifying a window without a context will generate a @ref GLFW_NO_WINDOW_CONTEXT error.

This function does not apply to Vulkan. If you are rendering with Vulkan, see vkQueuePresentKHR instead.

@paramin window The window whose buffers to swap.

@errors Possible errors include @ref GLFW_NOT_INITIALIZED, @ref GLFW_NO_WINDOW_CONTEXT and @ref GLFW_PLATFORM_ERROR.

@remark EGL: The context of the specified window must be current on the calling thread.

@thread_safety This function may be called from any thread.

@sa @ref buffer_swap @sa @ref glfwSwapInterval

@since Added in version 1.0. @glfw3 Added window handle parameter.

@ingroup window

GLFWAPI void glfwSwapBuffers(GLFWwindow* window)

Implementation

void glfwSwapBuffers(Pointer<GLFWwindow> window) {
  final glfwSwapBuffersLookupFunction = libglfw.lookupFunction<
      Void Function(Pointer<GLFWwindow> window),
      void Function(Pointer<GLFWwindow> window)>('glfwSwapBuffers');
  return glfwSwapBuffersLookupFunction(window);
}