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


Java MemoryUtil.encodeASCII方法代码示例

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


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

示例1: getFunctionAddress

import org.lwjgl.MemoryUtil; //导入方法依赖的package包/类
/** Helper method to get a pointer to a named function in the OpenGL library. */
static long getFunctionAddress(String name) {
	ByteBuffer buffer = MemoryUtil.encodeASCII(name);
	return ngetFunctionAddress(MemoryUtil.getAddress(buffer));
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:6,代码来源:GLContext.java

示例2: getFunctionAddress

import org.lwjgl.MemoryUtil; //导入方法依赖的package包/类
/** Helper method to get a pointer to a named function in the OpenCL library. */
static long getFunctionAddress(String name) {
	ByteBuffer buffer = MemoryUtil.encodeASCII(name);
	return ngetFunctionAddress(MemoryUtil.getAddress(buffer));
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:6,代码来源:CL.java

示例3: alcCaptureOpenDevice

import org.lwjgl.MemoryUtil; //导入方法依赖的package包/类
/**
 * The alcCaptureOpenDevice function allows the application to connect to a capture
 * device. To obtain a list of all available capture devices, use getCaptureDevices a list of all
 * capture devices will be returned. Retrieving ALC_CAPTURE_DEVICE_SPECIFIER with a valid capture device specified will result
 * in the name of that device being returned as a single string.
 *
 * If the function returns null, then no sound driver/device has been found, or the
 * requested format could not be fulfilled.
 * The "deviceName" argument is a string that requests a certain device or
 * device configuration. If null is specified, the implementation will provide an
 * implementation specific default. The "frequency" and "format" arguments specify the format that
 * audio data will be presented to the application, and match the values that can be passed to
 * alBufferData. The implementation is expected to convert and resample to this format on
 * behalf of the application. The "buffersize" argument specifies the number of sample frames
 * to buffer in the AL, for example, requesting a format of AL_FORMAT_STEREO16 and
 * a buffer size of 1024 would require the AL to store up to 1024 * 4 bytes of audio data.
 * Note that the implementation may use a larger buffer than requested if it needs to, but the
 * implementation will set up a buffer of at least the requested size.
 * Specifying a compressed or extension-supplied format may result in failure, even if the
 * extension is supplied for rendering.
 *
 * <i>LWJGL SPECIFIC: the actual created device is managed internally in lwjgl</i>
 *
 * @param devicename Name of device to open for capture
 * @param frequency Frequency of samples to capture
 * @param format Format of samples to capture
 * @param buffersize Size of buffer to capture to
 * @return ALCdevice if it was possible to open a device
 */
public static ALCdevice alcCaptureOpenDevice(String devicename, int frequency, int format, int buffersize) {
	ByteBuffer buffer = MemoryUtil.encodeASCII(devicename);
	long device_address = nalcCaptureOpenDevice(MemoryUtil.getAddressSafe(buffer), frequency, format, buffersize);
	if(device_address != 0) {
		ALCdevice device = new ALCdevice(device_address);
		synchronized (ALC10.devices) {
			ALC10.devices.put(device_address, device);
		}
		return device;
	}
	return null;
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:42,代码来源:ALC11.java

示例4: alcIsExtensionPresent

import org.lwjgl.MemoryUtil; //导入方法依赖的package包/类
/**
* Verify that a given extension is available for the current context and the device it
* is associated with.
* A <code>null</code> name argument returns <code>ALC_FALSE</code>, as do invalid and unsupported string
* tokens.
 *
 * @param extName name of extension to find
 * @return true if extension is available, false if not
 */
public static boolean alcIsExtensionPresent(ALCdevice device, String extName) {
	ByteBuffer buffer = MemoryUtil.encodeASCII(extName);
	boolean result = nalcIsExtensionPresent(getDevice(device), MemoryUtil.getAddress(buffer));
	Util.checkALCError(device);
	return result;
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:16,代码来源:ALC10.java

示例5: alcGetEnumValue

import org.lwjgl.MemoryUtil; //导入方法依赖的package包/类
/**
 * Enumeration/token values are device independend, but tokens defined for
* extensions might not be present for a given device. But only the tokens defined
* by the AL core are guaranteed. Availability of extension tokens dependends on the ALC extension.
*
* Specifying a <code>null</code> name parameter will cause an <code>ALC_INVALID_VALUE</code> error.
 *
 * @param enumName name of enum to find
 * @return value of enumeration
 */
public static int alcGetEnumValue(ALCdevice device, String enumName) {
	ByteBuffer buffer = MemoryUtil.encodeASCII(enumName);
	int result = nalcGetEnumValue(getDevice(device), MemoryUtil.getAddress(buffer));
	Util.checkALCError(device);
	return result;
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:17,代码来源:ALC10.java


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