本文整理汇总了Java中org.lwjgl.BufferUtils.createDoubleBuffer方法的典型用法代码示例。如果您正苦于以下问题:Java BufferUtils.createDoubleBuffer方法的具体用法?Java BufferUtils.createDoubleBuffer怎么用?Java BufferUtils.createDoubleBuffer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.lwjgl.BufferUtils
的用法示例。
在下文中一共展示了BufferUtils.createDoubleBuffer方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: Model
import org.lwjgl.BufferUtils; //导入方法依赖的package包/类
/**
* Creates the buffers and puts the data inside
*
* @param vertices the edges of the pinball
*/
Model(double[] vertices) {
draw_count = vertices.length / 3;
buffer = BufferUtils.createDoubleBuffer(vertices.length);
buffer.put(vertices);
buffer.flip();
vao_id = glGenVertexArrays();
glBindVertexArray(vao_id);
vbo_id = glGenBuffers();
glBindBuffer(GL_ARRAY_BUFFER, vbo_id);
glBufferData(GL_ARRAY_BUFFER, buffer, GL_DYNAMIC_DRAW);
glVertexAttribPointer(0, 3, GL_DOUBLE, false, 0, 0);
glEnableVertexAttribArray(0);
glBindBuffer(GL_ARRAY_BUFFER, 0);
glBindVertexArray(0);
}
示例2: getCursorPos
import org.lwjgl.BufferUtils; //导入方法依赖的package包/类
private Vector2f getCursorPos() {
DoubleBuffer xpos = BufferUtils.createDoubleBuffer(1);
DoubleBuffer ypos = BufferUtils.createDoubleBuffer(1);
xpos.rewind();
xpos.rewind();
GLFW.glfwGetCursorPos(window.windowID, xpos, ypos);
double x = xpos.get();
double y = ypos.get();
xpos.clear();
ypos.clear();
Vector2f result = new Vector2f((float) x, (float) y);
return result;
}
示例3: glClipPlanef
import org.lwjgl.BufferUtils; //导入方法依赖的package包/类
@Override
public void glClipPlanef(int plane, float[] equation, int offset) {
DoubleBuffer buffer = BufferUtils.createDoubleBuffer(equation.length);
for (float f : equation) {
buffer.put(f);
}
GL11.glClipPlane(plane, buffer);
}
示例4: glClipPlanex
import org.lwjgl.BufferUtils; //导入方法依赖的package包/类
@Override
public void glClipPlanex(int plane, IntBuffer equation) {
DoubleBuffer buffer = BufferUtils.createDoubleBuffer(equation.capacity());
for (float f : equation.array()) {
buffer.put(f);
}
GL11.glClipPlane(plane, buffer);
}
示例5: glGetClipPlanef
import org.lwjgl.BufferUtils; //导入方法依赖的package包/类
@Override
public void glGetClipPlanef(int pname, float[] eqn, int offset) {
DoubleBuffer buffer = BufferUtils.createDoubleBuffer(eqn.length);
for (float f : eqn) {
buffer.put(f);
}
GL11.glGetClipPlane(pname, buffer);
}
示例6: glGetClipPlanex
import org.lwjgl.BufferUtils; //导入方法依赖的package包/类
@Override
public void glGetClipPlanex(int pname, int[] eqn, int offset) {
DoubleBuffer buffer = BufferUtils.createDoubleBuffer(eqn.length);
for (int f : eqn) {
buffer.put(f);
}
GL11.glGetClipPlane(pname, buffer);
}
示例7: createDoubleBuffer
import org.lwjgl.BufferUtils; //导入方法依赖的package包/类
public static DoubleBuffer createDoubleBuffer(int size)
{
return BufferUtils.createDoubleBuffer(size);
}