org.lwjgl.glfw.GLFW.glfwExtensionSupported()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(4.4k)|赞(0)|评价(0)|浏览(137)

本文整理了Java中org.lwjgl.glfw.GLFW.glfwExtensionSupported()方法的一些代码示例,展示了GLFW.glfwExtensionSupported()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。GLFW.glfwExtensionSupported()方法的具体详情如下:
包路径:org.lwjgl.glfw.GLFW
类名称:GLFW
方法名:glfwExtensionSupported

GLFW.glfwExtensionSupported介绍

[英]Returns whether the specified API extension is supported by the current OpenGL or OpenGL ES context. It searches both for client API extension and context creation API extensions.

A context must be current on the calling thread. Calling this function without a current context will cause a #GLFW_NO_CURRENT_CONTEXT error.

As this functions retrieves and searches one or more extension strings each call, it is recommended that you cache its results if it is 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.

This function does not apply to Vulkan. If you are using Vulkan, see glfwGetRequiredInstanceExtensions, vkEnumerateInstanceExtensionProperties and vkEnumerateDeviceExtensionProperties instead.

This function may be called from any thread.
[中]返回当前OpenGL或OpenGL ES上下文是否支持指定的{$0$}。它同时搜索客户端API扩展和上下文创建API扩展。
调用线程上的上下文必须是当前上下文。在没有当前上下文的情况下调用此函数将导致#GLFW_NO_当前_上下文错误。
由于此函数在每次调用时检索和搜索一个或多个扩展字符串,如果要频繁使用,建议您缓存其结果。扩展字符串在上下文的生存期内不会更改,因此这样做没有危险。
此功能不适用于Vulkan。如果您使用的是Vulkan,请参阅glfwGetRequiredInstanceExtensions、vkEnumerateInstanceExtensionProperties和vkEnumerateDeviceExtensionProperties。
此函数可以从任何线程调用。

代码示例

代码示例来源:origin: libgdx/libgdx

@Override
public boolean supportsExtension(String extension) {
  return GLFW.glfwExtensionSupported(extension);
}

代码示例来源:origin: libgdx/libgdx

@Override
public boolean supportsExtension(String extension) {
  return GLFW.glfwExtensionSupported(extension);
}

代码示例来源:origin: libgdx/libgdx

private static boolean supportsFBO () {
  // FBO is in core since OpenGL 3.0, see https://www.opengl.org/wiki/Framebuffer_Object
  return glVersion.isVersionEqualToOrHigher(3, 0) || GLFW.glfwExtensionSupported("GL_EXT_framebuffer_object")
    || GLFW.glfwExtensionSupported("GL_ARB_framebuffer_object");
}

代码示例来源:origin: libgdx/libgdx

private static boolean supportsFBO () {
  // FBO is in core since OpenGL 3.0, see https://www.opengl.org/wiki/Framebuffer_Object
  return glVersion.isVersionEqualToOrHigher(3, 0) || GLFW.glfwExtensionSupported("GL_EXT_framebuffer_object")
    || GLFW.glfwExtensionSupported("GL_ARB_framebuffer_object");
}

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

protected int determineMaxSamples() {
  // If we already have a valid context, determine samples using current context.
  logger.log(Level.SEVERE, "glfwExtensionSupported(\"GL_ARB_framebuffer_object\"): "+GLFW.glfwExtensionSupported("GL_ARB_framebuffer_object"));
  logger.log(Level.SEVERE, "glfwExtensionSupported(\"GL_EXT_framebuffer_multisample\"): "+GLFW.glfwExtensionSupported("GL_ARB_framebuffer_object"));
  
  if (GLFW.glfwExtensionSupported("GL_ARB_framebuffer_object")) {
    return glGetInteger(ARBFramebufferObject.GL_MAX_SAMPLES);
  } else if (GLFW.glfwExtensionSupported("GL_EXT_framebuffer_multisample")) {
    return glGetInteger(EXTFramebufferMultisample.GL_MAX_SAMPLES_EXT);
  }
  return Integer.MAX_VALUE;
}

代码示例来源:origin: jMonkeyEngine/jmonkeyengine

protected int determineMaxSamples() {
  // If we already have a valid context, determine samples using current context.
  if (GLFW.glfwExtensionSupported("GL_ARB_framebuffer_object")) {
    return glGetInteger(ARBFramebufferObject.GL_MAX_SAMPLES);
  } else if (GLFW.glfwExtensionSupported("GL_EXT_framebuffer_multisample")) {
    return glGetInteger(EXTFramebufferMultisample.GL_MAX_SAMPLES_EXT);
  }
  return Integer.MAX_VALUE;
}

代码示例来源:origin: com.badlogicgames.gdx/gdx-backend-lwjgl3

@Override
public boolean supportsExtension(String extension) {
  return GLFW.glfwExtensionSupported(extension);
}

代码示例来源:origin: com.badlogicgames.gdx/gdx-backend-lwjgl3

private static boolean supportsFBO () {
  // FBO is in core since OpenGL 3.0, see https://www.opengl.org/wiki/Framebuffer_Object
  return glVersion.isVersionEqualToOrHigher(3, 0) || GLFW.glfwExtensionSupported("GL_EXT_framebuffer_object")
    || GLFW.glfwExtensionSupported("GL_ARB_framebuffer_object");
}

代码示例来源:origin: org.jmonkeyengine/jme3-lwjgl3

protected int determineMaxSamples() {
  // If we already have a valid context, determine samples using current context.
  if (GLFW.glfwExtensionSupported("GL_ARB_framebuffer_object")) {
    return glGetInteger(ARBFramebufferObject.GL_MAX_SAMPLES);
  } else if (GLFW.glfwExtensionSupported("GL_EXT_framebuffer_multisample")) {
    return glGetInteger(EXTFramebufferMultisample.GL_MAX_SAMPLES_EXT);
  }
  return Integer.MAX_VALUE;
}

相关文章

GLFW类方法