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

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

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

GLFW.glfwDestroyWindow介绍

[英]Destroys the specified window and its context. On calling this function, no further callbacks will be called for that window.

If the context of the specified window is current on the main thread, it is detached before being destroyed.

Note
  • This function must only be called from the main thread.
  • This function must not be called from a callback.
  • The context of the specified window must not be current on any other thread when this function is called.
    [中]销毁指定的窗口及其上下文。调用此函数时,将不再为该窗口调用进一步的回调。
    如果指定窗口的上下文在主线程上是当前的,则在销毁之前会将其分离。
    #####注
    *只能从主线程调用此函数。
    *不能从回调调用此函数。
    *调用此函数时,指定窗口的上下文在任何其他线程上都不能是当前的。

代码示例

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

try {
  if (window != NULL) {
    glfwDestroyWindow(window);
    window = NULL;

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

try {
  if (window != NULL) {
    glfwDestroyWindow(window);
    window = NULL;

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

glfwDestroyWindow(window);
window = NULL;

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

glfwDestroyWindow(window);
window = NULL;

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

@Override
public void dispose() {
  listener.pause();
  listener.dispose();
  Lwjgl3Cursor.dispose(this);
  graphics.dispose();
  input.dispose();
  GLFW.glfwSetWindowFocusCallback(windowHandle, null);
  GLFW.glfwSetWindowIconifyCallback(windowHandle, null);
  GLFW.glfwSetWindowCloseCallback(windowHandle, null);
  GLFW.glfwSetDropCallback(windowHandle, null);
  GLFW.glfwDestroyWindow(windowHandle);
  
  focusCallback.free();
  iconifyCallback.free();
  maximizeCallback.free();
  closeCallback.free();
  dropCallback.free();
  refreshCallback.free();
}

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

@Override
public void dispose() {
  listener.pause();
  listener.dispose();
  Lwjgl3Cursor.dispose(this);
  graphics.dispose();
  input.dispose();
  GLFW.glfwSetWindowFocusCallback(windowHandle, null);
  GLFW.glfwSetWindowIconifyCallback(windowHandle, null);
  GLFW.glfwSetWindowCloseCallback(windowHandle, null);
  GLFW.glfwSetDropCallback(windowHandle, null);
  GLFW.glfwDestroyWindow(windowHandle);
  
  focusCallback.free();
  iconifyCallback.free();
  maximizeCallback.free();
  closeCallback.free();
  dropCallback.free();
  refreshCallback.free();
}

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

/**
 * This method destroys this window and its context. On calling this method, no further callbacks will be called for
 * this window. If the context of this window is current on the main thread, it is detached before being destroyed.
 * The context of this window must not be current on any other thread when this function is called.
 */
public void destroy()
{
  releaseNativeCallbacks();
  glfwDestroyWindow(handle);
}

代码示例来源: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: fynnfluegge/oreon-engine

public void shutdown()
{
  glfwDestroyWindow(getId());
}

代码示例来源:origin: fynnfluegge/oreon-engine

@Override
public void shutdown() {
  
  glfwDestroyWindow(getId());
}

代码示例来源:origin: com.io7m.jcanephora/com.io7m.jcanephora.lwjgl3

@Override
public void contextDestroy()
 throws JCGLExceptionDeleted
{
 this.checkNotDestroyed();
 final long actual_current = GLFW.glfwGetCurrentContext();
 if (actual_current == this.context) {
  final StringBuilder sb = new StringBuilder(128);
  sb.append("Attempted to destroy a context that is still current.");
  sb.append(System.lineSeparator());
  sb.append("Context: 0x");
  sb.append(Long.toHexString(this.context));
  sb.append(System.lineSeparator());
  sb.append("Thread: ");
  sb.append(Thread.currentThread());
  sb.append(System.lineSeparator());
  final String m = sb.toString();
  LOG.error(m);
  throw new JCGLExceptionContextIsCurrent(m);
 }
 GLFW.glfwDestroyWindow(this.context);
 this.destroyed = true;
}

代码示例来源:origin: com.io7m.jcanephora/io7m-jcanephora-lwjgl3

@Override
public void contextDestroy()
 throws JCGLExceptionDeleted
{
 this.checkNotDestroyed();
 final long actual_current = GLFW.glfwGetCurrentContext();
 if (actual_current == this.context) {
  final StringBuilder sb = new StringBuilder(128);
  sb.append("Attempted to destroy a context that is still current.");
  sb.append(System.lineSeparator());
  sb.append("Context: 0x");
  sb.append(Long.toHexString(this.context));
  sb.append(System.lineSeparator());
  sb.append("Thread: ");
  sb.append(Thread.currentThread());
  sb.append(System.lineSeparator());
  final String m = sb.toString();
  LWJGL3Context.LOG.error(m);
  throw new JCGLExceptionContextIsCurrent(m);
 }
 GLFW.glfwDestroyWindow(this.context);
 this.destroyed = true;
}

代码示例来源: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: org.jmonkeyengine/jme3-lwjgl3

try {
  if (window != NULL) {
    glfwDestroyWindow(window);
    window = NULL;

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

/**
 * Destroy the context.
 */
protected void destroyContext() {
  try {
    if (renderer != null) {
      renderer.cleanup();
    }
    if (errorCallback != null) {
      errorCallback.close();
      errorCallback = null;
    }
    if (windowSizeCallback != null) {
      windowSizeCallback.close();
      windowSizeCallback = null;
    }
    if (windowFocusCallback != null) {
      windowFocusCallback.close();
      windowFocusCallback = null;
    }
    if (window != NULL) {
      glfwDestroyWindow(window);
      window = NULL;
    }
  } catch (final Exception ex) {
    listener.handleError("Failed to destroy context", ex);
  }
}

代码示例来源: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: com.badlogicgames.gdx/gdx-backend-lwjgl3

@Override
public void dispose() {
  listener.pause();
  listener.dispose();
  Lwjgl3Cursor.dispose(this);
  graphics.dispose();
  input.dispose();
  GLFW.glfwSetWindowFocusCallback(windowHandle, null);
  GLFW.glfwSetWindowIconifyCallback(windowHandle, null);
  GLFW.glfwSetWindowCloseCallback(windowHandle, null);
  GLFW.glfwSetDropCallback(windowHandle, null);
  GLFW.glfwDestroyWindow(windowHandle);
  
  focusCallback.free();
  iconifyCallback.free();
  maximizeCallback.free();
  closeCallback.free();
  dropCallback.free();
  refreshCallback.free();
}

相关文章

GLFW类方法