You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(134) |
Sep
(52) |
Oct
(13) |
Nov
(342) |
Dec
(163) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(44) |
Feb
(62) |
Mar
(158) |
Apr
(38) |
May
(70) |
Jun
(58) |
Jul
(104) |
Aug
(207) |
Sep
(83) |
Oct
(122) |
Nov
(23) |
Dec
(49) |
| 2004 |
Jan
(119) |
Feb
(132) |
Mar
(192) |
Apr
(140) |
May
(77) |
Jun
(74) |
Jul
(201) |
Aug
(63) |
Sep
(102) |
Oct
(70) |
Nov
(173) |
Dec
(78) |
| 2005 |
Jan
(174) |
Feb
(197) |
Mar
(105) |
Apr
(59) |
May
(77) |
Jun
(43) |
Jul
(21) |
Aug
(18) |
Sep
(47) |
Oct
(37) |
Nov
(74) |
Dec
(50) |
| 2006 |
Jan
(44) |
Feb
(19) |
Mar
(32) |
Apr
(24) |
May
(31) |
Jun
(55) |
Jul
(138) |
Aug
(28) |
Sep
(12) |
Oct
(41) |
Nov
(58) |
Dec
(24) |
| 2007 |
Jan
(28) |
Feb
(14) |
Mar
(10) |
Apr
(68) |
May
(30) |
Jun
(26) |
Jul
(18) |
Aug
(63) |
Sep
(19) |
Oct
(29) |
Nov
(20) |
Dec
(10) |
| 2008 |
Jan
(38) |
Feb
(7) |
Mar
(37) |
Apr
(120) |
May
(41) |
Jun
(36) |
Jul
(39) |
Aug
(24) |
Sep
(28) |
Oct
(30) |
Nov
(36) |
Dec
(75) |
| 2009 |
Jan
(46) |
Feb
(22) |
Mar
(50) |
Apr
(70) |
May
(134) |
Jun
(105) |
Jul
(75) |
Aug
(34) |
Sep
(38) |
Oct
(34) |
Nov
(19) |
Dec
(20) |
| 2010 |
Jan
(11) |
Feb
(20) |
Mar
(65) |
Apr
(83) |
May
(104) |
Jun
(73) |
Jul
(78) |
Aug
(57) |
Sep
(43) |
Oct
(35) |
Nov
(9) |
Dec
(4) |
| 2011 |
Jan
(21) |
Feb
(11) |
Mar
(18) |
Apr
(10) |
May
(18) |
Jun
(15) |
Jul
(48) |
Aug
(25) |
Sep
(17) |
Oct
(45) |
Nov
(15) |
Dec
(12) |
| 2012 |
Jan
(21) |
Feb
(9) |
Mar
(12) |
Apr
(9) |
May
(9) |
Jun
(5) |
Jul
(1) |
Aug
(10) |
Sep
(12) |
Oct
(1) |
Nov
(28) |
Dec
(5) |
| 2013 |
Jan
(4) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2014 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
| 2015 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
| 2016 |
Jan
(2) |
Feb
(1) |
Mar
(1) |
Apr
(1) |
May
(2) |
Jun
|
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
1
|
2
|
3
(2) |
4
(15) |
5
(5) |
6
(2) |
7
|
|
8
|
9
|
10
(1) |
11
(1) |
12
(8) |
13
|
14
|
|
15
|
16
|
17
(2) |
18
(12) |
19
(6) |
20
|
21
|
|
22
(13) |
23
|
24
|
25
|
26
|
27
(2) |
28
(1) |
|
29
(4) |
30
(3) |
31
|
|
|
|
|
|
From: Elias N. <eli...@us...> - 2005-05-30 16:21:16
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10617/src/java/org/lwjgl/opengl Modified Files: Display.java GLContext.java LinuxCanvasImplementation.java MacOSXDisplay.java MacOSXFrame.java Log Message: Added AccessController.doPrivileged where needed Index: LinuxCanvasImplementation.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/LinuxCanvasImplementation.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- LinuxCanvasImplementation.java 27 May 2005 11:50:12 -0000 1.7 +++ LinuxCanvasImplementation.java 30 May 2005 16:21:04 -0000 1.8 @@ -35,6 +35,9 @@ import java.awt.GraphicsDevice; import java.lang.reflect.Method; +import java.security.AccessController; +import java.security.PrivilegedExceptionAction; + import org.lwjgl.LWJGLException; import org.lwjgl.LWJGLUtil; @@ -45,9 +48,13 @@ * @version $Revision$ */ final class LinuxCanvasImplementation implements AWTCanvasImplementation { - static int getScreenFromDevice(GraphicsDevice device) throws LWJGLException { + static int getScreenFromDevice(final GraphicsDevice device) throws LWJGLException { try { - Method getScreen_method = device.getClass().getMethod("getScreen", null); + Method getScreen_method = (Method)AccessController.doPrivileged(new PrivilegedExceptionAction() { + public Object run() throws Exception { + return device.getClass().getMethod("getScreen", null); + } + }); Integer screen = (Integer)getScreen_method.invoke(device, null); return screen.intValue(); } catch (Exception e) { @@ -55,9 +62,13 @@ } } - private static int getVisualIDFromConfiguration(GraphicsConfiguration configuration) throws LWJGLException { + private static int getVisualIDFromConfiguration(final GraphicsConfiguration configuration) throws LWJGLException { try { - Method getVisual_method = configuration.getClass().getMethod("getVisual", null); + Method getVisual_method = (Method)AccessController.doPrivileged(new PrivilegedExceptionAction() { + public Object run() throws Exception { + return configuration.getClass().getMethod("getVisual", null); + } + }); Integer visual = (Integer)getVisual_method.invoke(configuration, null); return visual.intValue(); } catch (Exception e) { Index: MacOSXFrame.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/MacOSXFrame.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- MacOSXFrame.java 18 Apr 2005 06:47:41 -0000 1.12 +++ MacOSXFrame.java 30 May 2005 16:21:04 -0000 1.13 @@ -48,6 +48,10 @@ import java.awt.event.WindowEvent; import java.awt.event.WindowListener; +import java.security.AccessController; +import java.security.PrivilegedExceptionAction; +import java.security.PrivilegedActionException; + import org.lwjgl.LWJGLException; final class MacOSXFrame extends Frame implements WindowListener, ComponentListener { @@ -62,25 +66,34 @@ private boolean minimized; private boolean should_warp_cursor; - MacOSXFrame(DisplayMode mode, java.awt.DisplayMode requested_mode, boolean fullscreen, int x, int y) throws LWJGLException { + MacOSXFrame(DisplayMode mode, final java.awt.DisplayMode requested_mode, boolean fullscreen, int x, int y) throws LWJGLException { setResizable(false); addWindowListener(this); addComponentListener(this); canvas = new MacOSXGLCanvas(); add(canvas, BorderLayout.CENTER); - boolean undecorated = Boolean.getBoolean("org.lwjgl.opengl.Window.undecorated"); + boolean undecorated = Display.getPrivilegedBoolean("org.lwjgl.opengl.Window.undecorated"); setUndecorated(fullscreen || undecorated); if ( fullscreen ) { - getDevice().setFullScreenWindow(this); - getDevice().setDisplayMode(requested_mode); - java.awt.DisplayMode real_mode = getDevice().getDisplayMode(); - /** For some strange reason, the display mode is sometimes silently capped even though the mode is reported as supported */ - if ( requested_mode.getWidth() != real_mode.getWidth() || requested_mode.getHeight() != real_mode.getHeight() ) { - getDevice().setFullScreenWindow(null); - if (isDisplayable()) - dispose(); - throw new LWJGLException("AWT capped mode: requested mode = " + requested_mode.getWidth() + "x" + requested_mode.getHeight() + - " but got " + real_mode.getWidth() + " " + real_mode.getHeight()); + try { + AccessController.doPrivileged(new PrivilegedExceptionAction() { + public Object run() throws Exception { + getDevice().setFullScreenWindow(MacOSXFrame.this); + getDevice().setDisplayMode(requested_mode); + java.awt.DisplayMode real_mode = getDevice().getDisplayMode(); + /** For some strange reason, the display mode is sometimes silently capped even though the mode is reported as supported */ + if ( requested_mode.getWidth() != real_mode.getWidth() || requested_mode.getHeight() != real_mode.getHeight() ) { + getDevice().setFullScreenWindow(null); + if (isDisplayable()) + dispose(); + throw new LWJGLException("AWT capped mode: requested mode = " + requested_mode.getWidth() + "x" + requested_mode.getHeight() + + " but got " + real_mode.getWidth() + " " + real_mode.getHeight()); + } + return null; + } + }); + } catch (PrivilegedActionException e) { + throw new LWJGLException(e); } } pack(); Index: MacOSXDisplay.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/MacOSXDisplay.java,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- MacOSXDisplay.java 5 May 2005 11:04:17 -0000 1.31 +++ MacOSXDisplay.java 30 May 2005 16:21:04 -0000 1.32 @@ -57,6 +57,11 @@ import java.util.List; import java.util.StringTokenizer; +import java.security.AccessController; +import java.security.PrivilegedAction; +import java.security.PrivilegedExceptionAction; +import java.security.PrivilegedActionException; + import org.lwjgl.LWJGLException; import org.lwjgl.LWJGLUtil; import org.lwjgl.input.Keyboard; @@ -96,9 +101,13 @@ public void destroyWindow() { if (frame != null) { - if (MacOSXFrame.getDevice().getFullScreenWindow() == frame) - MacOSXFrame.getDevice().setFullScreenWindow(null); -// setView(null); + AccessController.doPrivileged(new PrivilegedAction() { + public Object run() { + if (MacOSXFrame.getDevice().getFullScreenWindow() == frame) + MacOSXFrame.getDevice().setFullScreenWindow(null); + return null; + } + }); if (frame.isDisplayable()) frame.dispose(); frame = null; @@ -450,26 +459,24 @@ public MacOSXApplicationListener() { try { - /* Get the com.apple.eawt.Application class */ - Class com_apple_eawt_Application = Class.forName("com.apple.eawt.Application"); - /* Call the static Application.getApplication() method */ - Object application = com_apple_eawt_Application.getMethod("getApplication", null).invoke(null, null); - /* Create a proxy implementing com.apple.eawt.ApplicationListener */ - Class com_apple_eawt_ApplicationListener = Class.forName("com.apple.eawt.ApplicationListener"); - Object listener_proxy = Proxy.newProxyInstance(getClass().getClassLoader(), new Class[] {com_apple_eawt_ApplicationListener}, this); - /* Invoke the method application.addApplicationListener(proxy) */ - Method addApplicationListener = com_apple_eawt_Application.getMethod("addApplicationListener", new Class[]{com_apple_eawt_ApplicationListener}); - addApplicationListener.invoke(application, new Object[]{listener_proxy}); - /* Finally, get the handleQuit method we want to react to */ - Class com_apple_eawt_ApplicationEvent = Class.forName("com.apple.eawt.ApplicationEvent"); - handleQuit = com_apple_eawt_ApplicationListener.getMethod("handleQuit", new Class[]{com_apple_eawt_ApplicationEvent}); - } catch (InvocationTargetException e) { - throw new RuntimeException(e); - } catch (NoSuchMethodException e) { - throw new RuntimeException(e); - } catch (ClassNotFoundException e) { - throw new RuntimeException(e); - } catch (IllegalAccessException e) { + handleQuit = (Method)AccessController.doPrivileged(new PrivilegedExceptionAction() { + public Object run() throws Exception { + /* Get the com.apple.eawt.Application class */ + Class com_apple_eawt_Application = Class.forName("com.apple.eawt.Application"); + /* Call the static Application.getApplication() method */ + Object application = com_apple_eawt_Application.getMethod("getApplication", null).invoke(null, null); + /* Create a proxy implementing com.apple.eawt.ApplicationListener */ + Class com_apple_eawt_ApplicationListener = Class.forName("com.apple.eawt.ApplicationListener"); + Object listener_proxy = Proxy.newProxyInstance(getClass().getClassLoader(), new Class[] {com_apple_eawt_ApplicationListener}, MacOSXApplicationListener.this); + /* Invoke the method application.addApplicationListener(proxy) */ + Method addApplicationListener = com_apple_eawt_Application.getMethod("addApplicationListener", new Class[]{com_apple_eawt_ApplicationListener}); + addApplicationListener.invoke(application, new Object[]{listener_proxy}); + /* Finally, get the handleQuit method we want to react to */ + Class com_apple_eawt_ApplicationEvent = Class.forName("com.apple.eawt.ApplicationEvent"); + return com_apple_eawt_ApplicationListener.getMethod("handleQuit", new Class[]{com_apple_eawt_ApplicationEvent}); + } + }); + } catch (PrivilegedActionException e) { throw new RuntimeException(e); } } Index: Display.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/Display.java,v retrieving revision 1.50 retrieving revision 1.51 diff -u -d -r1.50 -r1.51 --- Display.java 6 May 2005 09:40:36 -0000 1.50 +++ Display.java 30 May 2005 16:21:04 -0000 1.51 @@ -47,6 +47,9 @@ import java.util.Arrays; import java.util.HashSet; +import java.security.AccessController; +import java.security.PrivilegedAction; + import org.lwjgl.BufferUtils; import org.lwjgl.LWJGLException; import org.lwjgl.LWJGLUtil; @@ -98,9 +101,14 @@ try { current_mode = initial_mode = display_impl.init(); LWJGLUtil.log("Initial mode: " + initial_mode); - Runtime.getRuntime().addShutdownHook(new Thread() { - public void run() { - reset(); + AccessController.doPrivileged(new PrivilegedAction() { + public Object run() { + Runtime.getRuntime().addShutdownHook(new Thread() { + public void run() { + reset(); + } + }); + return null; } }); } catch (LWJGLException e) { @@ -656,10 +664,22 @@ return display_impl; } + /** + * Gets a boolean property as a privileged action. + */ + static boolean getPrivilegedBoolean(final String property_name) { + Boolean value = (Boolean)AccessController.doPrivileged(new PrivilegedAction() { + public Object run() { + return new Boolean(Boolean.getBoolean(property_name)); + } + }); + return value.booleanValue(); + } + private static void initControls() { // Automatically create mouse, keyboard and controller - if (!Boolean.getBoolean("org.lwjgl.opengl.Display.noinput")) { - if (!Mouse.isCreated() && !Boolean.getBoolean("org.lwjgl.opengl.Display.nomouse")) { + if (!getPrivilegedBoolean("org.lwjgl.opengl.Display.noinput")) { + if (!Mouse.isCreated() && !getPrivilegedBoolean("org.lwjgl.opengl.Display.nomouse")) { try { Mouse.create(); } catch (LWJGLException e) { @@ -670,7 +690,7 @@ } } } - if (!Keyboard.isCreated() && !Boolean.getBoolean("org.lwjgl.opengl.Display.nokeyboard")) { + if (!Keyboard.isCreated() && !getPrivilegedBoolean("org.lwjgl.opengl.Display.nokeyboard")) { try { Keyboard.create(); } catch (LWJGLException e) { Index: GLContext.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/GLContext.java,v retrieving revision 1.50 retrieving revision 1.51 diff -u -d -r1.50 -r1.51 --- GLContext.java 4 May 2005 20:59:36 -0000 1.50 +++ GLContext.java 30 May 2005 16:21:04 -0000 1.51 @@ -38,6 +38,11 @@ import java.util.StringTokenizer; import java.util.WeakHashMap; +import java.security.AccessController; +import java.security.PrivilegedAction; +import java.security.PrivilegedActionException; +import java.security.PrivilegedExceptionAction; + import org.lwjgl.LWJGLException; import org.lwjgl.LWJGLUtil; import org.lwjgl.Sys; @@ -93,7 +98,11 @@ * with a name dependent on the current platform */ static long getPlatformSpecificFunctionAddress(String function_prefix, String[] os_prefixes, String[] os_function_prefixes, String function) { - String os_name = System.getProperty("os.name"); + String os_name = (String)AccessController.doPrivileged(new PrivilegedAction() { + public Object run() { + return System.getProperty("os.name"); + } + }); for (int i = 0; i < os_prefixes.length; i++) if (os_name.startsWith(os_prefixes[i])) { String platform_function_name = function.replaceFirst(function_prefix, os_function_prefixes[i]); @@ -167,12 +176,17 @@ * Helper method to ContextCapabilities. It will try to initialize the native stubs, * and remove the given extension name from the extension set if the initialization fails. */ - static void initNativeStubs(Class extension_class, Set supported_extensions, String ext_name) { + static void initNativeStubs(final Class extension_class, Set supported_extensions, String ext_name) { resetNativeStubs(extension_class); if (supported_extensions.contains(ext_name)) { try { - Method init_stubs_method = extension_class.getDeclaredMethod("initNativeStubs", null); - init_stubs_method.invoke(null, null); + AccessController.doPrivileged(new PrivilegedExceptionAction() { + public Object run() throws Exception { + Method init_stubs_method = extension_class.getDeclaredMethod("initNativeStubs", null); + init_stubs_method.invoke(null, null); + return null; + } + }); } catch (Exception e) { LWJGLUtil.log("Failed to initialize extension " + extension_class + " - exception: " + e); supported_extensions.remove(ext_name); |
|
From: Elias N. <eli...@us...> - 2005-05-30 16:21:14
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10617/src/native/common Modified Files: common_tools.c Log Message: Added AccessController.doPrivileged where needed Index: common_tools.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/common_tools.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- common_tools.c 18 May 2005 21:02:41 -0000 1.24 +++ common_tools.c 30 May 2005 16:21:05 -0000 1.25 @@ -314,9 +314,9 @@ bool getBooleanProperty(JNIEnv *env, const char* propertyName) { jstring property = NewStringNative(env, propertyName); - jclass booleanClass = (*env)->FindClass(env, "java/lang/Boolean"); - jmethodID getBoolean = (*env)->GetStaticMethodID(env, booleanClass, "getBoolean", "(Ljava/lang/String;)Z"); - return (*env)->CallStaticBooleanMethod(env, booleanClass, getBoolean, property) ? true : false; + jclass org_lwjgl_LWJGLUtil_class = (*env)->FindClass(env, "org/lwjgl/LWJGLUtil"); + jmethodID getBoolean = (*env)->GetStaticMethodID(env, org_lwjgl_LWJGLUtil_class, "getPrivilegedBoolean", "(Ljava/lang/String;)Z"); + return (*env)->CallStaticBooleanMethod(env, org_lwjgl_LWJGLUtil_class, getBoolean, property) ? true : false; } JavaVM *getJVM() { |
|
From: Elias N. <eli...@us...> - 2005-05-30 16:21:13
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10617/src/java/org/lwjgl Modified Files: LWJGLUtil.java LinuxSysImplementation.java MacOSXSysImplementation.java Sys.java Log Message: Added AccessController.doPrivileged where needed Index: LinuxSysImplementation.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/LinuxSysImplementation.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- LinuxSysImplementation.java 23 Feb 2005 11:22:14 -0000 1.4 +++ LinuxSysImplementation.java 30 May 2005 16:21:03 -0000 1.5 @@ -33,6 +33,10 @@ import java.io.IOException; +import java.security.AccessController; +import java.security.PrivilegedExceptionAction; +import java.security.PrivilegedActionException; + /** * $Id$ * @@ -44,17 +48,23 @@ java.awt.Toolkit.getDefaultToolkit(); // This will make sure libjawt.so is loaded } - public boolean openURL(String url) { + public boolean openURL(final String url) { // Linux may as well resort to pure Java hackery, as there's no Linux native way of doing it // right anyway. String[] browsers = {"firefox", "mozilla", "opera", "konqueror", "nautilus", "galeon", "netscape"}; for (int i = 0; i < browsers.length; i ++) { + final String browser = browsers[i]; try { - Runtime.getRuntime().exec(new String[] { browsers[i], url }); + AccessController.doPrivileged(new PrivilegedExceptionAction() { + public Object run() throws Exception { + Runtime.getRuntime().exec(new String[] { browser, url }); + return null; + } + }); return true; - } catch (IOException e) { + } catch (PrivilegedActionException e) { // Ignore e.printStackTrace(System.err); } Index: MacOSXSysImplementation.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/MacOSXSysImplementation.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- MacOSXSysImplementation.java 20 Jan 2005 22:51:26 -0000 1.2 +++ MacOSXSysImplementation.java 30 May 2005 16:21:03 -0000 1.3 @@ -33,6 +33,9 @@ import java.lang.reflect.Method; +import java.security.AccessController; +import java.security.PrivilegedExceptionAction; + /** * $Id$ * @@ -42,11 +45,21 @@ class MacOSXSysImplementation extends J2SESysImplementation { public boolean openURL(String url) { try { - Class com_apple_eio_FileManager = Class.forName("com.apple.eio.FileManager"); - Method openURL_method = com_apple_eio_FileManager.getMethod("openURL", new Class[]{String.class}); + Method openURL_method = (Method)AccessController.doPrivileged(new PrivilegedExceptionAction() { + public Object run() throws Exception { + try { + Class com_apple_eio_FileManager = Class.forName("com.apple.eio.FileManager"); + return com_apple_eio_FileManager.getMethod("openURL", new Class[]{String.class}); + } catch (Exception e) { + LWJGLUtil.log("Exception occurred while trying to invoke browser: " + e); + return null; + } + } + }); openURL_method.invoke(null, new Object[]{url}); return true; } catch (Exception e) { + LWJGLUtil.log("Exception occurred while trying to invoke browser: " + e); return false; } } Index: LWJGLUtil.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/LWJGLUtil.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- LWJGLUtil.java 12 May 2005 07:47:06 -0000 1.5 +++ LWJGLUtil.java 30 May 2005 16:21:03 -0000 1.6 @@ -37,6 +37,11 @@ import java.util.List; import java.util.StringTokenizer; +import java.security.AccessController; +import java.security.PrivilegedAction; +import java.security.PrivilegedActionException; +import java.security.PrivilegedExceptionAction; + /** * $Id$ * <p> @@ -52,8 +57,8 @@ public static final int PLATFORM_WINDOWS = 3; /** Debug flag. */ - public static final boolean DEBUG = Boolean.getBoolean("org.lwjgl.util.Debug"); - + public static final boolean DEBUG = getPrivilegedBoolean("org.lwjgl.util.Debug"); + /** * Get the current platform */ @@ -102,15 +107,15 @@ throw new LWJGLException("Unknown platform: " + getPlatform()); } - String classloader_path = LWJGLUtil.getPathFromClassLoader(libname, classloader); + String classloader_path = getPathFromClassLoader(libname, classloader); if (classloader_path != null) { - LWJGLUtil.log("getPathFromClassLoader: Path found: " + classloader_path); + log("getPathFromClassLoader: Path found: " + classloader_path); possible_paths.add(classloader_path); } - String lwjgl_classloader_path = LWJGLUtil.getPathFromClassLoader("lwjgl", classloader); + String lwjgl_classloader_path = getPathFromClassLoader("lwjgl", classloader); if (lwjgl_classloader_path != null) { - LWJGLUtil.log("getPathFromClassLoader: Path found: " + lwjgl_classloader_path); + 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); } @@ -119,7 +124,12 @@ possible_paths.add(platform_lib_name); // Add all possible paths from java.library.path - StringTokenizer st = new StringTokenizer(System.getProperty("java.library.path"), File.pathSeparator); + String java_library_path = (String)AccessController.doPrivileged(new PrivilegedAction() { + public Object run() { + return System.getProperty("java.library.path"); + } + }); + StringTokenizer st = new StringTokenizer(java_library_path, File.pathSeparator); while (st.hasMoreTokens()) { String path = st.nextToken(); possible_paths.add(path + File.separator + platform_lib_name); @@ -145,32 +155,51 @@ */ public static String getPathFromClassLoader(String libname, ClassLoader classloader) { try { - LWJGLUtil.log("getPathFromClassLoader: searching for: " + libname); + log("getPathFromClassLoader: searching for: " + libname); Object o = classloader; Class c = o.getClass(); while (c != null) { + final Class clazz = c; try { - Method findLibrary = c.getDeclaredMethod("findLibrary", new Class[] { String.class}); - findLibrary.setAccessible(true); + Method findLibrary = (Method)AccessController.doPrivileged(new PrivilegedExceptionAction() { + public Object run() throws Exception { + Method m = clazz.getDeclaredMethod("findLibrary", new Class[]{String.class}); + m.setAccessible(true); + return m; + } + }); Object[] arguments = new Object[] {libname}; - return (String) findLibrary.invoke(o, arguments); - } catch (NoSuchMethodException e) { + return (String)findLibrary.invoke(o, arguments); + } catch (PrivilegedActionException e) { c = c.getSuperclass(); } } } catch (Exception e) { - LWJGLUtil.log("Failure locating " + e + " using classloader:" + e); + log("Failure locating " + e + " using classloader:" + e); } return null; } /** + * Gets a boolean property as a privileged action. Helper method + * for native. + */ + private static boolean getPrivilegedBoolean(final String property_name) { + Boolean value = (Boolean)AccessController.doPrivileged(new PrivilegedAction() { + public Object run() { + return new Boolean(Boolean.getBoolean(property_name)); + } + }); + return value.booleanValue(); + } + + /** * 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) { + if (DEBUG) { System.err.println(msg); } } Index: Sys.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/Sys.java,v retrieving revision 1.86 retrieving revision 1.87 diff -u -d -r1.86 -r1.87 --- Sys.java 18 May 2005 21:01:15 -0000 1.86 +++ Sys.java 30 May 2005 16:21:03 -0000 1.87 @@ -37,6 +37,10 @@ import org.lwjgl.input.Mouse; +import java.security.AccessController; +import java.security.PrivilegedAction; +import java.security.PrivilegedExceptionAction; + /** * $Id$ * <p> @@ -58,7 +62,12 @@ static { implementation = createImplementation(); - System.loadLibrary(LIBRARY_NAME); + AccessController.doPrivileged(new PrivilegedAction() { + public Object run() { + System.loadLibrary(LIBRARY_NAME); + return null; + } + }); String native_version = implementation.getNativeLibraryVersion(); if (!native_version.equals(VERSION)) throw new LinkageError("Version mismatch: jar version is '" + VERSION + @@ -176,11 +185,19 @@ // Attempt to use Webstart if we have it available try { // Lookup the javax.jnlp.BasicService object - Class serviceManagerClass = Class.forName("javax.jnlp.ServiceManager"); - Method lookupMethod = serviceManagerClass.getMethod("lookup", new Class[] {String.class}); + final Class serviceManagerClass = Class.forName("javax.jnlp.ServiceManager"); + Method lookupMethod = (Method)AccessController.doPrivileged(new PrivilegedExceptionAction() { + public Object run() throws Exception { + return serviceManagerClass.getMethod("lookup", new Class[] {String.class}); + } + }); Object basicService = lookupMethod.invoke(serviceManagerClass, new Object[] {"javax.jnlp.BasicService"}); - Class basicServiceClass = Class.forName("javax.jnlp.BasicService"); - Method showDocumentMethod = basicServiceClass.getMethod("showDocument", new Class[] {URL.class}); + final Class basicServiceClass = Class.forName("javax.jnlp.BasicService"); + Method showDocumentMethod = (Method)AccessController.doPrivileged(new PrivilegedExceptionAction() { + public Object run() throws Exception { + return basicServiceClass.getMethod("showDocument", new Class[] {URL.class}); + } + }); try { Boolean ret = (Boolean) showDocumentMethod.invoke(basicService, new Object[] {new URL(url)}); return ret.booleanValue(); |
|
From: Brian M. <ma...@us...> - 2005-05-29 22:17:06
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/devil In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11733/src/java/org/lwjgl/devil Modified Files: IL.java Log Message: javadoc Index: IL.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/devil/IL.java,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- IL.java 29 May 2005 22:14:32 -0000 1.18 +++ IL.java 29 May 2005 22:16:56 -0000 1.19 @@ -441,6 +441,12 @@ public static native boolean ilSaveData(String FileName); + /** + * Determines the IL type for file passed + * + * @param filename File to determine type for + * @return IL type, or IL_TYPE_UNKNOWN if undeterminable + */ public static int getILType(String filename) { int index = filename.lastIndexOf('.'); if (index != -1) { |
|
From: Brian M. <ma...@us...> - 2005-05-29 22:14:40
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/devil In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10157/src/java/org/lwjgl/devil Modified Files: IL.java Log Message: added getILType(filename) Index: IL.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/devil/IL.java,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- IL.java 22 May 2005 11:09:02 -0000 1.17 +++ IL.java 29 May 2005 22:14:32 -0000 1.18 @@ -440,63 +440,69 @@ int Depth, byte Bpp); public static native boolean ilSaveData(String FileName); - - /** - * Loads an image from the specified url - * - * @param url URL to load from - * @return true if image was loaded - */ - public static boolean ilLoadFromURL(URL url) { - boolean result = false; - int type = IL_TYPE_UNKNOWN; - - String file = url.toString(); - int index = file.lastIndexOf('.'); + + public static int getILType(String filename) { + int index = filename.lastIndexOf('.'); if (index != -1) { - String extension = file.substring(index + 1); + String extension = filename.substring(index + 1); if (extension.equalsIgnoreCase("bmp")) { - type = IL_BMP; + return IL_BMP; } else if (extension.equalsIgnoreCase("cut")) { - type = IL_CUT; + return IL_CUT; } else if (extension.equalsIgnoreCase("gif")) { - type = IL_GIF; + return IL_GIF; } else if (extension.equalsIgnoreCase("ico")) { - type = IL_ICO; - } else if (extension.equalsIgnoreCase("jpg")) { - type = IL_JPG; + return IL_ICO; + } else if (extension.equalsIgnoreCase("jpg") + || extension.equalsIgnoreCase("jpeg") + || extension.equalsIgnoreCase("jpe")) { + return IL.IL_JPG; } else if (extension.equalsIgnoreCase("lif")) { - type = IL_LIF; + return IL_LIF; } else if (extension.equalsIgnoreCase("mng")) { - type = IL_MNG; + return IL_MNG; } else if (extension.equalsIgnoreCase("pcd")) { - type = IL_PCD; + return IL_PCD; } else if (extension.equalsIgnoreCase("pcx")) { - type = IL_PCX; + return IL_PCX; } else if (extension.equalsIgnoreCase("pic")) { - type = IL_PIC; + return IL_PIC; } else if (extension.equalsIgnoreCase("png")) { - type = IL_PNG; + return IL_PNG; } else if (extension.equalsIgnoreCase("pbm") || extension.equalsIgnoreCase("pgm") || extension.equalsIgnoreCase("ppm")) { - type = IL_PNM; + return IL_PNM; } else if (extension.equalsIgnoreCase("psd")) { - type = IL_PSD; + return IL_PSD; } else if (extension.equalsIgnoreCase("psp")) { - type = IL_PSP; + return IL_PSP; } else if (extension.equalsIgnoreCase("bw") || extension.equalsIgnoreCase("rgb") || extension.equalsIgnoreCase("rgba") || extension.equalsIgnoreCase("sgi")) { - type = IL_SGI; + return IL_SGI; } else if (extension.equalsIgnoreCase("tga")) { - type = IL_TGA; + return IL_TGA; } else if (extension.equalsIgnoreCase("tif") || extension.equalsIgnoreCase("tiff")) { - type = IL_TIF; + return IL_TIF; } } + return IL_TYPE_UNKNOWN; + } + + + /** + * Loads an image from the specified url + * + * @param url URL to load from + * @return true if image was loaded + */ + public static boolean ilLoadFromURL(URL url) { + boolean result = false; + + String file = url.toString(); // read stream try { - result = ilLoadFromStream(url.openStream(), type); + result = ilLoadFromStream(url.openStream(), getILType(file)); } catch (IOException e) { e.printStackTrace(); result = false; |
|
From: Brian M. <ma...@us...> - 2005-05-29 21:54:00
|
Update of /cvsroot/java-game-lib/LWJGL In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31025 Modified Files: build.xml Log Message: fixed lib includes for mac os x on release Index: build.xml =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/build.xml,v retrieving revision 1.80 retrieving revision 1.81 diff -u -d -r1.80 -r1.81 --- build.xml 19 May 2005 22:30:35 -0000 1.80 +++ build.xml 29 May 2005 21:53:48 -0000 1.81 @@ -103,7 +103,9 @@ <include name="liblwjgl-devil.jnilib" /> <include name="openal.dylib" /> - <include name="IL" /> + <include name="libIL.dylib" /> + <include name="libILU.dylib" /> + <include name="libILUT.dylib" /> </patternset> <!-- Files to include in source distribution --> |
|
From: Brian M. <ma...@us...> - 2005-05-29 21:24:26
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common/devil In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15647/src/native/common/devil Modified Files: extil.c extilu.c extilut.c Log Message: use dlopen to load dynamic libraries Index: extilut.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/devil/extilut.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- extilut.c 22 May 2005 11:14:00 -0000 1.7 +++ extilut.c 29 May 2005 21:24:18 -0000 1.8 @@ -1,18 +1,11 @@ /* Handle to ilut Library */ #ifdef _WIN32 -#include "extilut.h" -static HMODULE devILUThandle; -#endif -#ifdef _X11 -#include "extilut.h" -static void* devILUThandle; -#endif -#ifdef _MACOSX -#include <mach-o/dyld.h> -#include <stdlib.h> -#include <string.h> -static const struct mach_header* devILUThandle; -#include "extilut.h" + #include "extilut.h" + static HMODULE devILUThandle; +#else + #include <dlfcn.h> + #include "extilut.h" + static void* devILUThandle; #endif /** @@ -22,22 +15,9 @@ static void *NativeGetFunctionPointer(const char *function) { #ifdef _WIN32 return GetProcAddress(devILUThandle, function); -#endif -#ifdef _X11 +#else return dlsym(devILUThandle, function); #endif -#ifdef _MACOSX - char *mac_symbol_name = (char *)malloc((strlen(function) + 2)*sizeof(char)); - if (mac_symbol_name == NULL) - return NULL; - mac_symbol_name[0] = '_'; - strcpy(&(mac_symbol_name[1]), function); - NSSymbol symbol = NSLookupSymbolInImage(devILUThandle, mac_symbol_name, NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR); - free(mac_symbol_name); - if (symbol == NULL) - return NULL; - return NSAddressOfSymbol(symbol); -#endif } /** @@ -77,12 +57,11 @@ printfDebug("Testing '%s'\n", path_str); #ifdef _WIN32 devILUThandle = LoadLibrary(path_str); -#endif -#ifdef _X11 +#else devILUThandle = dlopen(path_str, RTLD_LAZY); -#endif -#ifdef _MACOSX - devILUThandle = NSAddImage(path_str, NSADDIMAGE_OPTION_RETURN_ON_ERROR); + if(devILUThandle == NULL) { + printfDebug("dlopen failure: %s", dlerror()); + } #endif if (devILUThandle != NULL) { printfDebug("Found ilut at '%s'\n", path_str); @@ -103,15 +82,11 @@ void extilut_Close(void) { #ifdef _WIN32 FreeLibrary(devILUThandle); -#endif -#ifdef _X11 +#else if (devILUThandle != NULL) { dlclose(devILUThandle); } #endif -#ifdef _MACOSX - // Cannot remove the image -#endif devILUThandle = NULL; } Index: extil.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/devil/extil.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- extil.c 18 May 2005 17:36:42 -0000 1.9 +++ extil.c 29 May 2005 21:24:18 -0000 1.10 @@ -1,18 +1,11 @@ /* Handle to devil Library */ #ifdef _WIN32 -#include "extil.h" -static HMODULE devILhandle; -#endif -#ifdef _X11 -#include "extil.h" -static void* devILhandle; -#endif -#ifdef _MACOSX -#include <mach-o/dyld.h> -#include <stdlib.h> -#include <string.h> -const struct mach_header* devILhandle = NULL; -#include "extil.h" + #include "extil.h" + static HMODULE devILhandle; +#else + #include <dlfcn.h> + #include "extil.h" + static void* devILhandle; #endif /** @@ -22,22 +15,9 @@ static void *NativeGetFunctionPointer(const char *function) { #ifdef _WIN32 return GetProcAddress(devILhandle, function); -#endif -#ifdef _X11 +#else return dlsym(devILhandle, function); #endif -#ifdef _MACOSX - char *mac_symbol_name = (char *)malloc((strlen(function) + 2)*sizeof(char)); - if (mac_symbol_name == NULL) - return NULL; - mac_symbol_name[0] = '_'; - strcpy(&(mac_symbol_name[1]), function); - NSSymbol symbol = NSLookupSymbolInImage(devILhandle, mac_symbol_name, NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR); - free(mac_symbol_name); - if (symbol == NULL) - return NULL; - return NSAddressOfSymbol(symbol); -#endif } /** @@ -77,12 +57,11 @@ printfDebug("Testing '%s'\n", path_str); #ifdef _WIN32 devILhandle = LoadLibrary(path_str); -#endif -#ifdef _X11 +#else devILhandle = dlopen(path_str, RTLD_LAZY); -#endif -#ifdef _MACOSX - devILhandle = NSAddImage(path_str, NSADDIMAGE_OPTION_RETURN_ON_ERROR); + if(devILhandle == NULL) { + printfDebug("dlopen failure: %s", dlerror()); + } #endif if (devILhandle != NULL) { printfDebug("Found devil at '%s'\n", path_str); @@ -103,15 +82,11 @@ void extil_Close(void) { #ifdef _WIN32 FreeLibrary(devILhandle); -#endif -#ifdef _X11 +#else if (devILhandle != NULL) { dlclose(devILhandle); } #endif -#ifdef _MACOSX - // Cannot remove the image -#endif devILhandle = NULL; } Index: extilu.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/devil/extilu.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- extilu.c 22 May 2005 11:14:00 -0000 1.8 +++ extilu.c 29 May 2005 21:24:18 -0000 1.9 @@ -1,18 +1,11 @@ /* Handle to ilu Library */ #ifdef _WIN32 -#include "extilu.h" -static HMODULE devILUhandle; -#endif -#ifdef _X11 -#include "extilu.h" -static void* devILUhandle; -#endif -#ifdef _MACOSX -#include <mach-o/dyld.h> -#include <stdlib.h> -#include <string.h> -static const struct mach_header* devILUhandle; -#include "extilu.h" + #include "extilu.h" + static HMODULE devILUhandle; +#else + #include <dlfcn.h> + #include "extilu.h" + static void* devILUhandle; #endif /** @@ -22,22 +15,9 @@ static void *NativeGetFunctionPointer(const char *function) { #ifdef _WIN32 return GetProcAddress(devILUhandle, function); -#endif -#ifdef _X11 +#else return dlsym(devILUhandle, function); #endif -#ifdef _MACOSX - char *mac_symbol_name = (char *)malloc((strlen(function) + 2)*sizeof(char)); - if (mac_symbol_name == NULL) - return NULL; - mac_symbol_name[0] = '_'; - strcpy(&(mac_symbol_name[1]), function); - NSSymbol symbol = NSLookupSymbolInImage(devILUhandle, mac_symbol_name, NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR); - free(mac_symbol_name); - if (symbol == NULL) - return NULL; - return NSAddressOfSymbol(symbol); -#endif } /** @@ -77,12 +57,11 @@ printfDebug("Testing '%s'\n", path_str); #ifdef _WIN32 devILUhandle = LoadLibrary(path_str); -#endif -#ifdef _X11 +#else devILUhandle = dlopen(path_str, RTLD_LAZY); -#endif -#ifdef _MACOSX - devILUhandle = NSAddImage(path_str, NSADDIMAGE_OPTION_RETURN_ON_ERROR); + if(devILUhandle == NULL) { + printfDebug("dlopen failure: %s", dlerror()); + } #endif if (devILUhandle != NULL) { printfDebug("Found ilu at '%s'\n", path_str); @@ -103,14 +82,10 @@ void extilu_Close(void) { #ifdef _WIN32 FreeLibrary(devILUhandle); -#endif -#ifdef _X11 +#else if (devILUhandle != NULL) { dlclose(devILUhandle); } #endif -#ifdef _MACOSX - // Cannot remove the image -#endif devILUhandle = NULL; } |
|
From: Brian M. <ma...@us...> - 2005-05-28 08:48:11
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/glu In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21659/src/java/org/lwjgl/opengl/glu Modified Files: MipMap.java Log Message: added UlfJacks GL_FLOAT patch for gluScaleImage Index: MipMap.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/glu/MipMap.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- MipMap.java 4 May 2005 20:59:39 -0000 1.9 +++ MipMap.java 28 May 2005 08:48:01 -0000 1.10 @@ -186,6 +186,9 @@ case GL11.GL_UNSIGNED_BYTE: sizein = 1; break; + case GL11.GL_FLOAT: + sizein = 4; + break; default: return GL11.GL_INVALID_ENUM; } @@ -195,6 +198,9 @@ case GL11.GL_UNSIGNED_BYTE: sizeout = 1; break; + case GL11.GL_FLOAT: + sizeout = 4; + break; default: return GL11.GL_INVALID_ENUM; } @@ -224,6 +230,19 @@ } } break; + case GL11.GL_FLOAT: + k = 0; + dataIn.rewind(); + for ( i = 0; i < heightIn; i++ ) + { + int fptr = 4 * (i * rowstride + pss.unpackSkipRows * rowstride + pss.unpackSkipPixels * components); + for ( j = 0; j < widthIn * components; j++ ) + { + tempIn[k++] = dataIn.getFloat(fptr); + fptr += 4; + } + } + break; default: return GLU.GLU_INVALID_ENUM; } @@ -304,6 +323,17 @@ } } break; + case GL11.GL_FLOAT: + k = 0; + for ( i = 0; i < heightOut; i++ ) { + int fptr = 4 * (i * rowstride + pss.unpackSkipRows * rowstride + pss.unpackSkipPixels * components); + + for ( j = 0; j < widthOut * components; j++ ) { + dataOut.putFloat(fptr, tempOut[k++]); + fptr += 4; + } + } + break; default: return GLU.GLU_INVALID_ENUM; } |
|
From: Elias N. <eli...@us...> - 2005-05-27 11:50:25
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31116/src/java/org/lwjgl/opengl Modified Files: LinuxAWTGLCanvasPeerInfo.java LinuxCanvasImplementation.java Win32CanvasImplementation.java Log Message: Linux AWT: in case we're not on a SUN jdk, try to determine values instead of bombing out. This should help us compile and run on gcj Index: LinuxCanvasImplementation.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/LinuxCanvasImplementation.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- LinuxCanvasImplementation.java 4 May 2005 20:59:33 -0000 1.6 +++ LinuxCanvasImplementation.java 27 May 2005 11:50:12 -0000 1.7 @@ -36,6 +36,7 @@ import java.lang.reflect.Method; import org.lwjgl.LWJGLException; +import org.lwjgl.LWJGLUtil; /** * $Id$ @@ -74,15 +75,19 @@ * @return The GraphicsConfiguration corresponding to a visual that matches the pixel format. */ public GraphicsConfiguration findConfiguration(GraphicsDevice device, PixelFormat pixel_format) throws LWJGLException { - int screen = getScreenFromDevice(device); - int visual_id_matching_format = findVisualIDFromFormat(screen, pixel_format); - GraphicsConfiguration[] configurations = device.getConfigurations(); - for (int i = 0; i < configurations.length; i++) { - int visual_id = getVisualIDFromConfiguration(configurations[i]); - if (visual_id == visual_id_matching_format) - return configurations[i]; + try { + int screen = getScreenFromDevice(device); + int visual_id_matching_format = findVisualIDFromFormat(screen, pixel_format); + GraphicsConfiguration[] configurations = device.getConfigurations(); + for (int i = 0; i < configurations.length; i++) { + int visual_id = getVisualIDFromConfiguration(configurations[i]); + if (visual_id == visual_id_matching_format) + return configurations[i]; + } + } catch (LWJGLException e) { + LWJGLUtil.log("Got exception while trying to determine configuration: " + e); } - throw new LWJGLException("Could not find the matching GraphicsConfiguration to visual id"); + return null; // In case we failed to locate the visual, or if we're not on a SUN JDK } private static int findVisualIDFromFormat(int screen, PixelFormat pixel_format) throws LWJGLException { Index: Win32CanvasImplementation.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/Win32CanvasImplementation.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Win32CanvasImplementation.java 4 May 2005 20:59:36 -0000 1.3 +++ Win32CanvasImplementation.java 27 May 2005 11:50:12 -0000 1.4 @@ -58,7 +58,7 @@ */ public GraphicsConfiguration findConfiguration(GraphicsDevice device, PixelFormat pixel_format) throws LWJGLException { /* - * It seems like the best way is to simply return null and let + * It seems like the best way is to simply return null and * use SetPixelFormat in JNI later. */ return null; Index: LinuxAWTGLCanvasPeerInfo.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/LinuxAWTGLCanvasPeerInfo.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- LinuxAWTGLCanvasPeerInfo.java 4 May 2005 20:59:36 -0000 1.3 +++ LinuxAWTGLCanvasPeerInfo.java 27 May 2005 11:50:12 -0000 1.4 @@ -34,6 +34,7 @@ import java.nio.ByteBuffer; import org.lwjgl.LWJGLException; +import org.lwjgl.LWJGLUtil; /** * $Id$ @@ -50,7 +51,12 @@ } protected void doLockAndInitHandle() throws LWJGLException { - int screen = LinuxCanvasImplementation.getScreenFromDevice(canvas.getGraphicsConfiguration().getDevice()); + int screen = -1; + try { + screen = LinuxCanvasImplementation.getScreenFromDevice(canvas.getGraphicsConfiguration().getDevice()); + } catch (LWJGLException e) { + LWJGLUtil.log("Got exception while trying to determine screen: " + e); + } nInitHandle(screen, awt_surface.lockAndGetHandle(canvas), getHandle()); } private static native void nInitHandle(int screen, ByteBuffer surface_buffer, ByteBuffer peer_info_handle) throws LWJGLException; |
|
From: Elias N. <eli...@us...> - 2005-05-27 11:50:25
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31116/src/native/linux Modified Files: org_lwjgl_opengl_LinuxAWTGLCanvasPeerInfo.c Log Message: Linux AWT: in case we're not on a SUN jdk, try to determine values instead of bombing out. This should help us compile and run on gcj Index: org_lwjgl_opengl_LinuxAWTGLCanvasPeerInfo.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_LinuxAWTGLCanvasPeerInfo.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- org_lwjgl_opengl_LinuxAWTGLCanvasPeerInfo.c 20 Feb 2005 11:24:22 -0000 1.1 +++ org_lwjgl_opengl_LinuxAWTGLCanvasPeerInfo.c 27 May 2005 11:50:13 -0000 1.2 @@ -60,6 +60,22 @@ // Get the platform-specific drawing info JAWT_X11DrawingSurfaceInfo *dsi_x11 = (JAWT_X11DrawingSurfaceInfo*)awt_lock->dsi->platformInfo; + // If we couldn't get a screen from java side, attempt to determine a sane screen + // from the information we do have, namely the visualid and the depth + if (screen == -1) { + XVisualInfo template; + int num_infos; + template.visualid = dsi_x11->visualID; + template.depth = dsi_x11->depth; + XVisualInfo *vis_info = XGetVisualInfo(peer_info->display, VisualIDMask | VisualDepthMask, &template, &num_infos); + if (vis_info == NULL) { + throwException(env, "Could not determine screen"); + return; + } + screen = vis_info[0].screen; + XFree(vis_info); + } + peer_info->display = dsi_x11->display; peer_info->screen = screen; peer_info->drawable = dsi_x11->drawable; |
|
From: Brian M. <ma...@us...> - 2005-05-22 12:12:46
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/examples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3724/java/org/lwjgl/examples Modified Files: Game.java Log Message: added System.exit so that vm instances gets nuked in webstart Index: Game.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/examples/Game.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- Game.java 20 Aug 2004 06:22:53 -0000 1.7 +++ Game.java 22 May 2005 12:12:01 -0000 1.8 @@ -78,6 +78,8 @@ } finally { cleanup(); } + + System.exit(0); } /** |
|
From: Brian M. <ma...@us...> - 2005-05-22 12:12:43
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3724/java/org/lwjgl/test Modified Files: DisplayTest.java SysTest.java WindowCreationTest.java Log Message: added System.exit so that vm instances gets nuked in webstart Index: DisplayTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/DisplayTest.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- DisplayTest.java 20 Feb 2005 11:24:18 -0000 1.7 +++ DisplayTest.java 22 May 2005 12:12:01 -0000 1.8 @@ -243,5 +243,6 @@ */ public static void main(String[] args) throws LWJGLException { new DisplayTest().executeTest(); + System.exit(0); } } Index: SysTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/SysTest.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- SysTest.java 4 May 2005 20:59:43 -0000 1.10 +++ SysTest.java 22 May 2005 12:12:02 -0000 1.11 @@ -175,5 +175,6 @@ */ public static void main(String[] args) { new SysTest().executeTest(); + System.exit(0); } } Index: WindowCreationTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/WindowCreationTest.java,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- WindowCreationTest.java 4 May 2005 20:59:43 -0000 1.32 +++ WindowCreationTest.java 22 May 2005 12:12:02 -0000 1.33 @@ -287,6 +287,7 @@ wct.execute(); wct.destroy(); } + System.exit(0); } /** |
|
From: Brian M. <ma...@us...> - 2005-05-22 12:12:43
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/fmod3 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3724/java/org/lwjgl/test/fmod3 Modified Files: CDDAPlayer.java CDPlayer.java DSPTest.java MusicPlayer.java NetTest.java StreamPlayer.java StreamPlayerMemory.java StreamTest.java SyncTest.java TagFieldTest.java Log Message: added System.exit so that vm instances gets nuked in webstart Index: DSPTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/fmod3/DSPTest.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- DSPTest.java 3 Oct 2004 09:35:38 -0000 1.4 +++ DSPTest.java 22 May 2005 12:12:02 -0000 1.5 @@ -67,21 +67,21 @@ File file = new File(args[0]); if (!file.exists()) { System.out.println("No such file: " + args[0]); - return; + System.exit(0); } try { FMOD.create(); } catch (FMODException fmode) { fmode.printStackTrace(); - return; + System.exit(0); } System.out.println("Initializing FMOD"); if (!FSound.FSOUND_Init(44100, 32, 0)) { System.out.println("Failed to initialize FMOD"); System.out.println("Error: " + FMOD.FMOD_ErrorString(FSound.FSOUND_GetError())); - return; + System.exit(0); } System.out.println("Loading " + args[0]); @@ -156,6 +156,7 @@ FSound.FSOUND_Close(); FMOD.destroy(); + System.exit(0); } public class TestDspCallback implements FSoundDSPCallback { Index: StreamPlayer.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/fmod3/StreamPlayer.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- StreamPlayer.java 3 Oct 2004 09:35:38 -0000 1.4 +++ StreamPlayer.java 22 May 2005 12:12:02 -0000 1.5 @@ -59,21 +59,21 @@ File file = new File(args[0]); if (!file.exists()) { System.out.println("No such file: " + args[0]); - return; + System.exit(0); } try { FMOD.create(); } catch (FMODException fmode) { fmode.printStackTrace(); - return; + System.exit(0); } System.out.println("Initializing FMOD"); if (!FSound.FSOUND_Init(44100, 32, 0)) { System.out.println("Failed to initialize FMOD"); System.out.println("Error: " + FMOD.FMOD_ErrorString(FSound.FSOUND_GetError())); - return; + System.exit(0); } System.out.println("Loading " + args[0]); @@ -98,5 +98,6 @@ FSound.FSOUND_Close(); FMOD.destroy(); + System.exit(0); } } \ No newline at end of file Index: CDDAPlayer.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/fmod3/CDDAPlayer.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- CDDAPlayer.java 12 Jun 2004 20:28:25 -0000 1.2 +++ CDDAPlayer.java 22 May 2005 12:12:02 -0000 1.3 @@ -53,13 +53,14 @@ FMOD.create(); } catch (FMODException fmode) { fmode.printStackTrace(); - return; + System.exit(0); } System.out.println("Initializing FMOD"); if (!FSound.FSOUND_Init(44100, 32, 0)) { System.out.println("Failed to initialize FMOD"); - return; + System.exit(0); + } boolean running = true; @@ -115,5 +116,8 @@ } FSound.FSOUND_Close(); FMOD.destroy(); + System.exit(0); } + + } \ No newline at end of file Index: SyncTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/fmod3/SyncTest.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- SyncTest.java 7 Feb 2005 16:39:54 -0000 1.5 +++ SyncTest.java 22 May 2005 12:12:03 -0000 1.6 @@ -109,7 +109,7 @@ File file = new File(args[0]); if (!file.exists()) { System.out.println("No such file: " + args[0]); - return; + System.exit(0); } // initialize FMOD @@ -118,7 +118,7 @@ FMOD.create(); } catch (FMODException fmode) { fmode.printStackTrace(); - return; + System.exit(0); } // start actual test @@ -254,5 +254,6 @@ } FSound.FSOUND_Close(); FMOD.destroy(); + System.exit(0); } } Index: NetTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/fmod3/NetTest.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- NetTest.java 3 Oct 2004 09:00:36 -0000 1.6 +++ NetTest.java 22 May 2005 12:12:02 -0000 1.7 @@ -110,6 +110,7 @@ stop(); FSound.FSOUND_Close(); FMOD.destroy(); + System.exit(0); } } Index: StreamPlayerMemory.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/fmod3/StreamPlayerMemory.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- StreamPlayerMemory.java 7 Dec 2004 06:38:37 -0000 1.4 +++ StreamPlayerMemory.java 22 May 2005 12:12:03 -0000 1.5 @@ -62,14 +62,14 @@ FMOD.create(); } catch (FMODException fmode) { fmode.printStackTrace(); - return; + System.exit(0); } System.out.println("Initializing FMOD"); if (!FSound.FSOUND_Init(44100, 32, 0)) { System.out.println("Failed to initialize FMOD"); System.out.println("Error: " + FMOD.FMOD_ErrorString(FSound.FSOUND_GetError())); - return; + System.exit(0); } ByteBuffer data = getData(args[0]); @@ -97,6 +97,7 @@ FSound.FSOUND_Close(); FMOD.destroy(); + System.exit(0); } /** Index: MusicPlayer.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/fmod3/MusicPlayer.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- MusicPlayer.java 3 Oct 2004 09:35:38 -0000 1.3 +++ MusicPlayer.java 22 May 2005 12:12:02 -0000 1.4 @@ -60,14 +60,14 @@ File file = new File(args[0]); if (!file.exists()) { System.out.println("No such file: " + args[0]); - return; + System.exit(0); } try { FMOD.create(); } catch (FMODException fmode) { fmode.printStackTrace(); - return; + System.exit(0); } System.out.println("Initializing FMOD"); @@ -101,5 +101,6 @@ FSound.FSOUND_Close(); FMOD.destroy(); + System.exit(0); } } \ No newline at end of file Index: TagFieldTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/fmod3/TagFieldTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- TagFieldTest.java 28 Oct 2004 20:01:08 -0000 1.2 +++ TagFieldTest.java 22 May 2005 12:12:03 -0000 1.3 @@ -75,11 +75,11 @@ System.out.println("Failed to initialize FMOD"); System.out.println("Error: " + FMOD.FMOD_ErrorString(FSound.FSOUND_GetError())); FMOD.destroy(); - return; + System.exit(0); } } catch (FMODException fmode) { fmode.printStackTrace(); - return; + System.exit(0); } // scan the supplied arg @@ -89,6 +89,7 @@ // shutdown FSound.FSOUND_Close(); FMOD.destroy(); + System.exit(0); } /** Index: StreamTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/fmod3/StreamTest.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- StreamTest.java 3 Oct 2004 09:35:38 -0000 1.2 +++ StreamTest.java 22 May 2005 12:12:03 -0000 1.3 @@ -51,7 +51,7 @@ FMOD.create(); } catch (FMODException fmode) { fmode.printStackTrace(); - return; + System.exit(0); } IntBuffer caps = BufferUtils.createIntBuffer(1); @@ -68,7 +68,7 @@ if (!FSound.FSOUND_Init(44100, 32, 0)) { System.out.println("Failed to initialize FMOD"); System.out.println("Error: " + FMOD.FMOD_ErrorString(FSound.FSOUND_GetError())); - return; + System.exit(0); } IntBuffer mem = BufferUtils.createIntBuffer(2); Index: CDPlayer.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/fmod3/CDPlayer.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- CDPlayer.java 12 Jun 2004 20:28:25 -0000 1.2 +++ CDPlayer.java 22 May 2005 12:12:02 -0000 1.3 @@ -52,13 +52,13 @@ FMOD.create(); } catch (FMODException fmode) { fmode.printStackTrace(); - return; + System.exit(0); } System.out.println("Initializing FMOD"); if (!FSound.FSOUND_Init(44100, 32, 0)) { System.out.println("Failed to initialize FMOD"); - return; + System.exit(0); } boolean running = true; @@ -132,5 +132,6 @@ FSound.FSOUND_Close(); FMOD.destroy(); + System.exit(0); } } \ No newline at end of file |
|
From: Brian M. <ma...@us...> - 2005-05-22 12:12:42
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/examples/spaceinvaders In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3724/java/org/lwjgl/examples/spaceinvaders Modified Files: Game.java Log Message: added System.exit so that vm instances gets nuked in webstart Index: Game.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/examples/spaceinvaders/Game.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Game.java 20 Feb 2005 11:24:15 -0000 1.6 +++ Game.java 22 May 2005 12:12:01 -0000 1.7 @@ -576,8 +576,9 @@ * @param argv The arguments that are passed into our game */ public static void main(String argv[]) { - System.out.println("Use -fullscreen for fullscreen mode"); + System.out.println("Use -fullscreen for fullscreen mode"); new Game((argv.length > 0 && argv[0].equalsIgnoreCase("-fullscreen"))).execute(); + System.exit(0); } /** |
|
From: Brian M. <ma...@us...> - 2005-05-22 12:12:41
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/devil In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3724/java/org/lwjgl/test/devil Modified Files: BasicTest.java Log Message: added System.exit so that vm instances gets nuked in webstart Index: BasicTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/devil/BasicTest.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- BasicTest.java 4 May 2005 20:59:44 -0000 1.10 +++ BasicTest.java 22 May 2005 12:12:02 -0000 1.11 @@ -115,7 +115,7 @@ IL.destroy(); } catch (Exception e) { e.printStackTrace(); - System.exit(0); } + System.exit(0); } } |
|
From: Brian M. <ma...@us...> - 2005-05-22 12:12:24
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3724/java/org/lwjgl/test/openal Modified Files: ALCTest.java MovingSoundTest.java OpenALCreationTest.java PlayTest.java PlayTestMemory.java PositionTest.java SourceLimitTest.java StressTest.java Log Message: added System.exit so that vm instances gets nuked in webstart Index: PositionTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/PositionTest.java,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- PositionTest.java 29 Mar 2005 18:09:31 -0000 1.26 +++ PositionTest.java 22 May 2005 12:12:09 -0000 1.27 @@ -484,6 +484,7 @@ public static void main(String[] args) { PositionTest positionTest = new PositionTest(); positionTest.execute(args); + System.exit(0); } /** Index: ALCTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/ALCTest.java,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- ALCTest.java 22 Jul 2004 14:27:07 -0000 1.14 +++ ALCTest.java 22 May 2005 12:12:09 -0000 1.15 @@ -104,5 +104,6 @@ public static void main(String[] args) { ALCTest alcTest = new ALCTest(); alcTest.execute(args); + System.exit(0); } } \ No newline at end of file Index: OpenALCreationTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/OpenALCreationTest.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- OpenALCreationTest.java 25 Feb 2005 20:24:10 -0000 1.12 +++ OpenALCreationTest.java 22 May 2005 12:12:09 -0000 1.13 @@ -220,5 +220,6 @@ public static void main(String[] args) { OpenALCreationTest oalCreationTest = new OpenALCreationTest(); oalCreationTest.execute(args); + System.exit(0); } } Index: PlayTestMemory.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/PlayTestMemory.java,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- PlayTestMemory.java 25 Feb 2005 20:24:10 -0000 1.19 +++ PlayTestMemory.java 22 May 2005 12:12:09 -0000 1.20 @@ -229,5 +229,6 @@ public static void main(String[] args) { PlayTestMemory playTestMemory = new PlayTestMemory(); playTestMemory.execute(args); + System.exit(0); } } Index: StressTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/StressTest.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- StressTest.java 25 Feb 2005 20:24:10 -0000 1.15 +++ StressTest.java 22 May 2005 12:12:09 -0000 1.16 @@ -218,5 +218,6 @@ public static void main(String[] args) { StressTest stressTest = new StressTest(); stressTest.execute(args); + System.exit(0); } } Index: SourceLimitTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/SourceLimitTest.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- SourceLimitTest.java 12 May 2005 15:44:22 -0000 1.15 +++ SourceLimitTest.java 22 May 2005 12:12:09 -0000 1.16 @@ -160,5 +160,6 @@ public static void main(String[] args) { SourceLimitTest sourceLimitTest = new SourceLimitTest(); sourceLimitTest.execute(args); + System.exit(0); } } Index: MovingSoundTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/MovingSoundTest.java,v retrieving revision 1.34 retrieving revision 1.35 diff -u -d -r1.34 -r1.35 --- MovingSoundTest.java 25 Feb 2005 20:24:10 -0000 1.34 +++ MovingSoundTest.java 22 May 2005 12:12:09 -0000 1.35 @@ -213,5 +213,6 @@ public static void main(String[] args) { MovingSoundTest movingSoundTest = new MovingSoundTest(); movingSoundTest.execute(args); + System.exit(0); } } Index: PlayTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/openal/PlayTest.java,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- PlayTest.java 25 Feb 2005 20:24:10 -0000 1.18 +++ PlayTest.java 22 May 2005 12:12:09 -0000 1.19 @@ -216,5 +216,6 @@ public static void main(String[] args) { PlayTest playTest = new PlayTest(); playTest.execute(args); + System.exit(0); } } |
|
From: Brian M. <ma...@us...> - 2005-05-22 12:12:24
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3724/java/org/lwjgl/test/opengl Modified Files: FullScreenWindowedTest.java Gears.java PbufferTest.java VBOIndexTest.java VBOTest.java Log Message: added System.exit so that vm instances gets nuked in webstart Index: VBOIndexTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/opengl/VBOIndexTest.java,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- VBOIndexTest.java 16 Feb 2005 12:58:40 -0000 1.24 +++ VBOIndexTest.java 22 May 2005 12:12:09 -0000 1.25 @@ -130,6 +130,7 @@ } finally { cleanup(); } + System.exit(0); } /** Index: Gears.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/opengl/Gears.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Gears.java 22 Mar 2005 22:02:50 -0000 1.4 +++ Gears.java 22 May 2005 12:12:09 -0000 1.5 @@ -71,6 +71,7 @@ public static void main(String[] args) { new Gears().execute(); + System.exit(0); } /** Index: FullScreenWindowedTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/opengl/FullScreenWindowedTest.java,v retrieving revision 1.35 retrieving revision 1.36 diff -u -d -r1.35 -r1.36 --- FullScreenWindowedTest.java 20 Feb 2005 11:24:19 -0000 1.35 +++ FullScreenWindowedTest.java 22 May 2005 12:12:09 -0000 1.36 @@ -271,5 +271,6 @@ System.out.println("Move quad using arrowkeys, and change rotation using +/-"); FullScreenWindowedTest fswTest = new FullScreenWindowedTest(); fswTest.execute(); + System.exit(0); } } Index: PbufferTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/opengl/PbufferTest.java,v retrieving revision 1.42 retrieving revision 1.43 diff -u -d -r1.42 -r1.43 --- PbufferTest.java 20 Feb 2005 11:24:19 -0000 1.42 +++ PbufferTest.java 22 May 2005 12:12:09 -0000 1.43 @@ -395,5 +395,6 @@ System.out.println("Move quad using arrowkeys, and change rotation using +/-"); PbufferTest fswTest = new PbufferTest(); fswTest.execute(); + System.exit(0); } } Index: VBOTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/opengl/VBOTest.java,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- VBOTest.java 16 Feb 2005 12:58:40 -0000 1.30 +++ VBOTest.java 22 May 2005 12:12:09 -0000 1.31 @@ -126,6 +126,7 @@ } finally { cleanup(); } + System.exit(0); } /** |
|
From: Brian M. <ma...@us...> - 2005-05-22 12:12:24
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/opengl/shaders In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3724/java/org/lwjgl/test/opengl/shaders Modified Files: ShadersTest.java Log Message: added System.exit so that vm instances gets nuked in webstart Index: ShadersTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/opengl/shaders/ShadersTest.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- ShadersTest.java 4 May 2005 20:59:39 -0000 1.9 +++ ShadersTest.java 22 May 2005 12:12:10 -0000 1.10 @@ -116,6 +116,7 @@ } cleanup(); + System.exit(0); } private static void initialize(String[] args) { |
|
From: Brian M. <ma...@us...> - 2005-05-22 12:12:24
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/opengl/pbuffers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3724/java/org/lwjgl/test/opengl/pbuffers Modified Files: PbufferTest.java Log Message: added System.exit so that vm instances gets nuked in webstart Index: PbufferTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/opengl/pbuffers/PbufferTest.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- PbufferTest.java 4 May 2005 20:59:39 -0000 1.5 +++ PbufferTest.java 22 May 2005 12:12:10 -0000 1.6 @@ -422,6 +422,7 @@ PbufferTest test = new PbufferTest(mode); test.execute(); + System.exit(0); } private static void kill(final String msg) { |
|
From: Brian M. <ma...@us...> - 2005-05-22 12:12:23
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/opengl/awt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3724/java/org/lwjgl/test/opengl/awt Modified Files: AWTGears.java AWTTest.java DemoBox.java Log Message: added System.exit so that vm instances gets nuked in webstart Index: DemoBox.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/opengl/awt/DemoBox.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- DemoBox.java 12 May 2005 15:44:48 -0000 1.3 +++ DemoBox.java 22 May 2005 12:12:10 -0000 1.4 @@ -152,6 +152,7 @@ public void windowClosing(WindowEvent e) { demoCanvas.destroy(); dispose(); + System.exit(0); } }); Index: AWTGears.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/opengl/awt/AWTGears.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- AWTGears.java 22 Mar 2005 22:02:48 -0000 1.3 +++ AWTGears.java 22 May 2005 12:12:10 -0000 1.4 @@ -134,6 +134,7 @@ addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { dispose(); + System.exit(0); } }); setResizable(true); Index: AWTTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/opengl/awt/AWTTest.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- AWTTest.java 4 May 2005 20:59:43 -0000 1.5 +++ AWTTest.java 22 May 2005 12:12:10 -0000 1.6 @@ -112,6 +112,7 @@ addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { dispose(); + System.exit(0); } }); setResizable(true); |
|
From: Brian M. <ma...@us...> - 2005-05-22 12:12:21
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3724/java/org/lwjgl/test/input Modified Files: HWCursorTest.java KeyboardTest.java MouseCreationTest.java MouseTest.java Log Message: added System.exit so that vm instances gets nuked in webstart Index: MouseCreationTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input/MouseCreationTest.java,v retrieving revision 1.35 retrieving revision 1.36 diff -u -d -r1.35 -r1.36 --- MouseCreationTest.java 20 Feb 2005 11:24:18 -0000 1.35 +++ MouseCreationTest.java 22 May 2005 12:12:08 -0000 1.36 @@ -204,5 +204,6 @@ public static void main(String[] args) { MouseCreationTest mt = new MouseCreationTest(); mt.executeTest(); + System.exit(0); } } Index: HWCursorTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input/HWCursorTest.java,v retrieving revision 1.42 retrieving revision 1.43 diff -u -d -r1.42 -r1.43 --- HWCursorTest.java 20 Feb 2005 11:24:18 -0000 1.42 +++ HWCursorTest.java 22 May 2005 12:12:03 -0000 1.43 @@ -393,5 +393,6 @@ System.out.println("Change between fullscreen and windowed mode, by pressing F and W respectively. Enable hw cursor with N and disable it with M."); HWCursorTest cursorTest = new HWCursorTest(); cursorTest.execute(); + System.exit(0); } } Index: KeyboardTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input/KeyboardTest.java,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- KeyboardTest.java 20 Feb 2005 11:24:18 -0000 1.31 +++ KeyboardTest.java 22 May 2005 12:12:08 -0000 1.32 @@ -236,5 +236,6 @@ public static void main(String[] args) { KeyboardTest kt = new KeyboardTest(); kt.executeTest(); + System.exit(0); } } Index: MouseTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input/MouseTest.java,v retrieving revision 1.43 retrieving revision 1.44 diff -u -d -r1.43 -r1.44 --- MouseTest.java 21 Mar 2005 08:27:43 -0000 1.43 +++ MouseTest.java 22 May 2005 12:12:08 -0000 1.44 @@ -411,5 +411,6 @@ public static void main(String[] args) { MouseTest mt = new MouseTest(); mt.executeTest(); + System.exit(0); } } |
|
From: Brian M. <ma...@us...> - 2005-05-22 11:14:13
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common/devil In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20129 Modified Files: extilu.c extilut.c Log Message: using .dylibs for devil on mac Index: extilut.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/devil/extilut.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- extilut.c 18 May 2005 17:36:42 -0000 1.6 +++ extilut.c 22 May 2005 11:14:00 -0000 1.7 @@ -11,9 +11,7 @@ #include <mach-o/dyld.h> #include <stdlib.h> #include <string.h> -// note, we use the IL handle since it's all in one lib -extern const struct mach_header* devILhandle; -static const struct mach_header* devILUThandle; // never actually used, just makes it shut up +static const struct mach_header* devILUThandle; #include "extilut.h" #endif @@ -34,7 +32,7 @@ return NULL; mac_symbol_name[0] = '_'; strcpy(&(mac_symbol_name[1]), function); - NSSymbol symbol = NSLookupSymbolInImage(devILhandle, mac_symbol_name, NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR); + NSSymbol symbol = NSLookupSymbolInImage(devILUThandle, mac_symbol_name, NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR); free(mac_symbol_name); if (symbol == NULL) return NULL; Index: extilu.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/devil/extilu.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- extilu.c 18 May 2005 17:36:42 -0000 1.7 +++ extilu.c 22 May 2005 11:14:00 -0000 1.8 @@ -11,9 +11,7 @@ #include <mach-o/dyld.h> #include <stdlib.h> #include <string.h> -// note, we use the IL handle since it's all in one lib -extern const struct mach_header* devILhandle; -static const struct mach_header* devILUhandle; // never actually used, just makes it shut up +static const struct mach_header* devILUhandle; #include "extilu.h" #endif @@ -34,7 +32,7 @@ return NULL; mac_symbol_name[0] = '_'; strcpy(&(mac_symbol_name[1]), function); - NSSymbol symbol = NSLookupSymbolInImage(devILhandle, mac_symbol_name, NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR); + NSSymbol symbol = NSLookupSymbolInImage(devILUhandle, mac_symbol_name, NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR); free(mac_symbol_name); if (symbol == NULL) return NULL; |
|
From: Brian M. <ma...@us...> - 2005-05-22 11:09:13
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/devil In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19251/org/lwjgl/devil Modified Files: IL.java ILU.java ILUT.java Log Message: using .dylibs for devil on mac Index: ILUT.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/devil/ILUT.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- ILUT.java 4 May 2005 20:59:41 -0000 1.12 +++ ILUT.java 22 May 2005 11:09:02 -0000 1.13 @@ -128,15 +128,10 @@ throw new LWJGLException("Cannot create ILUT without having created IL instance"); } - // We need to do nothing when running on mac, since all is loaded in IL - if(LWJGLUtil.getPlatform() == LWJGLUtil.PLATFORM_MACOSX) { - return; - } - String[] ilutPaths = LWJGLUtil.getLibraryPaths(new String[]{ "ILUT", "ILUT.dll", "ILUT", "libILUT.so", - "ILUT", "IL"}, ILU.class.getClassLoader()); + "ILUT", "libILUT.dylib"}, ILUT.class.getClassLoader()); nCreate(ilutPaths); created = true; @@ -158,12 +153,6 @@ * Exit cleanly by calling destroy. */ public static void destroy() { - - // We need to do nothing when running on mac, since all is destroyed in IL - if(LWJGLUtil.getPlatform() == LWJGLUtil.PLATFORM_MACOSX) { - return; - } - resetNativeStubs(ILUT.class); if (created) { nDestroy(); Index: IL.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/devil/IL.java,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- IL.java 4 May 2005 20:59:40 -0000 1.16 +++ IL.java 22 May 2005 11:09:02 -0000 1.17 @@ -583,23 +583,13 @@ String[] illPaths = LWJGLUtil.getLibraryPaths(new String[]{ "DevIL", "DevIL.dll", "IL", "libIL.so", - "IL", "IL"}, IL.class.getClassLoader()); + "IL", "libIL.dylib"}, IL.class.getClassLoader()); nCreate(illPaths); created = true; try { IL.initNativeStubs(); IL.ilInit(); - - // We need to initialize everything in one fell swoop on mac - if(LWJGLUtil.getPlatform() == LWJGLUtil.PLATFORM_MACOSX) { - ILU.initNativeStubs(); - ILU.setCreated(true); - - ILUT.initNativeStubs(); - ILUT.setCreated(true); - } - created = true; } catch (LWJGLException e) { destroy(); @@ -613,17 +603,6 @@ public static void destroy() { resetNativeStubs(IL.class); - // We need to destroy everything on mac in one go - if(LWJGLUtil.getPlatform() == LWJGLUtil.PLATFORM_MACOSX) { - ILU.resetNativeStubs(ILU.class); - ILU.nDestroy(); - ILU.setCreated(false); - - ILUT.resetNativeStubs(ILUT.class); - ILUT.nDestroy(); - ILUT.setCreated(false); - } - if (created) { nDestroy(); } Index: ILU.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/devil/ILU.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- ILU.java 4 May 2005 20:59:41 -0000 1.12 +++ ILU.java 22 May 2005 11:09:02 -0000 1.13 @@ -163,15 +163,10 @@ throw new LWJGLException("Cannot create ILU without having created IL instance"); } - // We need to do nothing when running on mac, since all is loaded in IL - if(LWJGLUtil.getPlatform() == LWJGLUtil.PLATFORM_MACOSX) { - return; - } - String[] iluPaths = LWJGLUtil.getLibraryPaths(new String[]{ "ILU", "ILU.dll", "ILU", "libILU.so", - "ILU", "ILU"}, ILU.class.getClassLoader()); + "ILU", "libILU.dylib"}, ILU.class.getClassLoader()); nCreate(iluPaths); created = true; @@ -193,12 +188,6 @@ * Exit cleanly by calling destroy. */ public static void destroy() { - - // We need to do nothing when running on mac, since all is destroyed in IL - if(LWJGLUtil.getPlatform() == LWJGLUtil.PLATFORM_MACOSX) { - return; - } - resetNativeStubs(ILU.class); if (created) { nDestroy(); |
|
From: Brian M. <ma...@us...> - 2005-05-19 22:32:39
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common/fmod3 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5575 Modified Files: org_lwjgl_fmod3_FMOD.c Log Message: fixed fmod webstart loading Index: org_lwjgl_fmod3_FMOD.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/fmod3/org_lwjgl_fmod3_FMOD.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- org_lwjgl_fmod3_FMOD.c 18 May 2005 21:02:41 -0000 1.12 +++ org_lwjgl_fmod3_FMOD.c 19 May 2005 22:32:30 -0000 1.13 @@ -35,18 +35,6 @@ static const char* VERSION = "0.97"; -/** - * Concatenate two strings - */ -static char *concatenate(const char *str1, const char *str2) { - int length1 = strlen(str1); - int length2 = strlen(str2); - char *str = (char *)calloc(length1 + length2 + 1, sizeof(char)); - strncpy(str, str1, length1); - strncpy(str + length1, str2, length2 + 1); - return str; -} - /* * Class: org_lwjgl_fmod3_FMOD * Method: getNativeLibraryVersion @@ -66,23 +54,12 @@ int i; jstring path; char *path_str; - char *lib_str; for(i=0;i<pathcount;i++) { path = (jstring) (*env)->GetObjectArrayElement(env, paths, i); path_str = GetStringNativeChars(env, path); -#ifdef _WIN32 - lib_str = concatenate(path_str, "fmod.dll"); -#endif -#ifdef _X11 - lib_str = concatenate(path_str, "libfmod.so"); -#endif -#ifdef _MACOSX - lib_str = concatenate(path_str, "ignored"); -#endif - printfDebug("Testing '%s'\n", lib_str); - fmod_create(env, lib_str); - free(lib_str); + printfDebug("Testing '%s'\n", path_str); + fmod_create(env, path_str); free(path_str); if(fmod_instance != NULL) { |
|
From: Brian M. <ma...@us...> - 2005-05-19 22:31:47
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/fmod3 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5285 Modified Files: FMOD.java Log Message: fixed fmod webstart loading Index: FMOD.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/fmod3/FMOD.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- FMOD.java 18 May 2005 21:02:01 -0000 1.12 +++ FMOD.java 19 May 2005 22:31:20 -0000 1.13 @@ -31,13 +31,12 @@ */ package org.lwjgl.fmod3; -import java.io.File; import java.lang.reflect.Method; import java.nio.FloatBuffer; import java.util.ArrayList; import java.util.HashMap; -import java.util.StringTokenizer; +import org.lwjgl.LWJGLException; import org.lwjgl.LWJGLUtil; /** @@ -251,57 +250,18 @@ return; } - // create, passing potential locations for native fmod library - nCreate(constructFMODSearchPaths()); - created = true; - } - - /** - * Retrieves an array of strings, with potential locations for - * the native fmod library - * @return array of strings, with potential locations for the native fmod library - */ - private static String[] constructFMODSearchPaths() { - // miscellaneous values - String libpath = System.getProperty("java.library.path"); - String seperator = System.getProperty("path.separator"); - - // determine os library name - String dllName = FMOD_WIN32_LIBRARY_NAME; - switch (LWJGLUtil.getPlatform()) { - case LWJGLUtil.PLATFORM_MACOSX: - dllName = FMOD_OSX_LIBRARY_NAME; - break; - case LWJGLUtil.PLATFORM_LINUX: - dllName = FMOD_LINUX_LIBRARY_NAME; - break; - default: - throw new LinkageError("Unsupported platform"); - } - - String jwsPath = getPathFromJWS(dllName); - LWJGLUtil.log("getPathFromJWS: Paths found: " + jwsPath); - if (jwsPath != null) { - libpath += seperator - + jwsPath.substring(0, jwsPath.lastIndexOf(File.separator)); - } - - // split, and rebuild library path to path + dll - StringTokenizer st = new StringTokenizer(libpath, seperator); - String[] paths = new String[st.countTokens() + 1]; - - //build paths - for (int i = 0; i < paths.length - 1; i++) { - paths[i] = st.nextToken() + File.separator; - } - - for(int i=0 ; i<paths.length; i++) { - LWJGLUtil.log("Will search " + paths[i] + " for " + dllName); + try { + String[] fmodPaths = LWJGLUtil.getLibraryPaths(new String[]{ + "fmod", "fmod.dll", + "fmod", "libfmod.so", + "fmod", "static-ignored"}, + FMOD.class.getClassLoader()); + LWJGLUtil.log("Found " + fmodPaths.length + " FMOD paths"); + nCreate(fmodPaths); + created = true; + } catch (LWJGLException le) { + throw new FMODException(le.getMessage()); } - - //add cwd path - paths[paths.length - 1] = dllName; - return paths; } /** |