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[] =
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",
413 "No version found in OpenGL version string");
418 "No version found in OpenGL ES version string");
439 "Requested OpenGL version %i.%i, got version %i.%i",
446 "Requested OpenGL ES version %i.%i, got version %i.%i",
466 "Entry point retrieval is broken");
582 const char*
start = extensions;
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");
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");
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)
724 const char* extensions = (
const char*)
729 "Extension string retrieval is broken");
752 "Cannot query entry point without a current OpenGL or OpenGL ES context");
#define GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR
_GLFWswapbuffersfun swapBuffers
#define GL_CONTEXT_PROFILE_MASK
#define GLFW_OPENGL_ES_API
const GLubyte *APIENTRYP PFNGLGETSTRINGIPROC(GLenum name, GLuint index)
_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()
static GLFWwindow * window
GLuint64 GLenum void * handle
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
#define GLFW_EGL_CONTEXT_API
void(APIENTRY * PFNGLGETINTEGERVPROC)(GLenum, GLint *)
#define GLFW_RELEASE_BEHAVIOR_NONE
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)
#define GL_CONTEXT_RELEASE_BEHAVIOR
const _GLFWfbconfig * _glfwChooseFBConfig(const _GLFWfbconfig *desired, const _GLFWfbconfig *alternatives, unsigned int count)
GLFWbool _glfwIsValidContextConfig(const _GLFWctxconfig *ctxconfig)
#define GL_COLOR_BUFFER_BIT
#define GL_LOSE_CONTEXT_ON_RESET_ARB
#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
#define GL_CONTEXT_CORE_PROFILE_BIT
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.
#define GL_NO_RESET_NOTIFICATION_ARB
_GLFWmakecontextcurrentfun makeCurrent
void(APIENTRY * PFNGLCLEARPROC)(GLbitfield)
#define GLFW_OSMESA_CONTEXT_API
void _glfwInputError(int code, const char *format,...)
_GLFWextensionsupportedfun extensionSupported
#define GLFW_RELEASE_BEHAVIOR_FLUSH
#define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT
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.
const GLubyte *APIENTRYP PFNGLGETSTRINGPROC(GLenum name)
#define GLFW_INVALID_VALUE
One of the arguments to the function was an invalid value.
#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT
#define GLFW_OPENGL_CORE_PROFILE
void * _glfwPlatformGetTls(_GLFWtls *tls)
#define GL_RESET_NOTIFICATION_STRATEGY_ARB
GLenum GLuint GLenum GLsizei length
GLFWAPI int glfwExtensionSupported(const char *extension)
Returns whether the specified extension is available.
#define GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH
#define GL_NUM_EXTENSIONS
#define GL_CONTEXT_FLAG_DEBUG_BIT
#define GLFW_NO_RESET_NOTIFICATION
GLFWAPI GLFWwindow * glfwGetCurrentContext(void)
Returns the window whose context is current on the calling thread.
struct GLFWwindow GLFWwindow