本文整理汇总了Java中org.lwjgl.glfw.GLFW.glfwWindowHint方法的典型用法代码示例。如果您正苦于以下问题:Java GLFW.glfwWindowHint方法的具体用法?Java GLFW.glfwWindowHint怎么用?Java GLFW.glfwWindowHint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.lwjgl.glfw.GLFW
的用法示例。
在下文中一共展示了GLFW.glfwWindowHint方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setHint
import org.lwjgl.glfw.GLFW; //导入方法依赖的package包/类
public void setHint(int hint, int value){
GLFW.glfwWindowHint(hint, value);
}
示例2: setResizeable
import org.lwjgl.glfw.GLFW; //导入方法依赖的package包/类
public Window setResizeable(boolean resizeable)
{
GLFW.glfwWindowHint(GLFW.GLFW_RESIZABLE,
resizeable ? GLFW.GLFW_TRUE : GLFW.GLFW_FALSE);
return this;
}
示例3: createWindow
import org.lwjgl.glfw.GLFW; //导入方法依赖的package包/类
protected void createWindow()
{
// the window will stay hidden after creation
GLFW.glfwWindowHint(GLFW.GLFW_VISIBLE, GLFW.GLFW_FALSE);
// Configure GLFW
GLFW.glfwWindowHint(GLFW.GLFW_CONTEXT_VERSION_MAJOR, 3);
GLFW.glfwWindowHint(GLFW.GLFW_CONTEXT_VERSION_MINOR, 2);
GLFW.glfwWindowHint(GLFW.GLFW_OPENGL_FORWARD_COMPAT, GLFW.GLFW_TRUE);
GLFW.glfwWindowHint(GLFW.GLFW_OPENGL_PROFILE,
GLFW.GLFW_OPENGL_CORE_PROFILE);
// Create the window
this.handle = GLFW.glfwCreateWindow(this.width, this.height, this.title,
MemoryUtil.NULL, MemoryUtil.NULL);
if (this.handle == MemoryUtil.NULL)
{
throw new RuntimeException("Failed to create the GLFW window");
}
//Create the input context
//this.inputEngine = new InputEngine(this);
//Setup a size callback.
GLFW.glfwSetWindowSizeCallback(this.handle, (window, w, h) ->
{
int prevW = this.width;
int prevH = this.height;
this.width = w;
this.height = h;
this.onWindowSizeChanged.notifyListeners(new int[]{
this.width, this.height, prevW, prevH
});
});
//Setup a position callback
GLFW.glfwSetWindowPosCallback(this.handle, (window, xpos, ypos) -> {
int prevX = this.x;
int prevY = this.y;
this.x = xpos;
this.y = ypos;
this.onWindowPosChanged.notifyListeners(new int[]{
this.x, this.y, prevX, prevY
});
});
this.makeWindowCentered();
// Make the OpenGL context current
GLFW.glfwMakeContextCurrent(this.handle);
// Enable v-sync
GLFW.glfwSwapInterval(this.vsync ? 1 : 0);
// This line is critical for LWJGL's interoperation with GLFW's
// OpenGL context, or any context that is managed externally.
// LWJGL detects the context that is current in the current thread,
// creates the GLCapabilities instance and makes the OpenGL
// bindings available for use.
GL.createCapabilities();
System.out.println("OPENGL " + GL11.glGetString(GL11.GL_VERSION));
// Set the clear color
GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
//Enable depth testing
GL11.glEnable(GL11.GL_DEPTH_TEST);
//Set current viewport
this.view = new View(this);
}
示例4: setWindowHint
import org.lwjgl.glfw.GLFW; //导入方法依赖的package包/类
public WindowHandle setWindowHint(int hint, boolean flag) {
GLFW.glfwWindowHint(hint, (flag ? 1 : 0));
return this;
}