Java 类org.lwjgl.opengl.GLCapabilities 实例源码

项目:NanoUI    文件:AbstractWindow.java   
public GLCapabilities getCapabilities() {
    return this.capabilities;
}
项目:CubeEngine    文件:GLFWContext.java   
public GLCapabilities getCapabilities() {
    return (this._capabilities);
}
项目:ldparteditor    文件:Composite3D.java   
public GLCapabilities getCapabilities() {
    return capabilities;
}
项目:ldparteditor    文件:CompositePrimitive.java   
public GLCapabilities getCapabilities() {
    return capabilities;
}
项目:lwjgl3-tutorial    文件:Window.java   
/**
 * Creates a GLFW window and its OpenGL context with the specified width,
 * height and title.
 *
 * @param width  Width of the drawing area
 * @param height Height of the drawing area
 * @param title  Title of the window
 * @param vsync  Set to true, if you want v-sync
 */
public Window(int width, int height, CharSequence title, boolean vsync) {
    this.vsync = vsync;

    /* Creating a temporary window for getting the available OpenGL version */
    glfwDefaultWindowHints();
    glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE);
    long temp = glfwCreateWindow(1, 1, "", NULL, NULL);
    glfwMakeContextCurrent(temp);
    GL.createCapabilities();
    GLCapabilities caps = GL.getCapabilities();
    glfwDestroyWindow(temp);

    /* Reset and set window hints */
    glfwDefaultWindowHints();
    if (caps.OpenGL32) {
        /* Hints for OpenGL 3.2 core profile */
        glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
        glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
        glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
        glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GLFW_TRUE);
    } else if (caps.OpenGL21) {
        /* Hints for legacy OpenGL 2.1 */
        glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 2);
        glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 1);
    } else {
        throw new RuntimeException("Neither OpenGL 3.2 nor OpenGL 2.1 is "
                                   + "supported, you may want to update your graphics driver.");
    }
    glfwWindowHint(GLFW_RESIZABLE, GLFW_FALSE);

    /* Create window with specified OpenGL context */
    id = glfwCreateWindow(width, height, title, NULL, NULL);
    if (id == NULL) {
        glfwTerminate();
        throw new RuntimeException("Failed to create the GLFW window!");
    }

    /* Center window on screen */
    GLFWVidMode vidmode = glfwGetVideoMode(glfwGetPrimaryMonitor());
    glfwSetWindowPos(id,
                     (vidmode.width() - width) / 2,
                     (vidmode.height() - height) / 2
    );

    /* Create OpenGL context */
    glfwMakeContextCurrent(id);
    GL.createCapabilities();

    /* Enable v-sync */
    if (vsync) {
        glfwSwapInterval(1);
    }

    /* Set key callback */
    keyCallback = new GLFWKeyCallback() {
        @Override
        public void invoke(long window, int key, int scancode, int action, int mods) {
            if (key == GLFW_KEY_ESCAPE && action == GLFW_PRESS) {
                glfwSetWindowShouldClose(window, true);
            }
        }
    };
    glfwSetKeyCallback(id, keyCallback);
}
项目:Null-Engine    文件:Window.java   
/**
 * Get the GLCapabilities
 *
 * @return The OpenGL capabilities
 */
public GLCapabilities getGLCapabilities() {
    return glCapabilities;
}
项目:SilenceEngine    文件:Window.java   
/**
 * Returns the GL capabilities instance of this window. If the window haven't been made current even once, then this
 * method returns {@code null} to the caller.
 *
 * @return The GLCapabilities instance.
 */
public GLCapabilities getCapabilities()
{
    return windowCapabilities;
}