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


Java MemoryUtil.encodeUTF8方法代码示例

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


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

示例1: setTitle

import org.lwjgl.MemoryUtil; //导入方法依赖的package包/类
public void setTitle(String title) {
	lockAWT();
	try {
		final ByteBuffer titleText = MemoryUtil.encodeUTF8(title);
		nSetTitle(getDisplay(), getWindow(), MemoryUtil.getAddress(titleText), titleText.remaining() - 1);
	} finally {
		unlockAWT();
	}
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:10,代码来源:LinuxDisplay.java

示例2: alcOpenDevice

import org.lwjgl.MemoryUtil; //导入方法依赖的package包/类
/**
 * The <code>alcOpenDevice</code> function allows the application (i.e. the client program) to
* connect to a device (i.e. the server).
*
* If the function returns <code>null</code>, then no sound driver/device has been found. The
* argument is a null terminated string that requests a certain device or device
* configuration. If <code>null</code> is specified, the implementation will provide an
* implementation specific default.
 *
 * @param devicename name of device to open
 * @return opened device, or null
 */
public static ALCdevice alcOpenDevice(String devicename) {
	ByteBuffer buffer = MemoryUtil.encodeUTF8(devicename);
	long device_address = nalcOpenDevice(MemoryUtil.getAddressSafe(buffer));
	if(device_address != 0) {
		ALCdevice device = new ALCdevice(device_address);
		synchronized (ALC10.devices) {
			devices.put(device_address, device);
		}
		return device;
	}
	return null;
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:25,代码来源:ALC10.java

示例3: setTitle

import org.lwjgl.MemoryUtil; //导入方法依赖的package包/类
public void setTitle(String title) {
	lockAWT();
	try {
		final ByteBuffer titleText = MemoryUtil.encodeUTF8(title);
		nSetTitle(getDisplay(), getWindow(), MemoryUtil.getAddress(titleText), titleText.remaining() - 1);
	} finally {
		unlockAWT();
	}
	
	// also update the class hint value as some WM's use it for the window title
	if (Display.isCreated()) setClassHint(title, wm_class);
}
 
开发者ID:Superloup10,项目名称:Wolf_game,代码行数:13,代码来源:LinuxDisplay.java

示例4: setClassHint

import org.lwjgl.MemoryUtil; //导入方法依赖的package包/类
/** the WM_CLASS hint is needed by some WM's e.g. gnome shell */
private void setClassHint(String wm_name, String wm_class) {
	lockAWT();
	try {
		final ByteBuffer nameText = MemoryUtil.encodeUTF8(wm_name);
		final ByteBuffer classText = MemoryUtil.encodeUTF8(wm_class);
		
		nSetClassHint(getDisplay(), getWindow(), MemoryUtil.getAddress(nameText), MemoryUtil.getAddress(classText));
	} finally {
		unlockAWT();
	}
}
 
开发者ID:Superloup10,项目名称:Wolf_game,代码行数:13,代码来源:LinuxDisplay.java

示例5: setTitle

import org.lwjgl.MemoryUtil; //导入方法依赖的package包/类
public void setTitle(String title) {
	ByteBuffer buffer = MemoryUtil.encodeUTF8(title);
	nSetTitle(window, buffer);
}
 
开发者ID:mleoking,项目名称:PhET,代码行数:5,代码来源:MacOSXDisplay.java


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