当前位置: 首页>>代码示例>>Java>>正文


Java GLCapabilities类代码示例

本文整理汇总了Java中org.lwjgl.opengl.GLCapabilities的典型用法代码示例。如果您正苦于以下问题:Java GLCapabilities类的具体用法?Java GLCapabilities怎么用?Java GLCapabilities使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


GLCapabilities类属于org.lwjgl.opengl包,在下文中一共展示了GLCapabilities类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getCapabilities

import org.lwjgl.opengl.GLCapabilities; //导入依赖的package包/类
public GLCapabilities getCapabilities() {
	return this.capabilities;
}
 
开发者ID:Guerra24,项目名称:NanoUI,代码行数:4,代码来源:AbstractWindow.java

示例2: getCapabilities

import org.lwjgl.opengl.GLCapabilities; //导入依赖的package包/类
public GLCapabilities getCapabilities() {
	return (this._capabilities);
}
 
开发者ID:rpereira-dev,项目名称:CubeEngine,代码行数:4,代码来源:GLFWContext.java

示例3: getCapabilities

import org.lwjgl.opengl.GLCapabilities; //导入依赖的package包/类
public GLCapabilities getCapabilities() {
    return capabilities;
}
 
开发者ID:nilsschmidt1337,项目名称:ldparteditor,代码行数:4,代码来源:Composite3D.java

示例4: Window

import org.lwjgl.opengl.GLCapabilities; //导入依赖的package包/类
/**
 * 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);
}
 
开发者ID:SilverTiger,项目名称:lwjgl3-tutorial,代码行数:74,代码来源:Window.java

示例5: getGLCapabilities

import org.lwjgl.opengl.GLCapabilities; //导入依赖的package包/类
/**
 * Get the GLCapabilities
 *
 * @return The OpenGL capabilities
 */
public GLCapabilities getGLCapabilities() {
	return glCapabilities;
}
 
开发者ID:warlockcodes,项目名称:Null-Engine,代码行数:9,代码来源:Window.java

示例6: getCapabilities

import org.lwjgl.opengl.GLCapabilities; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:sriharshachilakapati,项目名称:SilenceEngine,代码行数:11,代码来源:Window.java


注:本文中的org.lwjgl.opengl.GLCapabilities类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。