Typedefs | |
typedef void(* | GLFWglproc )(void) |
Client API function pointer type. | |
Functions | |
GLFWAPI int | glfwExtensionSupported (const char *extension) |
Returns whether the specified extension is available. | |
GLFWAPI GLFWwindow * | glfwGetCurrentContext (void) |
Returns the window whose context is current on the calling thread. | |
GLFWAPI GLFWglproc | glfwGetProcAddress (const char *procname) |
Returns the address of the specified function for the current context. | |
GLFWAPI void | glfwMakeContextCurrent (GLFWwindow *window) |
Makes the context of the specified window current for the calling thread. | |
GLFWAPI void | glfwSwapInterval (int interval) |
Sets the swap interval for the current context. |
This is the reference documentation for context related functions. For more information, see the Context handling.
typedef void(* GLFWglproc)(void) |
GLFWAPI int glfwExtensionSupported | ( | const char * | extension | ) |
Returns whether the specified extension is available.
This function returns whether the specified [client API extension](context_glext) is supported by the current OpenGL or OpenGL ES context. It searches both for OpenGL and OpenGL ES extension and platform-specific context creation API extensions.
A context must be current on the calling thread. Calling this function without a current context will cause a GLFW_NO_CURRENT_CONTEXT error.
As this functions retrieves and searches one or more extension strings each call, it is recommended that you cache its results if it is going to be used frequently. The extension strings will not change during the lifetime of a context, so there is no danger in doing this.
[in] | extension | The ASCII encoded name of the extension. |
Returns the window whose context is current on the calling thread.
This function returns the window whose OpenGL or OpenGL ES context is current on the calling thread.
GLFWAPI GLFWglproc glfwGetProcAddress | ( | const char * | procname | ) |
Returns the address of the specified function for the current context.
This function returns the address of the specified [core or extension function](context_glext), if it is supported by the current context.
A context must be current on the calling thread. Calling this function without a current context will cause a GLFW_NO_CURRENT_CONTEXT error.
[in] | procname | The ASCII encoded name of the function. |
GLFWAPI void glfwMakeContextCurrent | ( | GLFWwindow * | window | ) |
Makes the context of the specified window current for the calling thread.
This function makes the OpenGL or OpenGL ES context of the specified window current on the calling thread. A context can only be made current on a single thread at a time and each thread can have only a single current context at a time.
By default, making a context non-current implicitly forces a pipeline flush. On machines that support `GL_KHR_context_flush_control`, you can control whether a context performs this flush by setting the [GLFW_CONTEXT_RELEASE_BEHAVIOR](window_hints_ctx) window hint.
[in] | window | The window whose context to make current, or `NULL` to detach the current context. |
GLFWAPI void glfwSwapInterval | ( | int | interval | ) |
Sets the swap interval for the current context.
This function sets the swap interval for the current 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_.
Contexts that support either of the `WGL_EXT_swap_control_tear` and `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 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.
[in] | interval | The minimum number of screen updates to wait for until the buffers are swapped by glfwSwapBuffers. |