moved Sys.log to LWJGLUtils and renamed property to org.lwjgl.util.Debug
This commit is contained in:
parent
c9fc024fa4
commit
ad8d7676c2
|
@ -9,7 +9,7 @@ Do not create the mouse when creating the display
|
|||
org.lwjgl.opengl.Display.nokeyboard
|
||||
Do not create the keyboard when creating the display
|
||||
|
||||
org.lwjgl.Sys.debug
|
||||
org.lwjgl.util.Debug
|
||||
Whether to output debug info
|
||||
|
||||
org.lwjgl.opengl.Display.allowSoftwareOpenGL
|
||||
|
|
|
@ -63,7 +63,7 @@ abstract class J2SESysImplementation extends DefaultSysImplementation {
|
|||
return (String)transferable.getTransferData(java.awt.datatransfer.DataFlavor.stringFlavor);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Sys.log("Exception while getting clipboard: " + e);
|
||||
LWJGLUtil.log("Exception while getting clipboard: " + e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -32,7 +32,6 @@
|
|||
package org.lwjgl;
|
||||
|
||||
import org.lwjgl.LWJGLException;
|
||||
import org.lwjgl.Sys;
|
||||
|
||||
import java.io.File;
|
||||
import java.lang.reflect.Method;
|
||||
|
@ -51,7 +50,10 @@ import java.util.StringTokenizer;
|
|||
*/
|
||||
public class LWJGLUtil {
|
||||
|
||||
/**
|
||||
/** Debug flag. */
|
||||
public static final boolean DEBUG = Boolean.getBoolean("org.lwjgl.util.Debug");
|
||||
|
||||
/**
|
||||
* Locates the paths required by a library.
|
||||
*
|
||||
* @param libNames List of library names to look for, in the form of Local Library name, Platform library name.
|
||||
|
@ -89,13 +91,13 @@ public class LWJGLUtil {
|
|||
|
||||
String classloader_path = LWJGLUtil.getPathFromClassLoader(libname, classloader);
|
||||
if (classloader_path != null) {
|
||||
Sys.log("getPathFromClassLoader: Path found: " + classloader_path);
|
||||
LWJGLUtil.log("getPathFromClassLoader: Path found: " + classloader_path);
|
||||
possible_paths.add(classloader_path);
|
||||
}
|
||||
|
||||
String lwjgl_classloader_path = LWJGLUtil.getPathFromClassLoader("lwjgl", classloader);
|
||||
if (lwjgl_classloader_path != null) {
|
||||
Sys.log("getPathFromClassLoader: Path found: " + lwjgl_classloader_path);
|
||||
LWJGLUtil.log("getPathFromClassLoader: Path found: " + lwjgl_classloader_path);
|
||||
possible_paths.add(lwjgl_classloader_path.substring(0, lwjgl_classloader_path.lastIndexOf(File.separator))
|
||||
+ File.separator + platform_lib_name);
|
||||
}
|
||||
|
@ -123,7 +125,7 @@ public class LWJGLUtil {
|
|||
*/
|
||||
public static String getPathFromClassLoader(String libname, ClassLoader classloader) {
|
||||
try {
|
||||
Sys.log("getPathFromClassLoader: searching for: " + libname);
|
||||
LWJGLUtil.log("getPathFromClassLoader: searching for: " + libname);
|
||||
Object o = classloader;
|
||||
Class c = o.getClass();
|
||||
while (c != null) {
|
||||
|
@ -137,8 +139,19 @@ public class LWJGLUtil {
|
|||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Sys.log("Failure locating " + e + " using classloader:" + e);
|
||||
LWJGLUtil.log("Failure locating " + e + " using classloader:" + e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prints the given message to System.err if DEBUG is true.
|
||||
*
|
||||
* @param msg Message to print
|
||||
*/
|
||||
public static void log(String msg) {
|
||||
if (LWJGLUtil.DEBUG) {
|
||||
System.err.println(msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -53,10 +53,7 @@ public final class Sys {
|
|||
/** The native library name */
|
||||
private static final String LIBRARY_NAME = "lwjgl";
|
||||
|
||||
/** Debug flag. */
|
||||
public static final boolean DEBUG = Boolean.getBoolean("org.lwjgl.Sys.debug");
|
||||
|
||||
/** OS Name */
|
||||
/** OS Name */
|
||||
private final static String OS_NAME = System.getProperty("os.name");
|
||||
|
||||
/** The implementation instance to delegate platform specific behavior to */
|
||||
|
@ -69,7 +66,7 @@ public final class Sys {
|
|||
if (!native_version.equals(VERSION))
|
||||
throw new LinkageError("Version mismatch: jar version is '" + VERSION +
|
||||
"', native libary version is '" + native_version + "'");
|
||||
implementation.setDebug(DEBUG);
|
||||
implementation.setDebug(LWJGLUtil.DEBUG);
|
||||
}
|
||||
|
||||
private static SysImplementation createImplementation() {
|
||||
|
@ -100,16 +97,6 @@ public final class Sys {
|
|||
private Sys() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Prints the given message to System.err if isDebugEnabled()
|
||||
* is true.
|
||||
*/
|
||||
public static void log(String msg) {
|
||||
if (Sys.DEBUG) {
|
||||
System.err.println(msg);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialization. This is just a dummy method to trigger the static constructor.
|
||||
*/
|
||||
|
|
|
@ -38,7 +38,7 @@ import java.util.ArrayList;
|
|||
import java.util.HashMap;
|
||||
import java.util.StringTokenizer;
|
||||
|
||||
import org.lwjgl.Sys;
|
||||
import org.lwjgl.LWJGLUtil;
|
||||
|
||||
/**
|
||||
* $Id$
|
||||
|
@ -276,7 +276,7 @@ public class FMOD {
|
|||
}
|
||||
|
||||
String jwsPath = getPathFromJWS(dllName);
|
||||
Sys.log("getPathFromJWS: Paths found: " + jwsPath);
|
||||
LWJGLUtil.log("getPathFromJWS: Paths found: " + jwsPath);
|
||||
if (jwsPath != null) {
|
||||
libpath += seperator
|
||||
+ jwsPath.substring(0, jwsPath.lastIndexOf(File.separator));
|
||||
|
@ -292,7 +292,7 @@ public class FMOD {
|
|||
}
|
||||
|
||||
for(int i=0 ; i<paths.length; i++) {
|
||||
Sys.log("Will search " + paths[i] + " for " + dllName);
|
||||
LWJGLUtil.log("Will search " + paths[i] + " for " + dllName);
|
||||
}
|
||||
|
||||
//add cwd path
|
||||
|
@ -329,7 +329,7 @@ public class FMOD {
|
|||
*/
|
||||
private static String getPathFromJWS(String libname) {
|
||||
try {
|
||||
Sys.log("getPathFromJWS: searching for: " + libname);
|
||||
LWJGLUtil.log("getPathFromJWS: searching for: " + libname);
|
||||
Object o = FMOD.class.getClassLoader();
|
||||
Class c = o.getClass();
|
||||
Method findLibrary =
|
||||
|
@ -338,7 +338,7 @@ public class FMOD {
|
|||
return (String) findLibrary.invoke(o, arguments);
|
||||
|
||||
} catch (Exception e) {
|
||||
Sys.log("Failure locating FMOD using classloader:" + e);
|
||||
LWJGLUtil.log("Failure locating FMOD using classloader:" + e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
@ -360,7 +360,7 @@ public class FMOD {
|
|||
|
||||
if (callbackList == null ) {
|
||||
if (callbackHandler == null) {
|
||||
Sys.log("No callbackhandlers registered for handle: " + handle);
|
||||
LWJGLUtil.log("No callbackhandlers registered for handle: " + handle);
|
||||
} else {
|
||||
callbackList = new ArrayList();
|
||||
callbacks[type].put(callbackID, callbackList);
|
||||
|
|
|
@ -38,6 +38,7 @@ import java.util.Map;
|
|||
|
||||
import org.lwjgl.BufferUtils;
|
||||
import org.lwjgl.LWJGLException;
|
||||
import org.lwjgl.LWJGLUtil;
|
||||
import org.lwjgl.Sys;
|
||||
import org.lwjgl.opengl.Display;
|
||||
|
||||
|
@ -526,7 +527,7 @@ public class Mouse {
|
|||
try {
|
||||
setNativeCursor(currentCursor);
|
||||
} catch (LWJGLException e) {
|
||||
if (Sys.DEBUG) e.printStackTrace();
|
||||
if (LWJGLUtil.DEBUG) e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -34,6 +34,7 @@ package org.lwjgl.opengl;
|
|||
import java.nio.ByteBuffer;
|
||||
|
||||
import org.lwjgl.LWJGLException;
|
||||
import org.lwjgl.LWJGLUtil;
|
||||
import org.lwjgl.Sys;
|
||||
|
||||
/**
|
||||
|
@ -198,7 +199,7 @@ final class Context {
|
|||
thread = null;
|
||||
GLContext.unloadOpenGLLibrary();
|
||||
} catch (LWJGLException e) {
|
||||
Sys.log("Exception occurred while destroying context: " + e);
|
||||
LWJGLUtil.log("Exception occurred while destroying context: " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,6 +49,7 @@ import java.util.HashSet;
|
|||
|
||||
import org.lwjgl.BufferUtils;
|
||||
import org.lwjgl.LWJGLException;
|
||||
import org.lwjgl.LWJGLUtil;
|
||||
import org.lwjgl.Sys;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
@ -96,7 +97,7 @@ public final class Display {
|
|||
display_impl = createDisplayImplementation();
|
||||
try {
|
||||
current_mode = initial_mode = display_impl.init();
|
||||
Sys.log("Initial mode: " + initial_mode);
|
||||
LWJGLUtil.log("Initial mode: " + initial_mode);
|
||||
Runtime.getRuntime().addShutdownHook(new Thread() {
|
||||
public void run() {
|
||||
reset();
|
||||
|
@ -177,7 +178,7 @@ public final class Display {
|
|||
DisplayMode[] filteredModes = new DisplayMode[modes.size()];
|
||||
modes.toArray(filteredModes);
|
||||
|
||||
Sys.log("Removed " + (unfilteredModes.length - filteredModes.length) + " duplicate displaymodes");
|
||||
LWJGLUtil.log("Removed " + (unfilteredModes.length - filteredModes.length) + " duplicate displaymodes");
|
||||
|
||||
return filteredModes;
|
||||
}
|
||||
|
@ -257,7 +258,7 @@ public final class Display {
|
|||
if (context.isCurrent())
|
||||
Context.releaseCurrentContext();
|
||||
} catch (LWJGLException e) {
|
||||
Sys.log("Exception occurred while trying to release context");
|
||||
LWJGLUtil.log("Exception occurred while trying to release context");
|
||||
}
|
||||
|
||||
if (!window_created)
|
||||
|
@ -316,7 +317,7 @@ public final class Display {
|
|||
gammaRamp.put(i, rampEntry);
|
||||
}
|
||||
display_impl.setGammaRamp(gammaRamp);
|
||||
Sys.log("Gamma set, gamma = " + gamma + ", brightness = " + brightness + ", contrast = " + contrast);
|
||||
LWJGLUtil.log("Gamma set, gamma = " + gamma + ", brightness = " + brightness + ", contrast = " + contrast);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -628,10 +629,10 @@ public final class Display {
|
|||
try {
|
||||
Mouse.create();
|
||||
} catch (LWJGLException e) {
|
||||
if (Sys.DEBUG) {
|
||||
if (LWJGLUtil.DEBUG) {
|
||||
e.printStackTrace(System.err);
|
||||
} else {
|
||||
Sys.log("Failed to create Mouse: "+e);
|
||||
LWJGLUtil.log("Failed to create Mouse: "+e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -639,10 +640,10 @@ public final class Display {
|
|||
try {
|
||||
Keyboard.create();
|
||||
} catch (LWJGLException e) {
|
||||
if (Sys.DEBUG) {
|
||||
if (LWJGLUtil.DEBUG) {
|
||||
e.printStackTrace(System.err);
|
||||
} else {
|
||||
Sys.log("Failed to create Keyboard: "+e);
|
||||
LWJGLUtil.log("Failed to create Keyboard: "+e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
package org.lwjgl.opengl;
|
||||
|
||||
import org.lwjgl.LWJGLException;
|
||||
import org.lwjgl.LWJGLUtil;
|
||||
import org.lwjgl.Sys;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
@ -169,7 +170,7 @@ public final class GLContext {
|
|||
Method init_stubs_method = extension_class.getDeclaredMethod("initNativeStubs", null);
|
||||
init_stubs_method.invoke(null, null);
|
||||
} catch (Exception e) {
|
||||
Sys.log("Failed to initialize extension " + extension_class + " - exception: " + e);
|
||||
LWJGLUtil.log("Failed to initialize extension " + extension_class + " - exception: " + e);
|
||||
supported_extensions.remove(ext_name);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@ import java.nio.ByteBuffer;
|
|||
import java.nio.FloatBuffer;
|
||||
import java.nio.IntBuffer;
|
||||
|
||||
import org.lwjgl.Sys;
|
||||
import org.lwjgl.LWJGLUtil;
|
||||
import org.lwjgl.BufferUtils;
|
||||
import org.lwjgl.LWJGLException;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
@ -383,7 +383,7 @@ final class LinuxDisplay implements DisplayImplementation {
|
|||
decDisplay();
|
||||
return caps;
|
||||
} catch (LWJGLException e) {
|
||||
Sys.log("Exception occurred in getPbufferCapabilities: " + e);
|
||||
LWJGLUtil.log("Exception occurred in getPbufferCapabilities: " + e);
|
||||
return 0;
|
||||
} finally {
|
||||
unlockAWT();
|
||||
|
|
|
@ -57,7 +57,7 @@ import java.util.StringTokenizer;
|
|||
|
||||
import org.lwjgl.LWJGLException;
|
||||
import org.lwjgl.BufferUtils;
|
||||
import org.lwjgl.Sys;
|
||||
import org.lwjgl.LWJGLUtil;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
final class MacOSXDisplay implements DisplayImplementation {
|
||||
|
@ -376,7 +376,7 @@ final class MacOSXDisplay implements DisplayImplementation {
|
|||
if (major_version > 10 || (major_version == 10 && minor_version >= 3))
|
||||
return Pbuffer.PBUFFER_SUPPORTED;
|
||||
} catch (Exception e) {
|
||||
Sys.log("Exception occurred when trying to determine OS version: " + e);
|
||||
LWJGLUtil.log("Exception occurred when trying to determine OS version: " + e);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -34,6 +34,7 @@ package org.lwjgl.opengl;
|
|||
import java.nio.ByteBuffer;
|
||||
|
||||
import org.lwjgl.LWJGLException;
|
||||
import org.lwjgl.LWJGLUtil;
|
||||
import org.lwjgl.Sys;
|
||||
|
||||
/**
|
||||
|
@ -250,7 +251,7 @@ public final class Pbuffer implements Drawable {
|
|||
peer_info.destroy();
|
||||
destroyed = true;
|
||||
} catch (LWJGLException e) {
|
||||
Sys.log("Exception occurred while destroying pbuffer: " + e);
|
||||
LWJGLUtil.log("Exception occurred while destroying pbuffer: " + e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ import java.nio.ByteBuffer;
|
|||
import java.nio.FloatBuffer;
|
||||
import java.nio.IntBuffer;
|
||||
|
||||
import org.lwjgl.Sys;
|
||||
import org.lwjgl.LWJGLUtil;
|
||||
import org.lwjgl.BufferUtils;
|
||||
import org.lwjgl.LWJGLException;
|
||||
import org.lwjgl.input.Cursor;
|
||||
|
@ -84,7 +84,7 @@ final class Win32Display implements DisplayImplementation {
|
|||
if (Display.getContext().isCurrent())
|
||||
Display.getContext().makeCurrent();
|
||||
} catch (LWJGLException e) {
|
||||
Sys.log("Exception occurred while trying to make context current: " + e);
|
||||
LWJGLUtil.log("Exception occurred while trying to make context current: " + e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -129,7 +129,7 @@ final class Win32Display implements DisplayImplementation {
|
|||
// Return the capabilities of a minimum pixel format
|
||||
return nGetPbufferCapabilities(new PixelFormat(0, 0, 0, 0, 0, 0, 0, 0, false));
|
||||
} catch (LWJGLException e) {
|
||||
Sys.log("Exception occurred while determining pbuffer capabilities: " + e);
|
||||
LWJGLUtil.log("Exception occurred while determining pbuffer capabilities: " + e);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
package org.lwjgl.test;
|
||||
|
||||
import org.lwjgl.opengl.Display;
|
||||
import org.lwjgl.LWJGLUtil;
|
||||
import org.lwjgl.Sys;
|
||||
import org.lwjgl.LWJGLException;
|
||||
|
||||
|
@ -67,8 +68,8 @@ public class SysTest {
|
|||
*/
|
||||
private void testDebug() {
|
||||
System.out.println("==== Test Debug ====");
|
||||
if (Sys.DEBUG) {
|
||||
Sys.log("Debug is enabled, you should now see output from LWJGL during the following tests.");
|
||||
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.Sys.debug=true ...");
|
||||
|
|
|
@ -35,7 +35,7 @@ import java.nio.FloatBuffer;
|
|||
import java.nio.IntBuffer;
|
||||
|
||||
import org.lwjgl.BufferUtils;
|
||||
import org.lwjgl.Sys;
|
||||
import org.lwjgl.LWJGLUtil;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import org.lwjgl.input.Mouse;
|
||||
import org.lwjgl.openal.AL;
|
||||
|
@ -145,7 +145,7 @@ public class PositionTest extends BasicTest {
|
|||
|
||||
// Setup Window
|
||||
// =====================================================
|
||||
Sys.log("Setting up window");
|
||||
LWJGLUtil.log("Setting up window");
|
||||
|
||||
// calc center
|
||||
int centerX = (Display.getDisplayMode().getWidth() - WINDOW_WIDTH) / 2;
|
||||
|
@ -158,7 +158,7 @@ public class PositionTest extends BasicTest {
|
|||
|
||||
// Setup OpenGL
|
||||
// =====================================================
|
||||
Sys.log("Setting up OpenGL");
|
||||
LWJGLUtil.log("Setting up OpenGL");
|
||||
|
||||
GL11.glViewport(0, 0, WINDOW_WIDTH, WINDOW_HEIGHT);
|
||||
GL11.glMatrixMode(GL11.GL_PROJECTION);
|
||||
|
@ -175,7 +175,7 @@ public class PositionTest extends BasicTest {
|
|||
|
||||
// Setup OpenAL
|
||||
// =====================================================
|
||||
Sys.log("Setting up OpenAL");
|
||||
LWJGLUtil.log("Setting up OpenAL");
|
||||
|
||||
AL.create();
|
||||
|
||||
|
@ -184,7 +184,7 @@ public class PositionTest extends BasicTest {
|
|||
AL10.alListener(AL10.AL_ORIENTATION, listenerOrientation);
|
||||
|
||||
// creating buffers
|
||||
Sys.log("Creating buffers");
|
||||
LWJGLUtil.log("Creating buffers");
|
||||
AL10.alGenBuffers(soundBuffers);
|
||||
soundBuffers.rewind();
|
||||
|
||||
|
@ -193,9 +193,9 @@ public class PositionTest extends BasicTest {
|
|||
soundSources.rewind();
|
||||
|
||||
// load sound files (left, center, right).wav
|
||||
Sys.log("Loading soundfiles...");
|
||||
LWJGLUtil.log("Loading soundfiles...");
|
||||
|
||||
Sys.log("Loading left.wav");
|
||||
LWJGLUtil.log("Loading left.wav");
|
||||
WaveData left = WaveData.create("left.wav");
|
||||
AL10.alBufferData(soundBuffers.get(LEFT), left.format, left.data, left.samplerate);
|
||||
AL10.alSourcef(soundSources.get(LEFT), AL10.AL_PITCH, 1.0f);
|
||||
|
@ -205,7 +205,7 @@ public class PositionTest extends BasicTest {
|
|||
AL10.alSourcei(soundSources.get(LEFT), AL10.AL_BUFFER, soundBuffers.get(LEFT));
|
||||
AL10.alSourcei(soundSources.get(LEFT), AL10.AL_LOOPING, AL10.AL_TRUE);
|
||||
|
||||
Sys.log("Loading center.wav");
|
||||
LWJGLUtil.log("Loading center.wav");
|
||||
WaveData center = WaveData.create("center.wav");
|
||||
AL10.alBufferData(soundBuffers.get(CENTER), center.format, center.data, center.samplerate);
|
||||
AL10.alSourcef(soundSources.get(CENTER), AL10.AL_PITCH, 1.0f);
|
||||
|
@ -215,7 +215,7 @@ public class PositionTest extends BasicTest {
|
|||
AL10.alSourcei(soundSources.get(CENTER), AL10.AL_BUFFER, soundBuffers.get(CENTER));
|
||||
AL10.alSourcei(soundSources.get(CENTER), AL10.AL_LOOPING, AL10.AL_TRUE);
|
||||
|
||||
Sys.log("Loading right.wav");
|
||||
LWJGLUtil.log("Loading right.wav");
|
||||
WaveData right = WaveData.create("right.wav");
|
||||
AL10.alBufferData(soundBuffers.get(RIGHT), right.format, right.data, right.samplerate);
|
||||
AL10.alSourcef(soundSources.get(RIGHT), AL10.AL_PITCH, 1.0f);
|
||||
|
@ -225,7 +225,7 @@ public class PositionTest extends BasicTest {
|
|||
AL10.alSourcei(soundSources.get(RIGHT), AL10.AL_BUFFER, soundBuffers.get(RIGHT));
|
||||
AL10.alSourcei(soundSources.get(RIGHT), AL10.AL_LOOPING, AL10.AL_TRUE);
|
||||
|
||||
Sys.log("Soundfiles loaded successfully");
|
||||
LWJGLUtil.log("Soundfiles loaded successfully");
|
||||
// -----------------------------------------------------
|
||||
|
||||
Mouse.setGrabbed(true);
|
||||
|
@ -245,16 +245,16 @@ public class PositionTest extends BasicTest {
|
|||
System.out.println("Press LEFT or RIGHT mouse button to move along z axis");
|
||||
System.out.println("Press ESC to exit demo");
|
||||
|
||||
Sys.log(
|
||||
LWJGLUtil.log(
|
||||
"Listener position: "
|
||||
+ listenerPosition.get(0)
|
||||
+ ", "
|
||||
+ listenerPosition.get(1)
|
||||
+ ", "
|
||||
+ listenerPosition.get(2));
|
||||
Sys.log("Left position: " + leftPosition.get(0) + ", " + leftPosition.get(1) + ", " + leftPosition.get(2));
|
||||
Sys.log("Center position: " + centerPosition.get(0) + ", " + centerPosition.get(1) + ", " + centerPosition.get(2));
|
||||
Sys.log("Right position: " + rightPosition.get(0) + ", " + rightPosition.get(1) + ", " + rightPosition.get(2));
|
||||
LWJGLUtil.log("Left position: " + leftPosition.get(0) + ", " + leftPosition.get(1) + ", " + leftPosition.get(2));
|
||||
LWJGLUtil.log("Center position: " + centerPosition.get(0) + ", " + centerPosition.get(1) + ", " + centerPosition.get(2));
|
||||
LWJGLUtil.log("Right position: " + rightPosition.get(0) + ", " + rightPosition.get(1) + ", " + rightPosition.get(2));
|
||||
|
||||
while (!finished) {
|
||||
// handle any input
|
||||
|
@ -333,17 +333,17 @@ public class PositionTest extends BasicTest {
|
|||
// ============================================
|
||||
if (Keyboard.isKeyDown(Keyboard.KEY_1)) {
|
||||
AL10.alSourcePlay(soundSources.get(LEFT));
|
||||
Sys.log("Playing left.wav");
|
||||
LWJGLUtil.log("Playing left.wav");
|
||||
}
|
||||
|
||||
if (Keyboard.isKeyDown(Keyboard.KEY_2)) {
|
||||
AL10.alSourcePlay(soundSources.get(CENTER));
|
||||
Sys.log("Playing center.wav");
|
||||
LWJGLUtil.log("Playing center.wav");
|
||||
}
|
||||
|
||||
if (Keyboard.isKeyDown(Keyboard.KEY_3)) {
|
||||
AL10.alSourcePlay(soundSources.get(RIGHT));
|
||||
Sys.log("Playing right.wav");
|
||||
LWJGLUtil.log("Playing right.wav");
|
||||
}
|
||||
// --------------------------------------------
|
||||
|
||||
|
@ -351,17 +351,17 @@ public class PositionTest extends BasicTest {
|
|||
// ============================================
|
||||
if (Keyboard.isKeyDown(Keyboard.KEY_4)) {
|
||||
AL10.alSourceStop(soundSources.get(LEFT));
|
||||
Sys.log("Stopped left.wav");
|
||||
LWJGLUtil.log("Stopped left.wav");
|
||||
}
|
||||
|
||||
if (Keyboard.isKeyDown(Keyboard.KEY_5)) {
|
||||
AL10.alSourceStop(soundSources.get(CENTER));
|
||||
Sys.log("Stopped center.wav");
|
||||
LWJGLUtil.log("Stopped center.wav");
|
||||
}
|
||||
|
||||
if (Keyboard.isKeyDown(Keyboard.KEY_6)) {
|
||||
AL10.alSourceStop(soundSources.get(RIGHT));
|
||||
Sys.log("Stopped right.wav");
|
||||
LWJGLUtil.log("Stopped right.wav");
|
||||
}
|
||||
// --------------------------------------------
|
||||
|
||||
|
@ -465,13 +465,13 @@ public class PositionTest extends BasicTest {
|
|||
* Shutdown of demonstration
|
||||
*/
|
||||
private void shutdown() {
|
||||
Sys.log("Shutting down OpenAL");
|
||||
LWJGLUtil.log("Shutting down OpenAL");
|
||||
AL10.alSourceStop(soundSources);
|
||||
AL10.alDeleteSources(soundSources);
|
||||
AL10.alDeleteBuffers(soundBuffers);
|
||||
AL.destroy();
|
||||
|
||||
Sys.log("Shutting down Window");
|
||||
LWJGLUtil.log("Shutting down Window");
|
||||
Display.destroy();
|
||||
}
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ import java.util.ArrayList;
|
|||
import java.util.Arrays;
|
||||
import java.util.Comparator;
|
||||
|
||||
import org.lwjgl.Sys;
|
||||
import org.lwjgl.LWJGLUtil;
|
||||
import org.lwjgl.LWJGLException;
|
||||
import org.lwjgl.opengl.DisplayMode;
|
||||
|
||||
|
@ -71,7 +71,7 @@ public final class Display {
|
|||
// First get the available display modes
|
||||
DisplayMode[] modes = org.lwjgl.opengl.Display.getAvailableDisplayModes();
|
||||
|
||||
if (Sys.DEBUG || DEBUG) {
|
||||
if (LWJGLUtil.DEBUG || DEBUG) {
|
||||
System.out.println("Available screen modes:");
|
||||
for (int i = 0; i < modes.length; i ++) {
|
||||
System.out.println(modes[i]);
|
||||
|
@ -107,7 +107,7 @@ public final class Display {
|
|||
|
||||
DisplayMode[] ret = new DisplayMode[matches.size()];
|
||||
matches.toArray(ret);
|
||||
if (Sys.DEBUG && DEBUG) {
|
||||
if (LWJGLUtil.DEBUG && DEBUG) {
|
||||
System.out.println("Filtered screen modes:");
|
||||
for (int i = 0; i < ret.length; i ++) {
|
||||
System.out.println(ret[i]);
|
||||
|
@ -210,7 +210,7 @@ public final class Display {
|
|||
Arrays.sort(dm, new Sorter());
|
||||
|
||||
// Try them out in the appropriate order
|
||||
if (Sys.DEBUG || DEBUG) {
|
||||
if (LWJGLUtil.DEBUG || DEBUG) {
|
||||
System.out.println("Sorted display modes:");
|
||||
for (int i = 0; i < dm.length; i ++) {
|
||||
System.out.println(dm[i]);
|
||||
|
@ -218,12 +218,12 @@ public final class Display {
|
|||
}
|
||||
for (int i = 0; i < dm.length; i ++) {
|
||||
try {
|
||||
if (Sys.DEBUG || DEBUG)
|
||||
if (LWJGLUtil.DEBUG || DEBUG)
|
||||
System.out.println("Attempting to set displaymode: "+dm[i]);
|
||||
org.lwjgl.opengl.Display.setDisplayMode(dm[i]);
|
||||
return dm[i];
|
||||
} catch (Exception e) {
|
||||
if (Sys.DEBUG || DEBUG) {
|
||||
if (LWJGLUtil.DEBUG || DEBUG) {
|
||||
System.out.println("Failed to set display mode to "+dm[i]);
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
|
|
@ -94,7 +94,7 @@ public class WaveData {
|
|||
AudioSystem.getAudioInputStream(
|
||||
new BufferedInputStream(WaveData.class.getClassLoader().getResourceAsStream(filepath))));
|
||||
} catch (Exception e) {
|
||||
org.lwjgl.Sys.log("Unable to load file: " + filepath);
|
||||
org.lwjgl.LWJGLUtil.log("Unable to load file: " + filepath);
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -82,7 +82,7 @@ void printfDebugJava(JNIEnv *env, const char *format, ...) {
|
|||
#define BUFFER_SIZE 4000
|
||||
static char buffer[BUFFER_SIZE];
|
||||
jstring str;
|
||||
jclass org_lwjgl_Sys_class;
|
||||
jclass org_lwjgl_LWJGLUtil_class;
|
||||
jmethodID log_method;
|
||||
va_list ap;
|
||||
va_start(ap, format);
|
||||
|
@ -94,9 +94,9 @@ void printfDebugJava(JNIEnv *env, const char *format, ...) {
|
|||
#endif
|
||||
buffer[BUFFER_SIZE - 1] = '\0';
|
||||
str = (*env)->NewStringUTF(env, buffer);
|
||||
org_lwjgl_Sys_class = (*env)->FindClass(env, "org/lwjgl/Sys");
|
||||
log_method = (*env)->GetStaticMethodID(env, org_lwjgl_Sys_class, "log", "(Ljava/lang/String;)V");
|
||||
(*env)->CallStaticVoidMethod(env, org_lwjgl_Sys_class, log_method, str);
|
||||
org_lwjgl_LWJGLUtil_class = (*env)->FindClass(env, "org/lwjgl/LWJGLUtil");
|
||||
log_method = (*env)->GetStaticMethodID(env, org_lwjgl_LWJGLUtil_class, "log", "(Ljava/lang/String;)V");
|
||||
(*env)->CallStaticVoidMethod(env, org_lwjgl_LWJGLUtil_class, log_method, str);
|
||||
}
|
||||
va_end(ap);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue