本文整理汇总了Java中org.lwjgl.PointerBuffer.capacity方法的典型用法代码示例。如果您正苦于以下问题:Java PointerBuffer.capacity方法的具体用法?Java PointerBuffer.capacity怎么用?Java PointerBuffer.capacity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.lwjgl.PointerBuffer
的用法示例。
在下文中一共展示了PointerBuffer.capacity方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: create
import org.lwjgl.PointerBuffer; //导入方法依赖的package包/类
private long create(int depth, GLData attribs, GLData effective) throws AWTException {
int screen = X11.XDefaultScreen(display);
IntBuffer attrib_list = BufferUtils.createIntBuffer(16 * 2);
attrib_list.put(GLX_DRAWABLE_TYPE).put(GLX_WINDOW_BIT);
attrib_list.put(GLX_RENDER_TYPE).put(GLX_RGBA_BIT);
attrib_list.put(GLX_RED_SIZE).put(attribs.redSize);
attrib_list.put(GLX_GREEN_SIZE).put(attribs.greenSize);
attrib_list.put(GLX_BLUE_SIZE).put(attribs.blueSize);
attrib_list.put(GLX_DEPTH_SIZE).put(attribs.depthSize);
if (attribs.doubleBuffer)
attrib_list.put(GLX_DOUBLEBUFFER).put(1);
attrib_list.put(0);
attrib_list.flip();
PointerBuffer fbConfigs = glXChooseFBConfig(display, screen, attrib_list);
if (fbConfigs == null || fbConfigs.capacity() == 0) {
// No framebuffer configurations supported!
throw new AWTException("No supported framebuffer configurations found");
}
long context = glXCreateNewContext(display, fbConfigs.get(0), GLX_RGBA_TYPE, NULL, true);
return context;
}
示例2: printBuffer
import org.lwjgl.PointerBuffer; //导入方法依赖的package包/类
private String printBuffer(PointerBuffer buffer) {
long address = MemoryUtil.memAddress0(buffer);
int pos = buffer.position();
int lim = buffer.limit();
int cap = buffer.capacity();
if (pos == 0 && lim == cap)
return "PointerBuffer[0x" + Long.toString(address, 16) + ", " + lim + "]";
else
return "PointerBuffer[0x" + Long.toString(address, 16) + ", " + pos + ", " + lim + ", " + cap + "]";
}
示例3: getFullscreenVideoModes
import org.lwjgl.PointerBuffer; //导入方法依赖的package包/类
/**
* Get all of the available video modes
*
* @return The video modes
*/
public static ArrayList<GLFWVidMode> getFullscreenVideoModes() {
PointerBuffer monitors = GLFW.glfwGetMonitors();
ArrayList<GLFWVidMode> modes = new ArrayList<>();
for (int i = 0; i < monitors.capacity(); i++) {
GLFWVidMode.Buffer vidModes = GLFW.glfwGetVideoModes(monitors.get(i));
for (int j = 0; j < vidModes.capacity(); j++) {
modes.add(vidModes.get(j));
}
}
return modes;
}