Replace GL booleans with public macros

This commit is contained in:
Camilla Berglund
2015-08-23 19:30:04 +02:00
parent 13fbb4748a
commit 0eccf75f65
71 changed files with 581 additions and 557 deletions
+33 -33
View File
@@ -35,7 +35,7 @@
// Parses the client API version string and extracts the version number
//
static GLboolean parseVersionString(int* api, int* major, int* minor, int* rev)
static GLFWbool parseVersionString(int* api, int* major, int* minor, int* rev)
{
int i;
_GLFWwindow* window;
@@ -57,7 +57,7 @@ static GLboolean parseVersionString(int* api, int* major, int* minor, int* rev)
{
_glfwInputError(GLFW_PLATFORM_ERROR,
"Failed to retrieve context version string");
return GL_FALSE;
return GLFW_FALSE;
}
for (i = 0; prefixes[i]; i++)
@@ -76,10 +76,10 @@ static GLboolean parseVersionString(int* api, int* major, int* minor, int* rev)
{
_glfwInputError(GLFW_PLATFORM_ERROR,
"No version found in context version string");
return GL_FALSE;
return GLFW_FALSE;
}
return GL_TRUE;
return GLFW_TRUE;
}
@@ -87,13 +87,13 @@ static GLboolean parseVersionString(int* api, int* major, int* minor, int* rev)
////// GLFW internal API //////
//////////////////////////////////////////////////////////////////////////
GLboolean _glfwIsValidContextConfig(const _GLFWctxconfig* ctxconfig)
GLFWbool _glfwIsValidContextConfig(const _GLFWctxconfig* ctxconfig)
{
if (ctxconfig->api != GLFW_OPENGL_API &&
ctxconfig->api != GLFW_OPENGL_ES_API)
{
_glfwInputError(GLFW_INVALID_ENUM, "Invalid client API");
return GL_FALSE;
return GLFW_FALSE;
}
if (ctxconfig->api == GLFW_OPENGL_API)
@@ -112,7 +112,7 @@ GLboolean _glfwIsValidContextConfig(const _GLFWctxconfig* ctxconfig)
_glfwInputError(GLFW_INVALID_VALUE,
"Invalid OpenGL version %i.%i",
ctxconfig->major, ctxconfig->minor);
return GL_FALSE;
return GLFW_FALSE;
}
if (ctxconfig->profile)
@@ -122,7 +122,7 @@ GLboolean _glfwIsValidContextConfig(const _GLFWctxconfig* ctxconfig)
{
_glfwInputError(GLFW_INVALID_ENUM,
"Invalid OpenGL profile");
return GL_FALSE;
return GLFW_FALSE;
}
if (ctxconfig->major < 3 ||
@@ -133,7 +133,7 @@ GLboolean _glfwIsValidContextConfig(const _GLFWctxconfig* ctxconfig)
_glfwInputError(GLFW_INVALID_VALUE,
"Context profiles are only defined for OpenGL version 3.2 and above");
return GL_FALSE;
return GLFW_FALSE;
}
}
@@ -142,7 +142,7 @@ GLboolean _glfwIsValidContextConfig(const _GLFWctxconfig* ctxconfig)
// Forward-compatible contexts are only defined for OpenGL version 3.0 and above
_glfwInputError(GLFW_INVALID_VALUE,
"Forward-compatibility is only defined for OpenGL version 3.0 and above");
return GL_FALSE;
return GLFW_FALSE;
}
}
else if (ctxconfig->api == GLFW_OPENGL_ES_API)
@@ -159,7 +159,7 @@ GLboolean _glfwIsValidContextConfig(const _GLFWctxconfig* ctxconfig)
_glfwInputError(GLFW_INVALID_VALUE,
"Invalid OpenGL ES version %i.%i",
ctxconfig->major, ctxconfig->minor);
return GL_FALSE;
return GLFW_FALSE;
}
}
@@ -170,7 +170,7 @@ GLboolean _glfwIsValidContextConfig(const _GLFWctxconfig* ctxconfig)
{
_glfwInputError(GLFW_INVALID_ENUM,
"Invalid context robustness mode");
return GL_FALSE;
return GLFW_FALSE;
}
}
@@ -181,11 +181,11 @@ GLboolean _glfwIsValidContextConfig(const _GLFWctxconfig* ctxconfig)
{
_glfwInputError(GLFW_INVALID_ENUM,
"Invalid context release behavior");
return GL_FALSE;
return GLFW_FALSE;
}
}
return GL_TRUE;
return GLFW_TRUE;
}
const _GLFWfbconfig* _glfwChooseFBConfig(const _GLFWfbconfig* desired,
@@ -351,7 +351,7 @@ const _GLFWfbconfig* _glfwChooseFBConfig(const _GLFWfbconfig* desired,
return closest;
}
GLboolean _glfwRefreshContextAttribs(const _GLFWctxconfig* ctxconfig)
GLFWbool _glfwRefreshContextAttribs(const _GLFWctxconfig* ctxconfig)
{
_GLFWwindow* window = _glfwPlatformGetCurrentContext();
@@ -364,7 +364,7 @@ GLboolean _glfwRefreshContextAttribs(const _GLFWctxconfig* ctxconfig)
&window->context.minor,
&window->context.revision))
{
return GL_FALSE;
return GLFW_FALSE;
}
#if defined(_GLFW_USE_OPENGL)
@@ -379,7 +379,7 @@ GLboolean _glfwRefreshContextAttribs(const _GLFWctxconfig* ctxconfig)
{
_glfwInputError(GLFW_PLATFORM_ERROR,
"Entry point retrieval is broken");
return GL_FALSE;
return GLFW_FALSE;
}
}
@@ -392,17 +392,17 @@ GLboolean _glfwRefreshContextAttribs(const _GLFWctxconfig* ctxconfig)
window->GetIntegerv(GL_CONTEXT_FLAGS, &flags);
if (flags & GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT)
window->context.forward = GL_TRUE;
window->context.forward = GLFW_TRUE;
if (flags & GL_CONTEXT_FLAG_DEBUG_BIT)
window->context.debug = GL_TRUE;
window->context.debug = GLFW_TRUE;
else if (glfwExtensionSupported("GL_ARB_debug_output") &&
ctxconfig->debug)
{
// HACK: This is a workaround for older drivers (pre KHR_debug)
// not setting the debug bit in the context flags for
// debug contexts
window->context.debug = GL_TRUE;
window->context.debug = GLFW_TRUE;
}
}
@@ -472,10 +472,10 @@ GLboolean _glfwRefreshContextAttribs(const _GLFWctxconfig* ctxconfig)
}
#endif // _GLFW_USE_OPENGL
return GL_TRUE;
return GLFW_TRUE;
}
GLboolean _glfwIsValidContext(const _GLFWctxconfig* ctxconfig)
GLFWbool _glfwIsValidContext(const _GLFWctxconfig* ctxconfig)
{
_GLFWwindow* window = _glfwPlatformGetCurrentContext();
@@ -491,10 +491,10 @@ GLboolean _glfwIsValidContext(const _GLFWctxconfig* ctxconfig)
// {GLX|WGL}_ARB_create_context extension and fail here
_glfwInputError(GLFW_VERSION_UNAVAILABLE, NULL);
return GL_FALSE;
return GLFW_FALSE;
}
return GL_TRUE;
return GLFW_TRUE;
}
int _glfwStringInExtensionString(const char* string, const char* extensions)
@@ -508,7 +508,7 @@ int _glfwStringInExtensionString(const char* string, const char* extensions)
where = strstr(start, string);
if (!where)
return GL_FALSE;
return GLFW_FALSE;
terminator = where + strlen(string);
if (where == start || *(where - 1) == ' ')
@@ -520,7 +520,7 @@ int _glfwStringInExtensionString(const char* string, const char* extensions)
start = terminator;
}
return GL_TRUE;
return GLFW_TRUE;
}
@@ -565,19 +565,19 @@ GLFWAPI int glfwExtensionSupported(const char* extension)
{
_GLFWwindow* window;
_GLFW_REQUIRE_INIT_OR_RETURN(GL_FALSE);
_GLFW_REQUIRE_INIT_OR_RETURN(GLFW_FALSE);
window = _glfwPlatformGetCurrentContext();
if (!window)
{
_glfwInputError(GLFW_NO_CURRENT_CONTEXT, NULL);
return GL_FALSE;
return GLFW_FALSE;
}
if (*extension == '\0')
{
_glfwInputError(GLFW_INVALID_VALUE, NULL);
return GL_FALSE;
return GLFW_FALSE;
}
#if defined(_GLFW_USE_OPENGL)
@@ -597,11 +597,11 @@ GLFWAPI int glfwExtensionSupported(const char* extension)
{
_glfwInputError(GLFW_PLATFORM_ERROR,
"Failed to retrieve extension string %i", i);
return GL_FALSE;
return GLFW_FALSE;
}
if (strcmp(en, extension) == 0)
return GL_TRUE;
return GLFW_TRUE;
}
}
else
@@ -614,11 +614,11 @@ GLFWAPI int glfwExtensionSupported(const char* extension)
{
_glfwInputError(GLFW_PLATFORM_ERROR,
"Failed to retrieve extension string");
return GL_FALSE;
return GLFW_FALSE;
}
if (_glfwStringInExtensionString(extension, extensions))
return GL_TRUE;
return GLFW_TRUE;
}
// Check if extension is in the platform-specific string