• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java BufferChecks类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.lwjgl.BufferChecks的典型用法代码示例。如果您正苦于以下问题:Java BufferChecks类的具体用法?Java BufferChecks怎么用?Java BufferChecks使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



BufferChecks类属于org.lwjgl包,在下文中一共展示了BufferChecks类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: Cursor

import org.lwjgl.BufferChecks; //导入依赖的package包/类
/**
 * Constructs a new Cursor, with the given parameters. Mouse must have been created before you can create
 * Cursor objects. Cursor images are in ARGB format, but only one bit transparancy is guaranteed to be supported.
 * So to maximize portability, lwjgl applications should only create cursor images with 0x00 or 0xff as alpha values.
 * The constructor will copy the images and delays, so there's no need to keep them around.
 *
 * @param width cursor image width
 * @param height cursor image height
 * @param xHotspot the x coordinate of the cursor hotspot
 * @param yHotspot the y coordinate of the cursor hotspot
 * @param numImages number of cursor images specified. Must be 1 if animations are not supported.
 * @param images A buffer containing the images. The origin is at the lower left corner, like OpenGL.
 * @param delays An int buffer of animation frame delays, if numImages is greater than 1, else null
 * @throws LWJGLException if the cursor could not be created for any reason
 */
public Cursor(int width, int height, int xHotspot, int yHotspot, int numImages, IntBuffer images, IntBuffer delays) throws LWJGLException {
	synchronized (OpenGLPackageAccess.global_lock) {
		if ((getCapabilities() & CURSOR_ONE_BIT_TRANSPARENCY) == 0)
			throw new LWJGLException("Native cursors not supported");
		BufferChecks.checkBufferSize(images, width*height*numImages);
		if (delays != null)
			BufferChecks.checkBufferSize(delays, numImages);
		if (!Mouse.isCreated())
			throw new IllegalStateException("Mouse must be created before creating cursor objects");
		if (width*height*numImages > images.remaining())
			throw new IllegalArgumentException("width*height*numImages > images.remaining()");
		if (xHotspot >= width || xHotspot < 0)
			throw new IllegalArgumentException("xHotspot > width || xHotspot < 0");
		if (yHotspot >= height || yHotspot < 0)
			throw new IllegalArgumentException("yHotspot > height || yHotspot < 0");

		Sys.initialize();

		// Hmm
		yHotspot = height - 1 - yHotspot;

		// create cursor (or cursors if multiple images supplied)
		cursors = createCursors(width, height, xHotspot, yHotspot, numImages, images, delays);
	}
}
 
开发者ID:Superloup10,项目名称:Wolf_game,代码行数:41,代码来源:Cursor.java


示例2: eglGetConfigs

import org.lwjgl.BufferChecks; //导入依赖的package包/类
/**
 * Returns the available EGLConfigs on the speficied display. The number of available EGLConfigs
 * is returned in the num_config parameter. The configs array may be null. If it is null, a new
 * array will be allocated, with size equal to the result of {@link #eglGetConfigsNum(EGLDisplay)}  eglGetConfigsNum}.
 * If it is not null, no more than {@code configs.length} EGLConfigs will be returned. If the array is bigger
 * than the number of available EGLConfigs, the remaining array elements will not be affected.
 *
 * @param dpy        the EGLDisplay
 * @param configs    the EGLConfigs array
 * @param num_config the number of available EGLConfigs returned
 *
 * @return the available EGLConfigs
 *
 * @throws org.lwjgl.LWJGLException if an EGL error occurs
 */
static EGLConfig[] eglGetConfigs(EGLDisplay dpy, EGLConfig[] configs, IntBuffer num_config) throws LWJGLException {
	//LWJGLUtil.log("eglGetConfigs");
	BufferChecks.checkBuffer(num_config, 1);

	if ( configs == null ) {
		if ( !neglGetConfigs(dpy.getPointer(), 0L, 0, MemoryUtil.getAddress(num_config)) )
			throwEGLError("Failed to get number of available EGL configs.");

		configs = new EGLConfig[num_config.get(num_config.position())];
	}

	final PointerBuffer configs_buffer = APIUtil.getBufferPointer(configs.length);
	if ( !neglGetConfigs(dpy.getPointer(), MemoryUtil.getAddress0(configs_buffer), configs.length, MemoryUtil.getAddress(num_config)) )
		throwEGLError("Failed to get EGL configs.");

	final int config_size = num_config.get(num_config.position());
	for ( int i = 0; i < config_size; i++ )
		configs[i] = new EGLConfig(dpy, configs_buffer.get(i));

	return configs;
}
 
开发者ID:Superloup10,项目名称:Wolf_game,代码行数:37,代码来源:EGL.java


示例3: glQueryContextNV

import org.lwjgl.BufferChecks; //导入依赖的package包/类
/**
 * Queries an attribute associated with the current context. This method is the cross-platform
 * equivalent of glXQueryContext and wglQueryCurrentContextNV.
 *
 * @param attrib the attribute to query
 * @param value  the buffer to store the value in
 */
