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


Java PointerBuffer.capacity方法代码示例

本文整理汇总了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;
}
 
开发者ID:httpdigest,项目名称:lwjgl3-awt,代码行数:22,代码来源:PlatformLinuxGLCanvas.java

示例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 + "]";
}
 
开发者ID:LWJGLX,项目名称:debug,代码行数:11,代码来源:MethodCall.java

示例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;
}
 
开发者ID:warlockcodes,项目名称:Null-Engine,代码行数:20,代码来源:Window.java


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