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

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

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

GLFW.glfwTerminate介绍

[英]Destroys all remaining windows and cursors, restores any modified gamma ramps and frees any other allocated resources. Once this function is called, you must again call #glfwInit successfully before you will be able to use most GLFW functions.

If GLFW has been successfully initialized, this function should be called before the application exits. If initialization fails, there is no need to call this function, as it is called by #glfwInit before it returns failure.

Note
  • This function may be called before #glfwInit.
  • This function must only be called from the main thread.
  • This function must not be called from a callback.
  • No window's context may be current on another thread when this function is called.
    [中]销毁所有剩余的窗口和游标,恢复任何修改的gamma渐变,并释放任何其他分配的资源。调用此函数后,必须再次成功调用#glfwInit,才能使用大多数GLFW函数。
    如果GLFW已成功初始化,则应在应用程序退出之前调用此函数。如果初始化失败,则无需调用此函数,因为它在返回失败之前由#glfwInit调用。
    #####注
    *此函数可以在#glfwInit之前调用。
    *只能从主线程调用此函数。
    *不能从回调调用此函数。
    *调用此函数时,另一个线程上的窗口上下文可能不是当前的。

代码示例

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

private void cleanup() {
  Lwjgl3Cursor.disposeSystemCursors();
  if (audio instanceof OpenALAudio) {
    ((OpenALAudio) audio).dispose();
  }
  errorCallback.free();
  errorCallback = null;
  if (glDebugCallback != null) {
    glDebugCallback.free();
    glDebugCallback = null;
  }
  GLFW.glfwTerminate();
}

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

private void cleanup() {
  Lwjgl3Cursor.disposeSystemCursors();
  if (audio instanceof OpenALAudio) {
    ((OpenALAudio) audio).dispose();
  }
  errorCallback.free();
  errorCallback = null;
  if (glDebugCallback != null) {
    glDebugCallback.free();
    glDebugCallback = null;
  }
  GLFW.glfwTerminate();
}

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

glfwTerminate();
} catch (final Exception ex) {
  listener.handleError("Failed to destroy context", ex);

代码示例来源:origin: jsettlers/settlers-remake

public void async_stop() {
  GLFW.glfwTerminate();
}

代码示例来源:origin: Renanse/Ardor3D

@Override
public void close() {
  GLFW.glfwDestroyWindow(_windowId);
  GLFW.glfwTerminate();
}

代码示例来源:origin: Renanse/Ardor3D

@Override
public void close() {
  GLFW.glfwDestroyWindow(_windowId);
  GLFW.glfwTerminate();
}

代码示例来源:origin: sriharshachilakapati/SilenceEngine

/**
 * <p> This function destroys all remaining windows and cursors, restores any modified gamma ramps and frees any
 * other allocated resources. Once this function is called, you must again call {@link GLFW3#init()} successfully
 * before you will be able to use most GLFW functions.</p>
 *
 * <p> If GLFW has been successfully initialized, this function should be called before the application exits. If
 * initialization fails, there is no need to call this function, as it is called by {@link GLFW3#init()} before it
 * returns failure.</p>
 */
public static void terminate()
{
  if (!isInitialized())
    return;
  if (glfwErrorCallback != null)
    glfwErrorCallback.free();
  if (glfwJoystickCallback != null)
    glfwJoystickCallback.free();
  glfwTerminate();
  initialized = false;
}

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

private void cleanup() {
  Lwjgl3Cursor.disposeSystemCursors();
  if (audio instanceof OpenALAudio) {
    ((OpenALAudio) audio).dispose();
  }
  errorCallback.free();
  errorCallback = null;
  if (glDebugCallback != null) {
    glDebugCallback.free();
    glDebugCallback = null;
  }
  GLFW.glfwTerminate();
}

代码示例来源:origin: badlogic/lwjgl3-maven-gradle

public void run() {
  System.out.println("Hello LWJGL " + Sys.getVersion() + "!");
  try {
    init();
    loop();
    // Release window and window callbacks
    glfwDestroyWindow(window);
    keyCallback.release();
  } finally {
    // Terminate GLFW and release the GLFWerrorfun
    glfwTerminate();
    errorCallback.release();
  }
}

代码示例来源:origin: badlogic/lwjgl3-maven-gradle

public void run() {
  System.out.println("Hello LWJGL " + Sys.getVersion() + "!");
  try {
    init();
    loop();
    // Release window and window callbacks
    glfwDestroyWindow(window);
    keyCallback.release();
  } finally {
    // Terminate GLFW and release the GLFWerrorfun
    glfwTerminate();
    errorCallback.release();
  }
}

代码示例来源:origin: FedUni/caliko

/** Destroy the window, finish up glfw and release all callback methods. */
public void cleanup()
{
  glfwDestroyWindow(mWindowId);
  glfwTerminate();
  
  cursorPosCallback.release();
  mouseButtonCallback.release();
  windowSizeCallback.release();
  keyCallback.release();
  errorCallback.release();   
}

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

@Override protected void loop () {
  boolean wasActive = glfwGetWindowAttrib(window, GLFW_VISIBLE) > 0;
  while (!glfwWindowShouldClose(window)) {
   // notify the app if lose or regain focus (treat said as pause/resume)
   boolean newActive = glfwGetWindowAttrib(window, GLFW_VISIBLE) > 0;
   if (wasActive != newActive) {
    dispatchEvent(lifecycle, wasActive ? Lifecycle.PAUSE : Lifecycle.RESUME);
    wasActive = newActive;
   }
   // process frame, if we don't need to provide true pausing
   if (newActive || !config.truePause) {
    processFrame();
   }
   // sleep until it's time for the next frame
   glfwSwapBuffers(window);
  }
  input.shutdown();
  graphics.shutdown();
  errorCallback.close();
  glfwDestroyWindow(window);
  glfwTerminate();
 }
}

代码示例来源:origin: WarmfulDevelopment/LWJGL-3-Tutorial

glfwTerminate();

相关文章

GLFW类方法