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

x33g5p2x  于2022-01-20 转载在 其他  
字(2.1k)|赞(0)|评价(0)|浏览(175)

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

GLFW.glfwInitHint介绍

[英]Sets hints for the next initialization of GLFW.

The values you set hints to are never reset by GLFW, but they only take effect during initialization. Once GLFW has been initialized, any values you set will be ignored until the library is terminated and initialized again.

Some hints are platform specific. These may be set on any platform but they will only affect their specific platform. Other platforms will simply ignore them. Setting these hints requires no platform specific headers or functions.

Note
  • This function may be called before #glfwInit.
  • This function must only be called from the main thread.
    [中]设置GLFW下次初始化的提示。
    GLFW不会重置设置提示的值,但它们仅在初始化期间生效。初始化GLFW后,您设置的任何值都将被忽略,直到库终止并再次初始化。
    有些提示是特定于平台的。可在任何平台上设置,但仅影响其特定平台。其他平台将完全忽略它们。设置这些提示不需要特定于平台的标题或函数。
    #####注
    *此函数可以在#glfwInit之前调用。
    *只能从主线程调用此函数。

代码示例

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

static void initializeGlfw() {
  if (errorCallback == null) {
    Lwjgl3NativesLoader.load();
    errorCallback = GLFWErrorCallback.createPrint(System.err);
    GLFW.glfwSetErrorCallback(errorCallback);
    GLFW.glfwInitHint(GLFW.GLFW_JOYSTICK_HAT_BUTTONS, GLFW.GLFW_FALSE);
    if (!GLFW.glfwInit()) {
      throw new GdxRuntimeException("Unable to initialize GLFW");
    }
  }
}

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

static void initializeGlfw() {
  if (errorCallback == null) {
    Lwjgl3NativesLoader.load();
    errorCallback = GLFWErrorCallback.createPrint(System.err);
    GLFW.glfwSetErrorCallback(errorCallback);
    GLFW.glfwInitHint(GLFW.GLFW_JOYSTICK_HAT_BUTTONS, GLFW.GLFW_FALSE);
    if (!GLFW.glfwInit()) {
      throw new GdxRuntimeException("Unable to initialize GLFW");
    }
  }
}

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

static void initializeGlfw() {
  if (errorCallback == null) {
    Lwjgl3NativesLoader.load();
    errorCallback = GLFWErrorCallback.createPrint(System.err);
    GLFW.glfwSetErrorCallback(errorCallback);
    GLFW.glfwInitHint(GLFW.GLFW_JOYSTICK_HAT_BUTTONS, GLFW.GLFW_FALSE);
    if (!GLFW.glfwInit()) {
      throw new GdxRuntimeException("Unable to initialize GLFW");
    }
  }
}

相关文章

GLFW类方法