Java 类org.lwjgl.glfw.Callbacks 实例源码

项目:ether    文件:GLFWWindow.java   
@Override
public void dispose() {
    checkMainThread();

    if (DBG)
        log.debug("window destroy: " + title);

    // note: we cannot destroy window as long as the context is acquired (i.e. window is rendering)
    contextLock.lock();
    Callbacks.glfwFreeCallbacks(window);
    GLFW.glfwDestroyWindow(window);
    window = 0;
    contextLock.unlock();

    // XXX not sure if this is what we want in all cases, but for now ok.
    if (NUM_WINDOWS.decrementAndGet() == 0)
        Platform.get().exit();
}
项目:civgame    文件:DisplayManager.java   
public static void createDisplay()
{
    glfwInit();
    glfwSetErrorCallback(errorCallback = Callbacks.errorCallbackPrint(System.err));

    glfwWindowHint(GLFW_RESIZABLE, GL_FALSE);
    glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
    glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
    glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); 
    window = glfwCreateWindow(width, height, "", 0, 0);
    glfwMakeContextCurrent(window);
    GLContext.createFromCurrent();
    glfwShowWindow(window);

    setCursorPosCallback();
    setMouseCallback();
    setKeyCallback();

    if (window == 0) {
        throw new RuntimeException("Failed to create window");
    }

    GL11.glViewport(0, 0, width, height);
}
项目:open-world    文件:Application.java   
/**
    * Initialize GLFW callbacks
    */
   private void initGLFWCallbacks() {
// Set GLFW to output errors to System.err
GLFW.glfwSetErrorCallback(Callbacks.errorCallbackPrint(System.err));

// Setup input callbacks
WINDOW.setCursorPosCallback(Input.cursorPosCallback);
WINDOW.setKeyCallback(Input.keyCallback);
Input.applicationListener = applicationListener;
   }
项目:NovelJ    文件:Test.java   
public void run(){
    try{
        start();
        render();
        glfwDestroyWindow(window);
    }finally{
        Callbacks.glfwFreeCallbacks(window);
        glfwTerminate();
    }
}
项目:NanoUI    文件:AbstractWindow.java   
@Override
public void closeDisplay() {
    if (!this.created)
        return;
    Callbacks.glfwFreeCallbacks(this.windowID);
    glfwDestroyWindow(this.windowID);
    this.created = false;
}
项目:candlelight    文件:Window.java   
public void destroy()
{
    // Free the window callbacks and destroy the window
    Callbacks.glfwFreeCallbacks(this.handle);
    GLFW.glfwDestroyWindow(this.handle);
}
项目:CommunityEngine-Java    文件:Window.java   
public void disposeGLFW() {
    Callbacks.glfwFreeCallbacks(windowID);
    GLFW.glfwTerminate();
}
项目:TorchEngine    文件:WindowInternal.java   
public static void destroy()
{
    LoggerInternal.log("Destroying window");

    Callbacks.glfwFreeCallbacks(nativeId);

    glfwDestroyWindow(nativeId);

    nativeId = NULL;
}