本文整理汇总了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();
}
}
示例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;
}
示例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);
}
示例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();
}
}
示例5: setTitle
import org.lwjgl.MemoryUtil; //导入方法依赖的package包/类
public void setTitle(String title) {
ByteBuffer buffer = MemoryUtil.encodeUTF8(title);
nSetTitle(window, buffer);
}