3 * Copyright (c) 2001 César Blecua Udías All Rights Reserved.
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice shall be included
13 * in all copies or substantial portions of the Software.
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
16 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * CESAR BLECUA UDIAS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
19 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
20 * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26 #include "extensions.hxx"
29 #include <osg/GL> // for glGetString
31 bool SGSearchExtensionsString(const char *extString, const char *extName) {
32 // Returns GL_TRUE if the *extName string appears in the *extString string,
33 // surrounded by white spaces, or GL_FALSE otherwise.
38 if ((extString == NULL) || (extName == NULL))
41 extNameLen = strlen(extName);
48 if ((extNameLen == n) && (strncmp(extName, p, n) == 0))
57 bool SGIsOpenGLExtensionSupported(const char *extName) {
58 // Returns GL_TRUE if the OpenGL Extension whose name is *extName
59 // is supported by the system, or GL_FALSE otherwise.
61 // The *extName string must follow the OpenGL extensions naming scheme
62 // (ie: "GL_type_extension", like GL_EXT_convolution)
64 return SGSearchExtensionsString((const char *)glGetString(GL_EXTENSIONS),extName);