mirror of
https://github.com/glfw/glfw.git
synced 2024-11-10 00:51:47 +00:00
Extension string type cleanup.
This commit is contained in:
parent
24e4e674a5
commit
1f95fac699
@ -490,16 +490,16 @@ GLboolean _glfwIsValidContext(const _GLFWctxconfig* ctxconfig)
|
|||||||
return GL_TRUE;
|
return GL_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
int _glfwStringInExtensionString(const char* string, const GLubyte* extensions)
|
int _glfwStringInExtensionString(const char* string, const char* extensions)
|
||||||
{
|
{
|
||||||
const GLubyte* start = extensions;
|
const char* start = extensions;
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
GLubyte* where;
|
const char* where;
|
||||||
GLubyte* terminator;
|
const char* terminator;
|
||||||
|
|
||||||
where = (GLubyte*) strstr((const char*) start, string);
|
where = strstr(start, string);
|
||||||
if (!where)
|
if (!where)
|
||||||
return GL_FALSE;
|
return GL_FALSE;
|
||||||
|
|
||||||
@ -602,7 +602,7 @@ GLFWAPI int glfwExtensionSupported(const char* extension)
|
|||||||
{
|
{
|
||||||
// Check if extension is in the old style OpenGL extensions string
|
// Check if extension is in the old style OpenGL extensions string
|
||||||
|
|
||||||
const GLubyte* extensions = glGetString(GL_EXTENSIONS);
|
const char* extensions = (const char*) glGetString(GL_EXTENSIONS);
|
||||||
if (!extensions)
|
if (!extensions)
|
||||||
{
|
{
|
||||||
_glfwInputError(GLFW_PLATFORM_ERROR,
|
_glfwInputError(GLFW_PLATFORM_ERROR,
|
||||||
|
@ -476,12 +476,10 @@ void _glfwPlatformSwapInterval(int interval)
|
|||||||
|
|
||||||
int _glfwPlatformExtensionSupported(const char* extension)
|
int _glfwPlatformExtensionSupported(const char* extension)
|
||||||
{
|
{
|
||||||
const char* extensions;
|
const char* extensions = eglQueryString(_glfw.egl.display, EGL_EXTENSIONS);
|
||||||
|
if (extensions)
|
||||||
extensions = eglQueryString(_glfw.egl.display, EGL_EXTENSIONS);
|
|
||||||
if (extensions != NULL)
|
|
||||||
{
|
{
|
||||||
if (_glfwStringInExtensionString(extension, (unsigned char*) extensions))
|
if (_glfwStringInExtensionString(extension, extensions))
|
||||||
return GL_TRUE;
|
return GL_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -509,10 +509,8 @@ void _glfwPlatformSwapInterval(int interval)
|
|||||||
|
|
||||||
int _glfwPlatformExtensionSupported(const char* extension)
|
int _glfwPlatformExtensionSupported(const char* extension)
|
||||||
{
|
{
|
||||||
const GLubyte* extensions =
|
const char* extensions = glXQueryExtensionsString(_glfw.x11.display,
|
||||||
(const GLubyte*) glXQueryExtensionsString(_glfw.x11.display,
|
_glfw.x11.screen);
|
||||||
_glfw.x11.screen);
|
|
||||||
|
|
||||||
if (extensions)
|
if (extensions)
|
||||||
{
|
{
|
||||||
if (_glfwStringInExtensionString(extension, extensions))
|
if (_glfwStringInExtensionString(extension, extensions))
|
||||||
|
@ -799,7 +799,7 @@ void _glfwSplitBPP(int bpp, int* red, int* green, int* blue);
|
|||||||
* @return `GL_TRUE` if the extension was found, or `GL_FALSE` otherwise.
|
* @return `GL_TRUE` if the extension was found, or `GL_FALSE` otherwise.
|
||||||
* @ingroup utility
|
* @ingroup utility
|
||||||
*/
|
*/
|
||||||
int _glfwStringInExtensionString(const char* string, const GLubyte* extensions);
|
int _glfwStringInExtensionString(const char* string, const char* extensions);
|
||||||
|
|
||||||
/*! @brief Chooses the framebuffer config that best matches the desired one.
|
/*! @brief Chooses the framebuffer config that best matches the desired one.
|
||||||
* @param[in] desired The desired framebuffer config.
|
* @param[in] desired The desired framebuffer config.
|
||||||
|
@ -605,14 +605,14 @@ void _glfwPlatformSwapInterval(int interval)
|
|||||||
|
|
||||||
int _glfwPlatformExtensionSupported(const char* extension)
|
int _glfwPlatformExtensionSupported(const char* extension)
|
||||||
{
|
{
|
||||||
const GLubyte* extensions;
|
const char* extensions;
|
||||||
|
|
||||||
_GLFWwindow* window = _glfwPlatformGetCurrentContext();
|
_GLFWwindow* window = _glfwPlatformGetCurrentContext();
|
||||||
|
|
||||||
if (window->wgl.GetExtensionsStringEXT != NULL)
|
if (window->wgl.GetExtensionsStringEXT != NULL)
|
||||||
{
|
{
|
||||||
extensions = (GLubyte*) window->wgl.GetExtensionsStringEXT();
|
extensions = window->wgl.GetExtensionsStringEXT();
|
||||||
if (extensions != NULL)
|
if (extensions)
|
||||||
{
|
{
|
||||||
if (_glfwStringInExtensionString(extension, extensions))
|
if (_glfwStringInExtensionString(extension, extensions))
|
||||||
return GL_TRUE;
|
return GL_TRUE;
|
||||||
@ -621,8 +621,8 @@ int _glfwPlatformExtensionSupported(const char* extension)
|
|||||||
|
|
||||||
if (window->wgl.GetExtensionsStringARB != NULL)
|
if (window->wgl.GetExtensionsStringARB != NULL)
|
||||||
{
|
{
|
||||||
extensions = (GLubyte*) window->wgl.GetExtensionsStringARB(window->wgl.dc);
|
extensions = window->wgl.GetExtensionsStringARB(window->wgl.dc);
|
||||||
if (extensions != NULL)
|
if (extensions)
|
||||||
{
|
{
|
||||||
if (_glfwStringInExtensionString(extension, extensions))
|
if (_glfwStringInExtensionString(extension, extensions))
|
||||||
return GL_TRUE;
|
return GL_TRUE;
|
||||||
|
Loading…
Reference in New Issue
Block a user