66 "Invalid context creation API 0x%08X",
76 "Invalid client API 0x%08X",
83 if ((ctxconfig->
major < 1 || ctxconfig->
minor < 0) ||
84 (ctxconfig->
major == 1 && ctxconfig->
minor > 5) ||
85 (ctxconfig->
major == 2 && ctxconfig->
minor > 1) ||
86 (ctxconfig->
major == 3 && ctxconfig->
minor > 3))
95 "Invalid OpenGL version %i.%i",
106 "Invalid OpenGL profile 0x%08X",
111 if (ctxconfig->
major <= 2 ||
112 (ctxconfig->
major == 3 && ctxconfig->
minor < 2))
118 "Context profiles are only defined for OpenGL version 3.2 and above");
127 "Forward-compatibility is only defined for OpenGL version 3.0 and above");
133 if (ctxconfig->
major < 1 || ctxconfig->
minor < 0 ||
134 (ctxconfig->
major == 1 && ctxconfig->
minor > 1) ||
135 (ctxconfig->
major == 2 && ctxconfig->
minor > 0))
143 "Invalid OpenGL ES version %i.%i",
155 "Invalid context robustness mode 0x%08X",
167 "Invalid context release behavior 0x%08X",
183 unsigned int missing, leastMissing = UINT_MAX;
184 unsigned int colorDiff, leastColorDiff = UINT_MAX;
185 unsigned int extraDiff, leastExtraDiff = UINT_MAX;
189 for (i = 0; i < count; i++)
191 current = alternatives + i;
308 if (desired->
sRGB && !current->
sRGB)
316 if (missing < leastMissing)
318 else if (missing == leastMissing)
320 if ((colorDiff < leastColorDiff) ||
321 (colorDiff == leastColorDiff && extraDiff < leastExtraDiff))
327 if (current == closest)
329 leastMissing = missing;
330 leastColorDiff = colorDiff;
331 leastExtraDiff = extraDiff;
346 const char* prefixes[] =
377 "OpenGL version string retrieval is broken");
382 "OpenGL ES version string retrieval is broken");
389 for (i = 0; prefixes[i]; i++)
391 const size_t length = strlen(prefixes[i]);
393 if (strncmp(version, prefixes[i], length) == 0)
401 if (!sscanf(version,
"%d.%d.%d",
409 "No version found in OpenGL version string");
414 "No version found in OpenGL ES version string");
435 "Requested OpenGL version %i.%i, got version %i.%i",
442 "Requested OpenGL ES version %i.%i, got version %i.%i",
462 "Entry point retrieval is broken");
580 const char* start = extensions;
585 const char* terminator;
587 where = strstr(start,
string);
591 terminator = where + strlen(
string);
592 if (where == start || *(where - 1) ==
' ')
594 if (*terminator ==
' ' || *terminator ==
'\0')
619 "Cannot make current with a window that has no OpenGL or OpenGL ES context");
642 assert(window !=
NULL);
649 "Cannot swap buffers of a window that has no OpenGL or OpenGL ES context");
666 "Cannot set swap interval without a current OpenGL or OpenGL ES context");
676 assert(extension !=
NULL);
684 "Cannot query extension without a current OpenGL or OpenGL ES context");
688 if (*extension ==
'\0')
703 for (i = 0; i < count; i++)
705 const char* en = (
const char*)
710 "Extension string retrieval is broken");
714 if (strcmp(en, extension) == 0)
722 const char* extensions = (
const char*)
727 "Extension string retrieval is broken");
742 assert(procname !=
NULL);
750 "Cannot query entry point without a current OpenGL or OpenGL ES context");
GLFWbool _glfwIsValidContextConfig(const _GLFWctxconfig *ctxconfig)
GLFWbool _glfwStringInExtensionString(const char *string, const char *extensions)
GLFWbool _glfwRefreshContextAttribs(_GLFWwindow *window, const _GLFWctxconfig *ctxconfig)
const _GLFWfbconfig * _glfwChooseFBConfig(const _GLFWfbconfig *desired, const _GLFWfbconfig *alternatives, unsigned int count)
#define GL_RESET_NOTIFICATION_STRATEGY_ARB
#define GL_NO_RESET_NOTIFICATION_ARB
#define GL_LOSE_CONTEXT_ON_RESET_ARB
const GLubyte *(GLAD_API_PTR * PFNGLGETSTRINGIPROC)(GLenum name, GLuint index)
#define GL_CONTEXT_PROFILE_MASK
void(GLAD_API_PTR * PFNGLGETINTEGERVPROC)(GLenum pname, GLint *data)
#define GL_COLOR_BUFFER_BIT
const GLubyte *(GLAD_API_PTR * PFNGLGETSTRINGPROC)(GLenum name)
#define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT
#define GL_CONTEXT_CORE_PROFILE_BIT
#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT
#define GL_CONTEXT_FLAG_DEBUG_BIT
void(GLAD_API_PTR * PFNGLCLEARPROC)(GLbitfield mask)
#define GL_NUM_EXTENSIONS
#define GLFW_EGL_CONTEXT_API
#define GLFW_NATIVE_CONTEXT_API
#define GLFW_OPENGL_ES_API
#define GLFW_RELEASE_BEHAVIOR_FLUSH
#define GLFW_OPENGL_COMPAT_PROFILE
#define GLFW_LOSE_CONTEXT_ON_RESET
#define GLFW_NO_RESET_NOTIFICATION
#define GLFW_OPENGL_CORE_PROFILE
#define GLFW_RELEASE_BEHAVIOR_NONE
#define GLFW_OSMESA_CONTEXT_API
GLFWAPI GLFWglproc glfwGetProcAddress(const char *procname)
Returns the address of the specified function for the current context.
GLFWAPI void glfwSwapInterval(int interval)
Sets the swap interval for the current context.
void(* GLFWglproc)(void)
GLFW API types.
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 void glfwMakeContextCurrent(GLFWwindow *handle)
Makes the context of the specified window current for the calling thread.
#define GLFW_INVALID_ENUM
One of the arguments to the function was an invalid enum value.
#define GLFW_NO_CURRENT_CONTEXT
No context is current for this thread.
#define GLFW_INVALID_VALUE
One of the arguments to the function was an invalid value.
#define GLFW_NO_WINDOW_CONTEXT
The specified window does not have an OpenGL or OpenGL ES context.
#define GLFW_VERSION_UNAVAILABLE
The requested OpenGL or OpenGL ES version is not available.
#define GLFW_PLATFORM_ERROR
A platform-specific error occurred that does not match any of the more specific categories.
struct GLFWwindow GLFWwindow
Opaque window object.
GLFWAPI void glfwSwapBuffers(GLFWwindow *handle)
Swaps the front and back buffers of the specified window.
void _glfwInputError(int code, const char *format,...)
#define _GLFW_REQUIRE_INIT_OR_RETURN(x)
void * _glfwPlatformGetTls(_GLFWtls *tls)
#define GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH
#define GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR
#define _GLFW_REQUIRE_INIT()
#define GL_CONTEXT_RELEASE_BEHAVIOR
PFNGLGETSTRINGPROC GetString
_GLFWswapintervalfun swapInterval
_GLFWswapbuffersfun swapBuffers
PFNGLGETSTRINGIPROC GetStringi
PFNGLGETINTEGERVPROC GetIntegerv
_GLFWmakecontextcurrentfun makeCurrent
_GLFWextensionsupportedfun extensionSupported
_GLFWgetprocaddressfun getProcAddress