本文整理汇总了Java中org.lwjgl.LWJGLUtil.log方法的典型用法代码示例。如果您正苦于以下问题:Java LWJGLUtil.log方法的具体用法?Java LWJGLUtil.log怎么用?Java LWJGLUtil.log使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.lwjgl.LWJGLUtil
的用法示例。
在下文中一共展示了LWJGLUtil.log方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: destroy
import org.lwjgl.LWJGLUtil; //导入方法依赖的package包/类
public void destroy() {
synchronized ( GlobalLock.lock ) {
if ( context == null )
return;
try {
releaseContext();
context.forceDestroy();
context = null;
if ( peer_info != null ) {
peer_info.destroy();
peer_info = null;
}
} catch (LWJGLException e) {
LWJGLUtil.log("Exception occurred while destroying Drawable: " + e);
}
}
}
示例2: getMaxCursorSize
import org.lwjgl.LWJGLUtil; //导入方法依赖的package包/类
public int getMaxCursorSize() {
lockAWT();
try {
incDisplay();
try {
return nGetMaxCursorSize(getDisplay(), getWindow());
} finally {
decDisplay();
}
} catch (LWJGLException e) {
LWJGLUtil.log("Exception occurred in getMaxCursorSize: " + e);
return 0;
} finally {
unlockAWT();
}
}
示例3: findConfiguration
import org.lwjgl.LWJGLUtil; //导入方法依赖的package包/类
/**
* Find a proper GraphicsConfiguration from the given GraphicsDevice and PixelFormat.
*
* @return The GraphicsConfiguration corresponding to a visual that matches the pixel format.
*/
public GraphicsConfiguration findConfiguration(GraphicsDevice device, PixelFormat pixel_format) throws LWJGLException {
try {
int screen = getScreenFromDevice(device);
int visual_id_matching_format = findVisualIDFromFormat(screen, pixel_format);
GraphicsConfiguration[] configurations = device.getConfigurations();
for ( GraphicsConfiguration configuration : configurations ) {
int visual_id = getVisualIDFromConfiguration(configuration);
if ( visual_id == visual_id_matching_format )
return configuration;
}
} catch (LWJGLException e) {
LWJGLUtil.log("Got exception while trying to determine configuration: " + e);
}
return null; // In case we failed to locate the visual, or if we're not on a SUN JDK
}
示例4: isXrandrSupported
import org.lwjgl.LWJGLUtil; //导入方法依赖的package包/类
private static boolean isXrandrSupported() {
if (Display.getPrivilegedBoolean("LWJGL_DISABLE_XRANDR"))
return false;
lockAWT();
try {
incDisplay();
try {
return nIsXrandrSupported(getDisplay());
} finally {
decDisplay();
}
} catch (LWJGLException e) {
LWJGLUtil.log("Got exception while querying Xrandr support: " + e);
return false;
} finally {
unlockAWT();
}
}
示例5: destroyWindow
import org.lwjgl.LWJGLUtil; //导入方法依赖的package包/类
public void destroyWindow() {
lockAWT();
try {
if (parent != null) {
parent.removeFocusListener(focus_listener);
}
try {
setNativeCursor(null);
} catch (LWJGLException e) {
LWJGLUtil.log("Failed to reset cursor: " + e.getMessage());
}
nDestroyCursor(getDisplay(), blank_cursor);
blank_cursor = None;
ungrabKeyboard();
nDestroyWindow(getDisplay(), getWindow());
decDisplay();
if ( current_window_mode != WINDOWED )
Compiz.setLegacyFullscreenSupport(false);
} finally {
unlockAWT();
}
}
示例6: testDebug
import org.lwjgl.LWJGLUtil; //导入方法依赖的package包/类
/**
* Tests debug mode
*/
private void testDebug() {
System.out.println("==== Test Debug ====");
if (LWJGLUtil.DEBUG) {
LWJGLUtil.log("Debug is enabled, you should now see output from LWJGL during the following tests.");
} else {
System.out.println("Debug is not enabled. Please set the org.lwjgl.Sys.debug property to true to enable debugging");
System.out.println("Example:\n java -Dorg.lwjgl.util.Debug=true ...");
System.out.println("You will not see any debug output in the following tests.");
}
// get some display modes, to force some debug info
try {
Display.getAvailableDisplayModes();
} catch (LWJGLException e) {
throw new RuntimeException(e);
}
System.out.println("---- Test Debug ----\n");
}
示例7: setIcon
import org.lwjgl.LWJGLUtil; //导入方法依赖的package包/类
/**
* Sets one or more icons for the Display.
* <ul>
* <li>On Windows you should supply at least one 16x16 icon and one 32x32.</li>
* <li>Linux (and similar platforms) expect one 32x32 icon.</li>
* <li>Mac OS X should be supplied one 128x128 icon</li>
* </ul>
* The implementation will use the supplied ByteBuffers with image data in RGBA and perform any conversions necessary for the specific platform.
*
* @param icons Array of icons in RGBA mode
* @return number of icons used.
*/
public int setIcon(ByteBuffer[] icons) {
lockAWT();
try {
incDisplay();
try {
// get icons as cardinal ARGB format
ByteBuffer icons_data = convertIcons(icons);
if (icons_data == null) return 0;
nSetWindowIcon(getDisplay(), getWindow(), icons_data, icons_data.capacity());//, icon_mask, icon_mask.capacity(), dimension, dimension);
return icons.length;
} finally {
decDisplay();
}
} catch (LWJGLException e) {
LWJGLUtil.log("Failed to set display icon: " + e);
return 0;
} finally {
unlockAWT();
}
}
示例8: resetDisplayMode
import org.lwjgl.LWJGLUtil; //导入方法依赖的package包/类
public void resetDisplayMode() {
lockAWT();
try {
if( current_displaymode_extension == XRANDR && savedXrandrConfig.length > 0 )
{
AccessController.doPrivileged(new PrivilegedAction<Object>() {
public Object run() {
XRandR.setConfiguration( savedXrandrConfig );
return null;
}
});
}
else
{
switchDisplayMode(saved_mode);
}
if (isXF86VidModeSupported())
doSetGamma(saved_gamma);
Compiz.setLegacyFullscreenSupport(false);
} catch (LWJGLException e) {
LWJGLUtil.log("Caught exception while resetting mode: " + e);
} finally {
unlockAWT();
}
}
示例9: lockAndGetHandle
import org.lwjgl.LWJGLUtil; //导入方法依赖的package包/类
public final synchronized ByteBuffer lockAndGetHandle() throws LWJGLException {
Thread this_thread = Thread.currentThread();
while (locking_thread != null && locking_thread != this_thread) {
try {
wait();
} catch (InterruptedException e) {
LWJGLUtil.log("Interrupted while waiting for PeerInfo lock: " + e);
}
}
if (lock_count == 0) {
locking_thread = this_thread;
doLockAndInitHandle();
}
lock_count++;
return getHandle();
}
示例10: getPointerLocation
import org.lwjgl.LWJGLUtil; //导入方法依赖的package包/类
/**
* Use reflection to access the JDK 1.5 pointer location, if possible and
* only if the given component is on the same screen as the cursor. Return
* null otherwise.
*/
private static Point getPointerLocation(final Component component) {
try {
final GraphicsConfiguration config = component.getGraphicsConfiguration();
if (config != null) {
PointerInfo pointer_info = AccessController.doPrivileged(new PrivilegedExceptionAction<PointerInfo>() {
public PointerInfo run() throws Exception {
return MouseInfo.getPointerInfo();
}
});
GraphicsDevice device = pointer_info.getDevice();
if (device == config.getDevice()) {
return pointer_info.getLocation();
}
return null;
}
} catch (Exception e) {
LWJGLUtil.log("Failed to query pointer location: " + e.getCause());
}
return null;
}
示例11: isNetWMFullscreenSupported
import org.lwjgl.LWJGLUtil; //导入方法依赖的package包/类
private static boolean isNetWMFullscreenSupported() throws LWJGLException {
if (Display.getPrivilegedBoolean("LWJGL_DISABLE_NETWM"))
return false;
lockAWT();
try {
incDisplay();
try {
return nIsNetWMFullscreenSupported(getDisplay(), getDefaultScreen());
} finally {
decDisplay();
}
} catch (LWJGLException e) {
LWJGLUtil.log("Got exception while querying NetWM support: " + e);
return false;
} finally {
unlockAWT();
}
}
示例12: createRobot
import org.lwjgl.LWJGLUtil; //导入方法依赖的package包/类
public static Robot createRobot(final Component component) {
try {
return AccessController.doPrivileged(new PrivilegedExceptionAction<Robot>() {
public Robot run() throws Exception {
return new Robot(component.getGraphicsConfiguration().getDevice());
}
});
} catch (PrivilegedActionException e) {
LWJGLUtil.log("Got exception while creating robot: " + e.getCause());
return null;
}
}
示例13: resetDisplayMode
import org.lwjgl.LWJGLUtil; //导入方法依赖的package包/类
public void resetDisplayMode() {
try {
doSetGammaRamp(saved_gamma);
} catch (LWJGLException e) {
LWJGLUtil.log("Failed to reset gamma ramp: " + e.getMessage());
}
current_gamma = saved_gamma;
if (mode_set) {
mode_set = false;
nResetDisplayMode();
}
resetCursorClipping();
}
示例14: setIcon
import org.lwjgl.LWJGLUtil; //导入方法依赖的package包/类
/**
* Sets one or more icons for the Display.
* <ul>
* <li>On Windows you should supply at least one 16x16 icon and one 32x32.</li>
* <li>Linux (and similar platforms) expect one 32x32 icon.</li>
* <li>Mac OS X should be supplied one 128x128 icon</li>
* </ul>
* The implementation will use the supplied ByteBuffers with image data in RGBA and perform any conversions necessary for the specific platform.
*
* @param icons Array of icons in RGBA mode
* @return number of icons used.
*/
public int setIcon(ByteBuffer[] icons) {
lockAWT();
try {
incDisplay();
try {
for ( ByteBuffer icon : icons ) {
int size = icon.limit() / 4;
int dimension = (int)Math.sqrt(size);
if ( dimension > 0 ) {
ByteBuffer icon_rgb = convertIcon(icon, dimension, dimension);
ByteBuffer icon_mask = convertIconMask(icon, dimension, dimension);
nSetWindowIcon(getDisplay(), getWindow(), icon_rgb, icon_rgb.capacity(), icon_mask, icon_mask.capacity(), dimension, dimension);
return 1;
}
}
return 0;
} finally {
decDisplay();
}
} catch (LWJGLException e) {
LWJGLUtil.log("Failed to set display icon: " + e);
return 0;
} finally {
unlockAWT();
}
}
示例15: getAdapter
import org.lwjgl.LWJGLUtil; //导入方法依赖的package包/类
public String getAdapter() {
try {
String maxObjNo = WindowsRegistry.queryRegistrationKey(
WindowsRegistry.HKEY_LOCAL_MACHINE,
"HARDWARE\\DeviceMap\\Video",
"MaxObjectNumber");
int maxObjectNumber = maxObjNo.charAt(0);
String vga_driver_value = "";
for(int i=0;i<maxObjectNumber;i++) {
String adapter_string = WindowsRegistry.queryRegistrationKey(
WindowsRegistry.HKEY_LOCAL_MACHINE,
"HARDWARE\\DeviceMap\\Video",
"\\Device\\Video" + i);
String root_key = "\\registry\\machine\\";
if (adapter_string.toLowerCase().startsWith(root_key)) {
String driver_value = WindowsRegistry.queryRegistrationKey(
WindowsRegistry.HKEY_LOCAL_MACHINE,
adapter_string.substring(root_key.length()),
"InstalledDisplayDrivers");
if(driver_value.toUpperCase().startsWith("VGA")) {
vga_driver_value = driver_value;
} else if(!driver_value.toUpperCase().startsWith("RDP") && !driver_value.toUpperCase().startsWith("NMNDD")) {
return driver_value;
}
}
}
if(!vga_driver_value.equals("")) {
return vga_driver_value;
}
} catch (LWJGLException e) {
LWJGLUtil.log("Exception occurred while querying registry: " + e);
}
return null;
}