本文整理汇总了Java中com.jme3.util.BufferUtils.printCurrentDirectMemory方法的典型用法代码示例。如果您正苦于以下问题:Java BufferUtils.printCurrentDirectMemory方法的具体用法?Java BufferUtils.printCurrentDirectMemory怎么用?Java BufferUtils.printCurrentDirectMemory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jme3.util.BufferUtils
的用法示例。
在下文中一共展示了BufferUtils.printCurrentDirectMemory方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onAction
import com.jme3.util.BufferUtils; //导入方法依赖的package包/类
public void onAction(String name, boolean value, float tpf) {
if (!value) {
return;
}
if (name.equals(INPUT_MAPPING_EXIT)) {
stop();
} else if (name.equals(INPUT_MAPPING_CAMERA_POS)) {
if (cam != null) {
Vector3f loc = cam.getLocation();
Quaternion rot = cam.getRotation();
System.out.println("Camera Position: ("
+ loc.x + ", " + loc.y + ", " + loc.z + ")");
System.out.println("Camera Rotation: " + rot);
System.out.println("Camera Direction: " + cam.getDirection());
}
} else if (name.equals(INPUT_MAPPING_MEMORY)) {
BufferUtils.printCurrentDirectMemory(null);
}
}
示例2: debugGetNumberOfBuffers
import com.jme3.util.BufferUtils; //导入方法依赖的package包/类
/**
* Displays the number of buffers being tracked in memory. Increasing amounts mean
* memory leaks (most likely)
* <p/>
* NOTE: only works if disableBufferTrackingPerformanceHack() has not been called
*
* @return Number of buffers.
*/
public static int debugGetNumberOfBuffers() {
// only way to get this info is to read it out of a string returned :(
StringBuilder builder = new StringBuilder();
BufferUtils.printCurrentDirectMemory( builder );
String str = builder.toString();
int start = str.indexOf( ": " ) + 2;
int end = str.indexOf( "\n" );
return Integer.parseInt( str.substring( start, end ) );
}