public static boolean glQueryContextNV(int attrib, IntBuffer value) {
	checkExtension();

	BufferChecks.checkBuffer(value, 1);
	ContextGL ctx = ContextGL.getCurrentContext();
	return nglQueryContextNV(ctx.getPeerInfo().getHandle(), ctx.getHandle(), attrib, value, value.position());
}
 
开发者ID:Superloup10,项目名称:Wolf_game,代码行数:15,代码来源:NVPresentVideoUtil.java


示例4: eglChooseConfig

import org.lwjgl.BufferChecks; //导入依赖的package包/类
/**
 * Returns the available EGLConfigs on the speficied display that satisfy the specified list of attributes.
 * The number of available EGLConfigs is returned in the num_config parameter. The configs array may be null.
 * If it is null, a new array will be allocated, with size equal to the result of {@link #eglGetConfigsNum(EGLDisplay)}  eglGetConfigsNum}.
 * If it is not null, no more than {@code configs.length} EGLConfigs will be returned. If the array is bigger
 * than the number of available EGLConfigs, the remaining array elements will not be affected.
 *
 * @param dpy         the EGLDisplay
 * @param attrib_list the attribute list (may be null)
 * @param configs     the EGLConfigs array
 * @param num_config  the number of available EGLConfigs returned
 *
 * @return the available EGLConfigs that satisfy the attribute list
 *
 * @throws org.lwjgl.LWJGLException if an EGL error occurs
 */
static EGLConfig[] eglChooseConfig(EGLDisplay dpy, IntBuffer attrib_list, EGLConfig[] configs, IntBuffer num_config) throws LWJGLException {
	//LWJGLUtil.log("eglChooseConfig");
	checkAttribList(attrib_list);
	BufferChecks.checkBuffer(num_config, 1);

	int config_size;
	if ( configs == null ) {
		if ( !neglChooseConfig(dpy.getPointer(), MemoryUtil.getAddressSafe(attrib_list), 0L, 0, MemoryUtil.getAddress(num_config)) )
			throwEGLError("Failed to get number of available EGL configs.");

		config_size = num_config.get(num_config.position());
	} else
		config_size = configs.length;

	//LWJGLUtil.log("config_size = " + config_size);
	PointerBuffer configs_buffer = APIUtil.getBufferPointer(config_size);
	if ( !neglChooseConfig(dpy.getPointer(), MemoryUtil.getAddressSafe(attrib_list), MemoryUtil.getAddress0(configs_buffer), config_size, MemoryUtil.getAddress(num_config)) )
		throwEGLError("Failed to choose EGL config.");

	// Get the true number of configurations (the first neglChooseConfig call may return more than the second)
	config_size = num_config.get(num_config.position());
	if ( configs == null )
		configs = new EGLConfig[config_size];
	for ( int i = 0; i < config_size; i++ )
		configs[i] = new EGLConfig(dpy, configs_buffer.get(i));

	return configs;
}
 
开发者ID:Superloup10,项目名称:Wolf_game,代码行数:45,代码来源:EGL.java


示例5: glEnumerateVideoDevicesNV

import org.lwjgl.BufferChecks; //导入依赖的package包/类
/**
 * Enumerate the available video output devices. This method is the cross-platform
 * equivalent of glXEnumerateVideoDevicesNV and wglEnumerateVideoDevicesNV. Since they are
 * not really compatible, this method works like the WGL version. That is, you first
 * call it with a null devices buffer, get the number of devices, then call it again
 * with an appropriately sized buffer.
 *
 * @param devices the buffer to store devices in
 *
 * @return the number of available video output devices
 */
public static int glEnumerateVideoDevicesNV(LongBuffer devices) {
	checkExtension();

	if ( devices != null )
		BufferChecks.checkBuffer(devices, 1);
	return nglEnumerateVideoDevicesNV(getPeerInfo(), devices, devices == null ? 0 : devices.position());
}
 
开发者ID:Superloup10,项目名称:Wolf_game,代码行数:19,代码来源:NVPresentVideoUtil.java


示例6: glBindVideoDeviceNV

import org.lwjgl.BufferChecks; //导入依赖的package包/类
/**
 * Binds the video output device specified to one of the context's available video output slots.
 * This method is the cross-platform equivalent of glXBindVideoDeviceNV and wglBindVideoDeviceNV.
 * To release a video device without binding another device to the same slot, call it with
 * video_device set to 0 (will use INVALID_HANDLE_VALUE on WGL).
 *
 * @param video_slot   the video slot
 * @param video_device the video device
 * @param attrib_list  the attributes to use
 *
 * @return true if the binding was successful
 */
public static boolean glBindVideoDeviceNV(int video_slot, long video_device, IntBuffer attrib_list) {
	checkExtension();

	if ( attrib_list != null )
		BufferChecks.checkNullTerminated(attrib_list);
	return nglBindVideoDeviceNV(getPeerInfo(), video_slot, video_device, attrib_list, attrib_list == null ? 0 : attrib_list.position());
}
 
