示例#1
0
文件: context.go 项目: godispy/glfw
// ExtensionSupported returns whether the specified OpenGL or context creation
// API extension is supported by the current context. For example, on Windows
// both the OpenGL and WGL extension strings are checked.
//
// As this functions searches one or more extension strings on each call, it is
// recommended that you cache its results if it's going to be used frequently.
// The extension strings will not change during the lifetime of a context, so
// there is no danger in doing this.
func ExtensionSupported(extension string) bool {
	e := C.CString(extension)
	defer C.free(unsafe.Pointer(e))
	ret := glfwbool(C.glfwExtensionSupported(e))
	panicError()
	return ret
}
示例#2
0
文件: glfw.go 项目: andrebq/glfw
// ExtensionSupported does a string search in the list of supported OpenGL
// extensions to find if the specified extension is listed.
//
// Note: An OpenGL context must be created before this function can be called.
//
// Note: In addition to checking for OpenGL extensions, GLFW also checks for
// extensions in the operating system “glue API”, such as WGL extensions under
// Microsoft Windows and GLX extensions under the X Window System.
func ExtensionSupported(name string) bool {
	cs := C.CString(name)
	defer C.free(unsafe.Pointer(cs))
	return C.glfwExtensionSupported(cs) != 1
}