glfwGetProcAddress

Returns the address of the specified function for the current context.

This function returns the address of the specified OpenGL or OpenGL ES core or extension function, 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 @ref GLFW_NO_CURRENT_CONTEXT error.

This function does not apply to Vulkan. If you are rendering with Vulkan, see @ref glfwGetInstanceProcAddress, vkGetInstanceProcAddr and vkGetDeviceProcAddr instead.

extern (C) @nogc nothrow __gshared
glfwGetProcAddress
(
const(char)* procname
)

Parameters

procname const(char)*

The ASCII encoded name of the function.

Return Value

The address of the function, or null if an error occurred.

Errors: Possible errors include @ref GLFW_NOT_INITIALIZED, @ref GLFW_NO_CURRENT_CONTEXT and @ref GLFW_PLATFORM_ERROR.

@remark The address of a given function is not guaranteed to be the same between contexts.

@remark This function may return a non-null address despite the associated version or extension not being available. Always check the context version or extension string first.

Pointer lifetime

The returned function pointer is valid until the context is destroyed or the library is terminated.

Thread Safety

This function may be called from any thread.

@sa @ref context_glext @sa @ref glfwExtensionSupported

Meta

Since

Added in version 1.0.

Ingroup: context