开发者ID:Superloup10,项目名称:Wolf_game,代码行数:20,代码来源:NVPresentVideoUtil.java


示例7: glEnumerateVideoCaptureDevicesNV

import org.lwjgl.BufferChecks; //导入依赖的package包/类
/**
 * Enumerate the available video capture devices. This method is the cross-platform
 * equivalent of glXEnumerateVideoCaptureDevicesNV and wglEnumerateVideoCaptureDevicesNV.
 * Since they are not really compatible, this method works like the WGL version. That is,
 * you first call it with a null devices buffer, get the number of devices, then call it
 * again with an appropriately sized buffer.
 *
 * @param devices the buffer to store devices in
 *
 * @return the number of available video capture devices
 */
public static int glEnumerateVideoCaptureDevicesNV(LongBuffer devices) {
	checkExtension();

	if ( devices != null )
		BufferChecks.checkBuffer(devices, 1);
	return nglEnumerateVideoCaptureDevicesNV(getPeerInfo(), devices, devices == null ? 0 : devices.position());
}
 
开发者ID:Superloup10,项目名称:Wolf_game,代码行数:19,代码来源:NVVideoCaptureUtil.java


示例8: glQueryVideoCaptureDeviceNV

import org.lwjgl.BufferChecks; //导入依赖的package包/类
/**
 * Use this method to query the unique ID of the physical device backing a
 * video capture device handle.
 *
 * @param device    the device
 * @param attribute the attribute to query
 * @param value     the buffer to store the value in
 *
 * @return true if the query was successful
 */
public static boolean glQueryVideoCaptureDeviceNV(long device, int attribute, IntBuffer value) {
	checkExtension();

	BufferChecks.checkBuffer(value, 1);
	return nglQueryVideoCaptureDeviceNV(getPeerInfo(), device, attribute, value, value.position());
}
 
开发者ID:Superloup10,项目名称:Wolf_game,代码行数:17,代码来源:NVVideoCaptureUtil.java


示例9: eglInitialize

import org.lwjgl.BufferChecks; //导入依赖的package包/类
/**
 * Initializes the specified EGL display.
 *
 * @param dpy     the EGL display to initialize
 * @param version the EGL major and minor version will be returned in this buffer.
 *
 * @throws org.lwjgl.LWJGLException if an EGL error occurs
 */
static void eglInitialize(EGLDisplay dpy, IntBuffer version) throws LWJGLException {
	//LWJGLUtil.log("eglInitialize");
	BufferChecks.checkBuffer(version, 2);
	if ( !neglInitialize(dpy.getPointer(), MemoryUtil.getAddress(version)) )
		throwEGLError("Failed to initialize EGL display.");
}
 
开发者ID:Superloup10,项目名称:Wolf_game,代码行数:15,代码来源:EGL.java


示例10: eglQuerySurface

import org.lwjgl.BufferChecks; //导入依赖的package包/类
/**
 * Returns the value of the specified EGL surface attribute in the value parameter.
 *
 * @param dpy       the EGL display
 * @param surface   the EGL surface
 * @param attribute the surface attribute
 * @param value     the attribute value will be returned here
 *
 * @throws org.lwjgl.LWJGLException if an EGL error occurs
 */
public static void eglQuerySurface(EGLDisplay dpy, EGLSurface surface, int attribute, IntBuffer value) throws LWJGLException {
	//LWJGLUtil.log("eglQuerySurface");
	BufferChecks.checkBuffer(value, 1);
	if ( !neglQuerySurface(dpy.getPointer(), surface.getPointer(), attribute, MemoryUtil.getAddress(value)) )
		throwEGLError("Failed to query surface attribute.");
}
 
开发者ID:Superloup10,项目名称:Wolf_game,代码行数:17,代码来源:EGL.java


示例11: eglQueryContext

import org.lwjgl.BufferChecks; //导入依赖的package包/类
/**
 * Returns the value of the specified EGL context attribute in the value parameter.
 *
 * @param dpy       the EGL display
 * @param ctx       the EGL context
 * @param attribute the context attribute
 * @param value     the attribute value will be returned here
 *
 * @throws org.lwjgl.LWJGLException if an EGL error occurs
 */
public static void eglQueryContext(EGLDisplay dpy, EGLContext ctx, int attribute, IntBuffer value) throws LWJGLException {
	//LWJGLUtil.log("eglQueryContext");
	BufferChecks.checkBuffer(value, 1);
	if ( !neglQueryContext(dpy.getPointer(), ctx.getPointer(), attribute, MemoryUtil.getAddress(value)) )
		throwEGLError("Failed to query context attribute.");
}
 
开发者ID:Superloup10,项目名称:Wolf_game,代码行数:17,代码来源:EGL.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java GuildUnbanEvent类代码示例发布时间:2022-05-22
下一篇:
Java FileBasedIPList类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap