64 "Invalid context creation API 0x%08X",
74 "Invalid client API 0x%08X",
81 if ((ctxconfig->
major < 1 || ctxconfig->
minor < 0) ||
82 (ctxconfig->
major == 1 && ctxconfig->
minor > 5) ||
83 (ctxconfig->
major == 2 && ctxconfig->
minor > 1) ||
84 (ctxconfig->
major == 3 && ctxconfig->
minor > 3))
93 "Invalid OpenGL version %i.%i",
104 "Invalid OpenGL profile 0x%08X",
109 if (ctxconfig->
major <= 2 ||
110 (ctxconfig->
major == 3 && ctxconfig->
minor < 2))
116 "Context profiles are only defined for OpenGL version 3.2 and above");
125 "Forward-compatibility is only defined for OpenGL version 3.0 and above");
131 if (ctxconfig->
major < 1 || ctxconfig->
minor < 0 ||
132 (ctxconfig->
major == 1 && ctxconfig->
minor > 1) ||
133 (ctxconfig->
major == 2 && ctxconfig->
minor > 0))
141 "Invalid OpenGL ES version %i.%i",
153 "Invalid context robustness mode 0x%08X",
165 "Invalid context release behavior 0x%08X",
181 unsigned int missing, leastMissing = UINT_MAX;
182 unsigned int colorDiff, leastColorDiff = UINT_MAX;
183 unsigned int extraDiff, leastExtraDiff = UINT_MAX;
187 for (i = 0; i < count; i++)
189 current = alternatives + i;
312 if (desired->
sRGB && !current->
sRGB)
320 if (missing < leastMissing)
322 else if (missing == leastMissing)
324 if ((colorDiff < leastColorDiff) ||
325 (colorDiff == leastColorDiff && extraDiff < leastExtraDiff))
331 if (current == closest)
333 leastMissing = missing;
334 leastColorDiff = colorDiff;
335 leastExtraDiff = extraDiff;
350 const char* prefixes[] =
365 window->context.getProcAddress(
"glGetIntegerv");
367 window->context.getProcAddress(
"glGetString");
368 if (!window->context.GetIntegerv || !window->context.GetString)
375 version = (
const char*) window->context.GetString(
GL_VERSION);
381 "OpenGL version string retrieval is broken");
386 "OpenGL ES version string retrieval is broken");
393 for (i = 0; prefixes[i]; i++)
395 const size_t length = strlen(prefixes[i]);
397 if (strncmp(version, prefixes[i], length) == 0)
405 if (!sscanf(version,
"%d.%d.%d",
406 &window->context.major,
407 &window->context.minor,
408 &window->context.revision))
413 "No version found in OpenGL version string");
418 "No version found in OpenGL ES version string");
425 if (window->context.major < ctxconfig->
major ||
426 (window->context.major == ctxconfig->
major &&
427 window->context.minor < ctxconfig->
minor))
439 "Requested OpenGL version %i.%i, got version %i.%i",
441 window->context.major, window->context.minor);
446 "Requested OpenGL ES version %i.%i, got version %i.%i",
448 window->context.major, window->context.minor);
455 if (window->context.major >= 3)
462 window->context.getProcAddress(
"glGetStringi");
463 if (!window->context.GetStringi)
466 "Entry point retrieval is broken");
475 if (window->context.major >= 3)
499 if (window->context.major >= 4 ||
500 (window->context.major == 3 && window->context.minor >= 2))
569 window->context.getProcAddress(
"glClear");
571 window->context.swapBuffers(window);
587 const char* terminator;
589 where = strstr(start,
string);
593 terminator = where + strlen(
string);
594 if (where == start || *(where - 1) ==
' ')
596 if (*terminator ==
' ' || *terminator ==
'\0')
621 "Cannot make current with a window that has no OpenGL or OpenGL ES context");
644 assert(window != NULL);
651 "Cannot swap buffers of a window that has no OpenGL or OpenGL ES context");
668 "Cannot set swap interval without a current OpenGL or OpenGL ES context");
678 assert(extension != NULL);
686 "Cannot query extension without a current OpenGL or OpenGL ES context");
690 if (*extension ==
'\0')
705 for (i = 0; i < count; i++)
707 const char* en = (
const char*)
712 "Extension string retrieval is broken");
716 if (strcmp(en, extension) == 0)
729 "Extension string retrieval is broken");
744 assert(procname != NULL);
752 "Cannot query entry point without a current OpenGL or OpenGL ES context");
_GLFWswapbuffersfun swapBuffers
#define GL_COLOR_BUFFER_BIT
#define GLFW_OPENGL_ES_API
#define GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR
#define GL_NO_RESET_NOTIFICATION_ARB
_GLFWgetprocaddressfun getProcAddress
GLFWAPI GLFWglproc glfwGetProcAddress(const char *procname)
Returns the address of the specified function for the current context.
#define GLFW_OPENGL_COMPAT_PROFILE
#define _GLFW_REQUIRE_INIT()
PFNGLGETSTRINGPROC GetString
#define GLFW_NO_WINDOW_CONTEXT
The specified window does not have an OpenGL or OpenGL ES context.
#define GLFW_LOSE_CONTEXT_ON_RESET
GLenum GLuint GLenum GLsizei length
#define GLFW_EGL_CONTEXT_API
#define GLFW_RELEASE_BEHAVIOR_NONE
#define GL_NUM_EXTENSIONS
void(GLAD_API_PTR * PFNGLGETINTEGERVPROC)(GLenum pname, GLint *data)
struct GLFWwindow GLFWwindow
Opaque window object.
#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT
const GLubyte *(GLAD_API_PTR * PFNGLGETSTRINGPROC)(GLenum name)
GLFWbool _glfwRefreshContextAttribs(_GLFWwindow *window, const _GLFWctxconfig *ctxconfig)
#define GLFW_NO_CURRENT_CONTEXT
No context is current for this thread.
#define _GLFW_REQUIRE_INIT_OR_RETURN(x)
const _GLFWfbconfig * _glfwChooseFBConfig(const _GLFWfbconfig *desired, const _GLFWfbconfig *alternatives, unsigned int count)
GLFWbool _glfwIsValidContextConfig(const _GLFWctxconfig *ctxconfig)
#define GL_CONTEXT_PROFILE_MASK
#define GL_CONTEXT_CORE_PROFILE_BIT
#define GLFW_PLATFORM_ERROR
A platform-specific error occurred that does not match any of the more specific categories.
#define GLFW_NATIVE_CONTEXT_API
GLFWbool _glfwStringInExtensionString(const char *string, const char *extensions)
GLFWAPI void glfwSwapInterval(int interval)
Sets the swap interval for the current context.
PFNGLGETINTEGERVPROC GetIntegerv
GLFWAPI void glfwSwapBuffers(GLFWwindow *handle)
Swaps the front and back buffers of the specified window.
GLFWAPI void glfwMakeContextCurrent(GLFWwindow *handle)
Makes the context of the specified window current for the calling thread.
_GLFWmakecontextcurrentfun makeCurrent
#define GL_CONTEXT_FLAG_DEBUG_BIT
#define GLFW_OSMESA_CONTEXT_API
void _glfwInputError(int code, const char *format,...)
_GLFWextensionsupportedfun extensionSupported
#define GLFW_RELEASE_BEHAVIOR_FLUSH
PFNGLGETSTRINGIPROC GetStringi
#define GLFW_VERSION_UNAVAILABLE
The requested OpenGL or OpenGL ES version is not available.
_GLFWswapintervalfun swapInterval
#define GLFW_INVALID_ENUM
One of the arguments to the function was an invalid enum value.
#define GLFW_INVALID_VALUE
One of the arguments to the function was an invalid value.
const GLubyte *(GLAD_API_PTR * PFNGLGETSTRINGIPROC)(GLenum name, GLuint index)
#define GLFW_OPENGL_CORE_PROFILE
void * _glfwPlatformGetTls(_GLFWtls *tls)
#define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT
GLFWAPI int glfwExtensionSupported(const char *extension)
Returns whether the specified extension is available.
#define GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH
#define GL_LOSE_CONTEXT_ON_RESET_ARB
#define GL_RESET_NOTIFICATION_STRATEGY_ARB
void(GLAD_API_PTR * PFNGLCLEARPROC)(GLbitfield mask)
#define GL_CONTEXT_RELEASE_BEHAVIOR
#define GLFW_NO_RESET_NOTIFICATION
GLFWAPI GLFWwindow * glfwGetCurrentContext(void)
Returns the window whose context is current on the calling thread.
void(* GLFWglproc)(void)
Client API function pointer type.