本文整理汇总了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;
}
示例2: getCapabilities
import org.lwjgl.opengl.GLCapabilities; //导入依赖的package包/类
public GLCapabilities getCapabilities() {
return (this._capabilities);
}
示例3: getCapabilities
import org.lwjgl.opengl.GLCapabilities; //导入依赖的package包/类
public GLCapabilities getCapabilities() {
return capabilities;
}
示例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);
}
示例5: getGLCapabilities
import org.lwjgl.opengl.GLCapabilities; //导入依赖的package包/类
/**
* Get the GLCapabilities
*
* @return The OpenGL capabilities
*/
public GLCapabilities getGLCapabilities() {
return glCapabilities;
}
示例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;
}