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
(1) |
|
2
(15) |
3
(20) |
4
(9) |
5
(2) |
6
|
7
(8) |
8
(3) |
|
9
(1) |
10
(8) |
11
(27) |
12
(12) |
13
(1) |
14
(6) |
15
(15) |
|
16
|
17
(2) |
18
|
19
|
20
|
21
(1) |
22
(3) |
|
23
|
24
|
25
(1) |
26
|
27
|
28
|
29
|
|
30
|
31
(3) |
|
|
|
|
|
|
From: <eli...@us...> - 2006-07-02 22:46:05
|
Revision: 2417 Author: elias_naur Date: 2006-07-02 15:45:56 -0700 (Sun, 02 Jul 2006) ViewCVS: http://svn.sourceforge.net/java-game-lib/?rev=2417&view=rev Log Message: ----------- Reverted Display.getPrivilegedBoolean access modifier change - package private is alright Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXFrame.java Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java 2006-07-02 22:41:59 UTC (rev 2416) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java 2006-07-02 22:45:56 UTC (rev 2417) @@ -711,7 +711,7 @@ /** * Gets a boolean property as a privileged action. */ - private static boolean getPrivilegedBoolean(final String property_name) { + static boolean getPrivilegedBoolean(final String property_name) { Boolean value = (Boolean)AccessController.doPrivileged(new PrivilegedAction() { public Object run() { return new Boolean(Boolean.getBoolean(property_name)); Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXFrame.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXFrame.java 2006-07-02 22:41:59 UTC (rev 2416) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXFrame.java 2006-07-02 22:45:56 UTC (rev 2417) @@ -48,7 +48,6 @@ import java.awt.event.WindowEvent; import java.awt.event.WindowListener; import java.security.AccessController; -import java.security.PrivilegedAction; import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; @@ -73,7 +72,7 @@ addComponentListener(this); canvas = new MacOSXGLCanvas(); add(canvas, BorderLayout.CENTER); - boolean undecorated = getPrivilegedBoolean("org.lwjgl.opengl.Window.undecorated"); + boolean undecorated = Display.getPrivilegedBoolean("org.lwjgl.opengl.Window.undecorated"); setUndecorated(fullscreen || undecorated); if ( fullscreen ) { try { @@ -213,16 +212,4 @@ } return result; } - - /** - * Gets a boolean property as a privileged action. - */ - 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(); - } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <eli...@us...> - 2006-07-02 22:42:33
|
Revision: 2416 Author: elias_naur Date: 2006-07-02 15:41:59 -0700 (Sun, 02 Jul 2006) ViewCVS: http://svn.sourceforge.net/java-game-lib/?rev=2416&view=rev Log Message: ----------- Spelling fixes Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/applet/LWJGLInstaller.java trunk/LWJGL/src/java/org/lwjgl/opengl/AWTSurfaceLock.java Modified: trunk/LWJGL/src/java/org/lwjgl/applet/LWJGLInstaller.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/applet/LWJGLInstaller.java 2006-07-02 22:01:27 UTC (rev 2415) +++ trunk/LWJGL/src/java/org/lwjgl/applet/LWJGLInstaller.java 2006-07-02 22:41:59 UTC (rev 2416) @@ -123,7 +123,7 @@ } // create a temporary dir for the native files - String user_temp_dir = getPriveledgedString("java.io.tmpdir"); + String user_temp_dir = getPriviledgedString("java.io.tmpdir"); String path = createTemporaryDir(user_temp_dir); if(path == null) { throw new LWJGLException("Failed creation of temporary directory in " + user_temp_dir); @@ -251,7 +251,7 @@ /** * Gets a property as a privileged action. */ - private static String getPriveledgedString(final String property) { + private static String getPriviledgedString(final String property) { return (String) AccessController.doPrivileged(new PrivilegedAction() { public Object run() { return System.getProperty(property); @@ -315,4 +315,4 @@ } file.delete(); } -} \ No newline at end of file +} Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/AWTSurfaceLock.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/AWTSurfaceLock.java 2006-07-02 22:01:27 UTC (rev 2415) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/AWTSurfaceLock.java 2006-07-02 22:41:59 UTC (rev 2416) @@ -75,7 +75,7 @@ private boolean privilegedLockAndInitHandle(final Canvas canvas) throws LWJGLException { // Workaround for Sun JDK bug 4796548 which still exists in java for OS X - // We need to elevate priveleges because of an AWT bug. Please see + // We need to elevate privileges because of an AWT bug. Please see // http://192.18.37.44/forums/index.php?topic=10572 for a discussion. // It is only needed on first call, so we avoid it on all subsequent calls // due to performance. @@ -103,4 +103,4 @@ } private static native void nUnlock(ByteBuffer lock_buffer) throws LWJGLException; -} \ No newline at end of file +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <ma...@us...> - 2006-07-02 22:01:34
|
Revision: 2415 Author: matzon Date: 2006-07-02 15:01:27 -0700 (Sun, 02 Jul 2006) ViewCVS: http://svn.sourceforge.net/java-game-lib/?rev=2415&view=rev Log Message: ----------- add linux and mac natives to lwjgl applet jar Modified Paths: -------------- trunk/LWJGL/build.xml Modified: trunk/LWJGL/build.xml =================================================================== --- trunk/LWJGL/build.xml 2006-07-02 21:59:10 UTC (rev 2414) +++ trunk/LWJGL/build.xml 2006-07-02 22:01:27 UTC (rev 2415) @@ -356,8 +356,8 @@ </zip> <zip destfile="applet/lwjgl.jar" update="true"> <zipfileset dir="${lwjgl.lib}" prefix="native" includes="win32/**"/> -<!-- <zipfileset dir="${lwjgl.lib}" prefix="native" includes="linux/**"/> --> -<!-- <zipfileset dir="${lwjgl.lib}" prefix="native" includes="macosx/**"/> --> + <zipfileset dir="${lwjgl.lib}" prefix="native" includes="linux/**"/> + <zipfileset dir="${lwjgl.lib}" prefix="native" includes="macosx/**"/> </zip> <signjar jar="applet/lwjgl.jar" alias="lwjgl" keystore="applet/lwjglkeystore" storepass="123456"/> <signjar jar="applet/lwjgl_fmod3.jar" alias="lwjgl" keystore="applet/lwjglkeystore" storepass="123456"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <ma...@us...> - 2006-07-02 21:59:16
|
Revision: 2414 Author: matzon Date: 2006-07-02 14:59:10 -0700 (Sun, 02 Jul 2006) ViewCVS: http://svn.sourceforge.net/java-game-lib/?rev=2414&view=rev Log Message: ----------- support for version beta2 tag Modified Paths: -------------- trunk/LWJGL/src/native/common/devil/extil.c Modified: trunk/LWJGL/src/native/common/devil/extil.c =================================================================== --- trunk/LWJGL/src/native/common/devil/extil.c 2006-07-02 21:58:37 UTC (rev 2413) +++ trunk/LWJGL/src/native/common/devil/extil.c 2006-07-02 21:59:10 UTC (rev 2414) @@ -8,6 +8,17 @@ static void* devILhandle; #endif +static const char* VERSION = "1.0beta2"; + +/* + * Class: org_lwjgl_devil_ILNative + * Method: getNativeLibraryVersion + * Signature: ()Ljava/lang/String; + */ +JNIEXPORT jstring JNICALL Java_org_lwjgl_devil_ILNative_getNativeLibraryVersion(JNIEnv *env, jclass clazz) { + return NewStringNative(env, VERSION); +} + /** * Retrieves a function pointer from the devil library * @param function Name of function to retrieve This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <ma...@us...> - 2006-07-02 21:58:42
|
Revision: 2413 Author: matzon Date: 2006-07-02 14:58:37 -0700 (Sun, 02 Jul 2006) ViewCVS: http://svn.sourceforge.net/java-game-lib/?rev=2413&view=rev Log Message: ----------- beta2 tag Modified Paths: -------------- trunk/LWJGL/src/native/common/fmod3/org_lwjgl_fmod3_FMOD.c Modified: trunk/LWJGL/src/native/common/fmod3/org_lwjgl_fmod3_FMOD.c =================================================================== --- trunk/LWJGL/src/native/common/fmod3/org_lwjgl_fmod3_FMOD.c 2006-07-02 21:58:00 UTC (rev 2412) +++ trunk/LWJGL/src/native/common/fmod3/org_lwjgl_fmod3_FMOD.c 2006-07-02 21:58:37 UTC (rev 2413) @@ -33,7 +33,7 @@ #include "org_lwjgl_fmod3_FMOD.h" #include "extfmod3.h" -static const char* VERSION = "1.0beta"; +static const char* VERSION = "1.0beta2"; /* * Class: org_lwjgl_fmod3_FMOD This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <ma...@us...> - 2006-07-02 21:58:17
|
Revision: 2412 Author: matzon Date: 2006-07-02 14:58:00 -0700 (Sun, 02 Jul 2006) ViewCVS: http://svn.sourceforge.net/java-game-lib/?rev=2412&view=rev Log Message: ----------- beta2 tag Modified Paths: -------------- trunk/LWJGL/src/native/common/common_tools.c Modified: trunk/LWJGL/src/native/common/common_tools.c =================================================================== --- trunk/LWJGL/src/native/common/common_tools.c 2006-07-02 21:56:57 UTC (rev 2411) +++ trunk/LWJGL/src/native/common/common_tools.c 2006-07-02 21:58:00 UTC (rev 2412) @@ -48,7 +48,7 @@ #include "org_lwjgl_DefaultSysImplementation.h" static bool debug = false; -static const char* VERSION = "1.0beta"; +static const char* VERSION = "1.0beta2"; static JavaVM *jvm; void initAttribList(attrib_list_t *list) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <ma...@us...> - 2006-07-02 21:57:04
|
Revision: 2411 Author: matzon Date: 2006-07-02 14:56:57 -0700 (Sun, 02 Jul 2006) ViewCVS: http://svn.sourceforge.net/java-game-lib/?rev=2411&view=rev Log Message: ----------- preliminary applet support Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/Sys.java Modified: trunk/LWJGL/src/java/org/lwjgl/Sys.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/Sys.java 2006-07-02 21:55:09 UTC (rev 2410) +++ trunk/LWJGL/src/java/org/lwjgl/Sys.java 2006-07-02 21:56:57 UTC (rev 2411) @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002-2004 LWJGL Project + * Copyright (c) 2002-2006 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -31,6 +31,7 @@ */ package org.lwjgl; +import java.io.File; import java.lang.reflect.Method; import java.net.MalformedURLException; import java.net.URL; @@ -38,6 +39,7 @@ import java.security.PrivilegedAction; import java.security.PrivilegedExceptionAction; +import org.lwjgl.applet.LWJGLInstaller; import org.lwjgl.input.Mouse; /** @@ -51,15 +53,24 @@ public final class Sys { /** Current version of library */ - private static final String VERSION = "1.0beta"; + private static final String VERSION = "1.0beta2"; /** The implementation instance to delegate platform specific behavior to */ private final static SysImplementation implementation; - private static void loadLibrary(final String name) { + /** + * utility loadlibrary to load the native library using elevated priviledges + * @param name Name of library to load, or full path if usingPath is true + * @param usingPath true if using the full path to the native + */ + private static void loadLibrary(final String name, final boolean usingPath) { AccessController.doPrivileged(new PrivilegedAction() { public Object run() { - System.loadLibrary(name); + if(usingPath) { + System.load(name); + } else { + System.loadLibrary(name); + } return null; } }); @@ -71,15 +82,32 @@ UnsatisfiedLinkError last_load_error = null; for (int i = 0; i < library_names.length; i++) { try { - loadLibrary(library_names[i]); + loadLibrary(library_names[i], false); last_load_error = null; break; } catch (UnsatisfiedLinkError e) { last_load_error = e; } } - if (last_load_error != null) + + // failed normal loading - check installer + if (last_load_error != null && LWJGLInstaller.installed) { + for (int i = 0; i < library_names.length; i++) { + try { + loadLibrary(LWJGLInstaller.installDirectory + File.separator + System.mapLibraryName(library_names[i]), true); + last_load_error = null; + break; + } catch (UnsatisfiedLinkError e) { + last_load_error = e; + } + } + } + + // check for error + if (last_load_error != null) { throw last_load_error; + } + String native_version = implementation.getNativeLibraryVersion(); if (!native_version.equals(getVersion())) throw new LinkageError("Version mismatch: jar version is '" + getVersion() + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <ma...@us...> - 2006-07-02 21:55:24
|
Revision: 2410 Author: matzon Date: 2006-07-02 14:55:09 -0700 (Sun, 02 Jul 2006) ViewCVS: http://svn.sourceforge.net/java-game-lib/?rev=2410&view=rev Log Message: ----------- preliminary applet support Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/LWJGLUtil.java Modified: trunk/LWJGL/src/java/org/lwjgl/LWJGLUtil.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/LWJGLUtil.java 2006-07-02 21:51:53 UTC (rev 2409) +++ trunk/LWJGL/src/java/org/lwjgl/LWJGLUtil.java 2006-07-02 21:55:09 UTC (rev 2410) @@ -42,6 +42,8 @@ import java.util.List; import java.util.StringTokenizer; +import org.lwjgl.applet.LWJGLInstaller; + /** * <p> * Internal library methods @@ -52,12 +54,16 @@ * $Id$ */ public class LWJGLUtil { - public static final int PLATFORM_LINUX = 1; - public static final int PLATFORM_MACOSX = 2; - public static final int PLATFORM_WINDOWS = 3; + public static final int PLATFORM_LINUX = 1; + public static final int PLATFORM_MACOSX = 2; + public static final int PLATFORM_WINDOWS = 3; + public static final String PLATFORM_LINUX_NAME = "linux"; + public static final String PLATFORM_MACOSX_NAME = "macosx"; + public static final String PLATFORM_WINDOWS_NAME = "win32"; /** LWJGL Logo - 16 by 16 pixels */ - public static final ByteBuffer LWJGLIcon16x16 = BufferUtils.createByteBuffer(16 * 16 * 4).put(new byte[] { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + public static final ByteBuffer LWJGLIcon16x16 = BufferUtils.createByteBuffer(16 * 16 * 4).put(new byte[] { + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -2, -1, -1, -1, -62, -41, -24, -1, 116, -92, -53, -1, 80, -117, -67, -1, 84, -114, -65, -1, -122, -81, -46, -1, -25, -17, -10, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -11, -11, -11, -1, @@ -101,7 +107,8 @@ }); /** LWJGL Logo - 32 by 32 pixels */ - public static final ByteBuffer LWJGLIcon32x32 = BufferUtils.createByteBuffer(32 * 32 * 4).put(new byte[] { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + public static final ByteBuffer LWJGLIcon32x32 = BufferUtils.createByteBuffer(32 * 32 * 4).put(new byte[] { + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -6, -4, -3, -1, -53, -35, -20, -1, -109, -73, -42, -1, 111, -96, -55, -1, 92, -109, -62, -1, 96, -106, -61, -1, 122, -89, -51, -1, @@ -267,7 +274,10 @@ } /** - * Get the current platform + * @see #PLATFORM_WINDOWS + * @see #PLATFORM_LINUX + * @see #PLATFORM_MACOSX + * @return the current platform type */ public static int getPlatform() { String osName = System.getProperty("os.name"); @@ -282,8 +292,28 @@ throw new LinkageError("Unknown platform: " + osName); } } + /** + * @see #PLATFORM_WINDOWS_NAME + * @see #PLATFORM_LINUX_NAME + * @see #PLATFORM_MACOSX_NAME + * @return current platform name + */ + public static String getPlatformName() { + switch (LWJGLUtil.getPlatform()) { + case LWJGLUtil.PLATFORM_LINUX: + return "linux"; + case LWJGLUtil.PLATFORM_MACOSX: + return "macosx"; + case LWJGLUtil.PLATFORM_WINDOWS: + return "win32"; + default: + return "unknown"; + } + } + + /** * 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. @@ -326,6 +356,11 @@ possible_paths.add(lwjgl_classloader_path.substring(0, lwjgl_classloader_path.lastIndexOf(File.separator)) + File.separator + platform_lib_name); } + + // add Installer path + if (LWJGLInstaller.installed) { + possible_paths.add(LWJGLInstaller.installDirectory + File.separator + platform_lib_name); + } // Add all possible paths from java.library.path String java_library_path = (String)AccessController.doPrivileged(new PrivilegedAction() { @@ -348,7 +383,6 @@ }); possible_paths.add(current_dir + File.separator + platform_lib_name); - //add pure library (no path, let OS search) possible_paths.add(platform_lib_name); @@ -398,8 +432,7 @@ } /** - * Gets a boolean property as a privileged action. Helper method - * for native. + * Gets a boolean property as a privileged action. */ private static boolean getPrivilegedBoolean(final String property_name) { Boolean value = (Boolean)AccessController.doPrivileged(new PrivilegedAction() { @@ -408,7 +441,7 @@ } }); return value.booleanValue(); - } + } /** * Prints the given message to System.err if DEBUG is true. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <ma...@us...> - 2006-07-02 21:52:09
|
Revision: 2409 Author: matzon Date: 2006-07-02 14:51:53 -0700 (Sun, 02 Jul 2006) ViewCVS: http://svn.sourceforge.net/java-game-lib/?rev=2409&view=rev Log Message: ----------- preliminary applet support Added Paths: ----------- trunk/LWJGL/src/java/org/lwjgl/test/applet/AppletTest.java trunk/LWJGL/src/java/org/lwjgl/test/applet/OpenAL.java trunk/LWJGL/src/java/org/lwjgl/test/applet/OpenGL.java trunk/LWJGL/src/java/org/lwjgl/test/applet/Optional.java trunk/LWJGL/src/java/org/lwjgl/test/applet/Speed.java trunk/LWJGL/src/java/org/lwjgl/test/applet/Test.java Added: trunk/LWJGL/src/java/org/lwjgl/test/applet/AppletTest.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/test/applet/AppletTest.java (rev 0) +++ trunk/LWJGL/src/java/org/lwjgl/test/applet/AppletTest.java 2006-07-02 21:51:53 UTC (rev 2409) @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2006 LWJGL Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of 'LWJGL' nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.lwjgl.test.applet; + +import java.applet.Applet; +import java.awt.BorderLayout; +import java.awt.Canvas; +import java.awt.Toolkit; + +import org.lwjgl.LWJGLException; +import org.lwjgl.LWJGLUtil; +import org.lwjgl.applet.LWJGLInstaller; + +public class AppletTest extends Applet { + + Test test = null; + + @Override + public void destroy() { + super.destroy(); + System.out.println("*** destroy ***"); + } + + @Override + public void start() { + super.start(); + System.out.println("*** start ***"); + } + + @Override + public void stop() { + super.stop(); + System.out.println("*** stop ***"); + test.stop(); + } + + public void init() { + System.out.println("*** init ***"); + + try { + LWJGLInstaller.tempInstall(); + } catch (LWJGLException le) { + /* screwed */ + le.printStackTrace(); + } + + setLayout(new BorderLayout()); + try { + test = (Test) Class.forName(getParameter("test")).newInstance(); + Canvas canvas = (Canvas) test; + canvas.setSize(getWidth(), getHeight()); + add(canvas); + } catch (Exception e) { + e.printStackTrace(); + } + test.start(); + } +} Added: trunk/LWJGL/src/java/org/lwjgl/test/applet/OpenAL.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/test/applet/OpenAL.java (rev 0) +++ trunk/LWJGL/src/java/org/lwjgl/test/applet/OpenAL.java 2006-07-02 21:51:53 UTC (rev 2409) @@ -0,0 +1,183 @@ +/* + * Copyright (c) 2006 LWJGL Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of 'LWJGL' nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.lwjgl.test.applet; + +import java.nio.ByteBuffer; +import java.nio.IntBuffer; + +import org.lwjgl.BufferUtils; +import org.lwjgl.LWJGLException; +import org.lwjgl.openal.AL; +import org.lwjgl.openal.AL10; +import org.lwjgl.opengl.AWTGLCanvas; +import org.lwjgl.opengl.Display; +import org.lwjgl.opengl.GL11; +import org.lwjgl.util.WaveData; + +public class OpenAL extends AWTGLCanvas implements Test { + + float angle = 0; + + // create 1 buffer and 1 source + IntBuffer buffers = BufferUtils.createIntBuffer(1); + IntBuffer sources = BufferUtils.createIntBuffer(1); + + public OpenAL() throws LWJGLException { + + try { + AL.create(); + } catch (Exception e) { + System.out.println("Unable to create OpenAL.\nPlease make sure that OpenAL is available on this system. Exception: " + e); + return; + } + + Thread t = new Thread() { + + public void run() { + while (true) { + if (isVisible()) + repaint(); + Display.sync(60); + } + } + }; + t.setDaemon(true); + t.start(); + } + + private void playOpenAL() { + int lastError; + + // al generate buffers and sources + buffers.position(0).limit(1); + AL10.alGenBuffers(buffers); + if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) { + exit(lastError); + } + + sources.position(0).limit(1); + AL10.alGenSources(sources); + if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) { + exit(lastError); + } + + // load wave data from buffer + WaveData wavefile = WaveData.create(getClass().getClassLoader().getResourceAsStream("Footsteps.wav")); + + //copy to buffers + AL10.alBufferData(buffers.get(0), wavefile.format, wavefile.data, wavefile.samplerate); + + //unload file again + wavefile.dispose(); + + if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) { + exit(lastError); + } + + //set up source input + AL10.alSourcei(sources.get(0), AL10.AL_BUFFER, buffers.get(0)); + if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) { + exit(lastError); + } + + //lets loop the sound + AL10.alSourcei(sources.get(0), AL10.AL_LOOPING, AL10.AL_TRUE); + if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) { + exit(lastError); + } + + //play source 0 + AL10.alSourcePlay(sources.get(0)); + if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) { + exit(lastError); + } + } + + private void exit(int error) { + System.out.println("OpenAL Error: " + AL10.alGetString(error)); + } + + public void paintGL() { + GL11.glClear(GL11.GL_COLOR_BUFFER_BIT); + GL11.glMatrixMode(GL11.GL_PROJECTION_MATRIX); + GL11.glLoadIdentity(); + GL11.glOrtho(0, 640, 0, 480, 1, -1); + GL11.glMatrixMode(GL11.GL_MODELVIEW_MATRIX); + + GL11.glPushMatrix(); + GL11.glTranslatef(320, 240, 0.0f); + GL11.glRotatef(angle, 0, 0, 1.0f); + GL11.glBegin(GL11.GL_QUADS); + GL11.glVertex2i(-50, -50); + GL11.glVertex2i(50, -50); + GL11.glVertex2i(50, 50); + GL11.glVertex2i(-50, 50); + GL11.glEnd(); + GL11.glPopMatrix(); + + angle += 1; + + try { + swapBuffers(); + } catch (Exception e) {/*OK*/ + } + } + + public void start() { + playOpenAL(); + } + + public void stop() { + int lastError; + + //stop source 0 + AL10.alSourceStop(sources.get(0)); + if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) { + exit(lastError); + } + + //delete buffers and sources + sources.position(0).limit(1); + AL10.alDeleteSources(sources); + if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) { + exit(lastError); + } + + buffers.position(0).limit(1); + AL10.alDeleteBuffers(buffers); + if((lastError = AL10.alGetError()) != AL10.AL_NO_ERROR) { + exit(lastError); + } + + AL.destroy(); + } +} Added: trunk/LWJGL/src/java/org/lwjgl/test/applet/OpenGL.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/test/applet/OpenGL.java (rev 0) +++ trunk/LWJGL/src/java/org/lwjgl/test/applet/OpenGL.java 2006-07-02 21:51:53 UTC (rev 2409) @@ -0,0 +1,89 @@ +/* + * Copyright (c) 2006 LWJGL Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of 'LWJGL' nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.lwjgl.test.applet; + +import org.lwjgl.LWJGLException; +import org.lwjgl.opengl.AWTGLCanvas; +import org.lwjgl.opengl.Display; +import org.lwjgl.opengl.GL11; + +public class OpenGL extends AWTGLCanvas implements Test { + + float angle = 0; + + public OpenGL() throws LWJGLException { + Thread t = new Thread() { + + public void run() { + while (true) { + if (isVisible()) + repaint(); + Display.sync(60); + } + } + }; + t.setDaemon(true); + t.start(); + } + + public void paintGL() { + GL11.glClear(GL11.GL_COLOR_BUFFER_BIT); + GL11.glMatrixMode(GL11.GL_PROJECTION_MATRIX); + GL11.glLoadIdentity(); + GL11.glOrtho(0, 640, 0, 480, 1, -1); + GL11.glMatrixMode(GL11.GL_MODELVIEW_MATRIX); + + GL11.glPushMatrix(); + GL11.glTranslatef(320, 240, 0.0f); + GL11.glRotatef(angle, 0, 0, 1.0f); + GL11.glBegin(GL11.GL_QUADS); + GL11.glVertex2i(-50, -50); + GL11.glVertex2i(50, -50); + GL11.glVertex2i(50, 50); + GL11.glVertex2i(-50, 50); + GL11.glEnd(); + GL11.glPopMatrix(); + + angle += 1; + + try { + swapBuffers(); + } catch (Exception e) {/*OK*/ + } + } + + public void start() { + } + + public void stop() { + } +} Added: trunk/LWJGL/src/java/org/lwjgl/test/applet/Optional.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/test/applet/Optional.java (rev 0) +++ trunk/LWJGL/src/java/org/lwjgl/test/applet/Optional.java 2006-07-02 21:51:53 UTC (rev 2409) @@ -0,0 +1,244 @@ +/* + * Copyright (c) 2006 LWJGL Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of 'LWJGL' nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.lwjgl.test.applet; + +import java.io.BufferedInputStream; +import java.io.ByteArrayOutputStream; +import java.net.URL; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; +import java.nio.IntBuffer; + +import org.lwjgl.BufferUtils; +import org.lwjgl.LWJGLException; +import org.lwjgl.devil.IL; +import org.lwjgl.devil.ILU; +import org.lwjgl.devil.ILUT; +import org.lwjgl.devil.ILinfo; +import org.lwjgl.fmod3.FMOD; +import org.lwjgl.fmod3.FMusic; +import org.lwjgl.fmod3.FMusicModule; +import org.lwjgl.fmod3.FSound; +import org.lwjgl.openal.AL; +import org.lwjgl.openal.AL10; +import org.lwjgl.opengl.AWTGLCanvas; +import org.lwjgl.opengl.Display; +import org.lwjgl.opengl.GL11; +import org.lwjgl.test.devil.BasicTest; +import org.lwjgl.test.fmod3.StreamPlayerMemory; +import org.lwjgl.util.WaveData; + +public class Optional extends AWTGLCanvas implements Test { + + float angle = 0; + + FMusicModule module = null; + + public Optional() throws LWJGLException { + + try { + FMOD.create(); + } catch (Exception e) { + System.out.println("Unable to create FMOD.\nPlease make sure that FMOD is available on this system. Exception: " + e); + return; + } + + try { + IL.create(); + } catch (Exception e) { + System.out.println("Unable to load IL"); + return; + } + + try { + ILU.create(); + } catch (Exception e) { + System.out.println("Unable to load ILU"); + return; + } + + try { + ILUT.create(); + } catch (Exception e) { + System.out.println("Unable to load ILUT"); + return; + } + + + Thread t = new Thread() { + + public void run() { + while (true) { + if (isVisible()) + repaint(); + Display.sync(60); + } + } + }; + t.setDaemon(true); + t.start(); + } + + private void playFMOD() { + FSound.FSOUND_Init(44100, 32, 0); + ByteBuffer data = getData("Missing_you.mod"); + module = FMusic.FMUSIC_LoadSongEx(data, FSound.FSOUND_LOADMEMORY, null); + FMusic.FMUSIC_PlaySong(module); + } + + private ByteBuffer getData(String filename) { + ByteBuffer buffer = null; + + System.out.println("Attempting to load: " + filename); + + try { + BufferedInputStream bis = new BufferedInputStream(getClass().getClassLoader().getResourceAsStream(filename)); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + + int bufferLength = 4096; + byte[] readBuffer = new byte[bufferLength]; + int read = -1; + + while ((read = bis.read(readBuffer, 0, bufferLength)) != -1) { + baos.write(readBuffer, 0, read); + } + + //done reading, close + bis.close(); + + // place it in a buffer + buffer = ByteBuffer.allocateDirect(baos.size()); + buffer.order(ByteOrder.nativeOrder()); + buffer.put(baos.toByteArray()); + buffer.flip(); + System.out.println("loaded " + buffer.remaining() + " bytes"); + } catch (Exception ioe) { + ioe.printStackTrace(); + } + return buffer; + } + + public void paintGL() { + GL11.glClear(GL11.GL_COLOR_BUFFER_BIT); + GL11.glMatrixMode(GL11.GL_PROJECTION_MATRIX); + GL11.glLoadIdentity(); + GL11.glOrtho(0, 640, 0, 480, 1, -1); + GL11.glMatrixMode(GL11.GL_MODELVIEW_MATRIX); + + GL11.glPushMatrix(); + GL11.glTranslatef(320, 240, 0.0f); + GL11.glRotatef(angle, 0, 0, 1.0f); + GL11.glBegin(GL11.GL_QUADS); + GL11.glVertex2i(-50, -50); + GL11.glVertex2i(50, -50); + GL11.glVertex2i(50, 50); + GL11.glVertex2i(-50, 50); + GL11.glEnd(); + GL11.glPopMatrix(); + + angle += 1; + + try { + swapBuffers(); + } catch (Exception e) {/*OK*/ + } + } + + public void start() { + playFMOD(); + testDevil(); + } + + private void testDevil() { + IntBuffer im = BufferUtils.createIntBuffer(1); + IL.ilGenImages(im); + System.out.println("ilBindImage"); + IL.ilBindImage(im.get(0)); + IL.ilEnable(IL.IL_ORIGIN_SET); + IL.ilOriginFunc(IL.IL_ORIGIN_UPPER_LEFT); + System.out.println("error = " + ILU.iluErrorString(IL.ilGetError())); + try { + System.out.println("load lump = " + IL.ilLoadFromStream(getClass().getResourceAsStream("/ILtest.tga"), IL.IL_TGA)); + } catch (Exception e) { + e.printStackTrace(); + } + System.out.println("error = " + ILU.iluErrorString(IL.ilGetError())); + int newIm = IL.ilCloneCurImage(); + IL.ilCopyImage(im.get(0)); + IL.ilBindImage(newIm); + ByteBuffer buf = IL.ilGetData(); + System.out.println("ilGetData"); + System.out.println("error = " + ILU.iluErrorString(IL.ilGetError())); + int limit = buf.limit(); + System.out.println("limit = " + limit); + for (int i = 0; i < buf.limit(); i += 3) { + System.out.println(buf.get(i) + " " + buf.get(i + 1) + " " + buf.get(i + 2)); + } + + System.out.println("current image = " + im.get(0) + " IL.ilGetInteger(IL.IL_ACTIVE_IMAGE) = " + + IL.ilGetInteger(IL.IL_ACTIVE_IMAGE)); + System.out.println("Version: " + IL.ilGetInteger(IL.IL_VERSION_NUM)); + System.out.println("error = " + ILU.iluErrorString(IL.ilGetError())); + + ILinfo info = new ILinfo(); + ILU.iluGetImageInfo(info); + System.out.println("info.id = " + info.id); + System.out.println("info.width = " + info.width); + System.out.println("info.height = " + info.height); + System.out.println("info.depth = " + info.depth); + System.out.println("info.bpp = " + info.bpp); + System.out.println("info.sizeOfData = " + info.sizeOfData); + System.out.println("info.format = " + info.format); + System.out.println("info.type = " + info.type); + System.out.println("info.origin = " + info.origin); + System.out.println("info.palType = " + info.palType); + System.out.println("info.palSize = " + info.palSize); + System.out.println("info.numNext = " + info.numNext); + System.out.println("info.numMips = " + info.numMips); + System.out.println("info.numLayers = " + info.numLayers); + System.out.println("error = " + ILU.iluErrorString(IL.ilGetError())); + + System.out.println("ILUT Vendor: " + ILUT.ilutGetString(ILUT.ILUT_VENDOR)); + } + + public void stop() { + FMusic.FMUSIC_StopSong(module); + FMusic.FMUSIC_FreeSong(module); + FSound.FSOUND_Close(); + FMOD.destroy(); + ILUT.destroy(); + ILU.destroy(); + IL.destroy(); + + module = null; + } +} Added: trunk/LWJGL/src/java/org/lwjgl/test/applet/Speed.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/test/applet/Speed.java (rev 0) +++ trunk/LWJGL/src/java/org/lwjgl/test/applet/Speed.java 2006-07-02 21:51:53 UTC (rev 2409) @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2006 LWJGL Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of 'LWJGL' nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.lwjgl.test.applet; + +import org.lwjgl.LWJGLException; +import org.lwjgl.opengl.AWTGLCanvas; +import org.lwjgl.opengl.Display; +import org.lwjgl.opengl.GL11; + +public class Speed extends AWTGLCanvas implements Test { + + float angle = 0; + + public Speed() throws LWJGLException { + Thread t = new Thread() { + + public void run() { + long startTime = System.currentTimeMillis() + 5000; + long fps = 0; + + while (true) { + if (isVisible()) + repaint(); + try { + Thread.sleep(1); + } catch (InterruptedException inte) { + /* */ + } + if (startTime > System.currentTimeMillis()) { + fps++; + } else { + long timeUsed = 5000 + (startTime - System.currentTimeMillis()); + startTime = System.currentTimeMillis() + 5000; + System.out.println(fps + " frames in " + (float) (timeUsed / 1000f) + " seconds = " + + (fps / (timeUsed / 1000f))); + fps = 0; + } + } + } + }; + t.setDaemon(true); + t.start(); + } + + public void paintGL() { + GL11.glClear(GL11.GL_COLOR_BUFFER_BIT); + GL11.glMatrixMode(GL11.GL_PROJECTION_MATRIX); + GL11.glLoadIdentity(); + GL11.glOrtho(0, 640, 0, 480, 1, -1); + GL11.glMatrixMode(GL11.GL_MODELVIEW_MATRIX); + + GL11.glPushMatrix(); + GL11.glTranslatef(320, 240, 0.0f); + GL11.glRotatef(angle, 0, 0, 1.0f); + GL11.glBegin(GL11.GL_QUADS); + GL11.glVertex2i(-50, -50); + GL11.glVertex2i(50, -50); + GL11.glVertex2i(50, 50); + GL11.glVertex2i(-50, 50); + GL11.glEnd(); + GL11.glPopMatrix(); + + angle += 1; + + try { + swapBuffers(); + } catch (Exception e) {/*OK*/ + } + } + + public void start() { + } + + public void stop() { + } +} Added: trunk/LWJGL/src/java/org/lwjgl/test/applet/Test.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/test/applet/Test.java (rev 0) +++ trunk/LWJGL/src/java/org/lwjgl/test/applet/Test.java 2006-07-02 21:51:53 UTC (rev 2409) @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2006 LWJGL Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of 'LWJGL' nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.lwjgl.test.applet; + + +public interface Test { + public void start(); + public void stop(); +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <ma...@us...> - 2006-07-02 21:51:28
|
Revision: 2408 Author: matzon Date: 2006-07-02 14:51:22 -0700 (Sun, 02 Jul 2006) ViewCVS: http://svn.sourceforge.net/java-game-lib/?rev=2408&view=rev Log Message: ----------- preliminary applet support Added Paths: ----------- trunk/LWJGL/src/java/org/lwjgl/applet/ trunk/LWJGL/src/java/org/lwjgl/applet/LWJGLInstaller.java Added: trunk/LWJGL/src/java/org/lwjgl/applet/LWJGLInstaller.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/applet/LWJGLInstaller.java (rev 0) +++ trunk/LWJGL/src/java/org/lwjgl/applet/LWJGLInstaller.java 2006-07-02 21:51:22 UTC (rev 2408) @@ -0,0 +1,318 @@ +/* + * Copyright (c) 2006 LWJGL Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of 'LWJGL' nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +package org.lwjgl.applet; + +import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; +import java.io.File; +import java.io.FileFilter; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.security.AccessController; +import java.security.PrivilegedAction; + +import org.lwjgl.LWJGLException; +import org.lwjgl.LWJGLUtil; + +/** + * <p> + * + * </p> + * @author Brian Matzon <br...@ma...> + * @version $Revision$ + * $Id$ + */ +public class LWJGLInstaller { + + /** + * Files to install for each supported platform + * @see org.lwjgl.LWJGLUtil#getPlatform() + */ + public static final String[][] PLATFORM_FILES = { + { "lwjgl", "lwjgl-fmod3", "lwjgl-devil", "openal", "fmod", "IL", "ILU", "ILUT", "jinput-osx"}, + { "lwjgl", "lwjgl-fmod3", "lwjgl-devil", "openal", "fmod", "IL", "ILU", "ILUT", "jinput-linux"}, + { "lwjgl", "lwjgl-fmod3", "lwjgl-devil", "OpenAL32", "fmod", "DevIL", "ILU", "ILUT", "jinput-dx8", "jinput-raw"} + }; + + /** Whether the installer has been called */ + public static boolean installed; + + /** Whether to hook uninstall rutine. Must be called prior to installation */ + public static boolean disableUninstall = false; + + /** Directory that was installed into */ + public static String installDirectory; + + /** Buffer used when copying files */ + private static final byte[] COPY_BUFFER = new byte[4096]; + + private LWJGLInstaller() { + /* Unused */ + } + + /** + * Create a temporary installation of LWJGL. + * This will extract the relevant native files (for the platform) into + * the users temp directory, and instruct the LWJGL subsystem to load its + * native files from there. + * The files required by the installer, are gotten from the classloader via its + * getResource command, and are assumed to in the path: /native/<win32|linux|macosx>/ + * Any call to this method will also add a shutdown hook to the uninstall of the libraries + * Note: Due to the nature of native libraries, we cannot actually uninstall the currently + * loaded files, but rather the "last" installed. This means that the most recent install of LWJGL + * will always be present in the users temp dir. + * + * @see java.lang.ClassLoader#getResource(String) + * @return true if the installation was successfull + */ + public static boolean tempInstall() throws LWJGLException { + // only need to install once + if (installed) { + return true; + } + + // libraries to validate and install + String[] libraries = PLATFORM_FILES[LWJGLUtil.getPlatform() - 1]; + + // Validate the certificates of the native files + validateCertificates(); + + // install shutdown installer hook + if(!disableUninstall) { + AccessController.doPrivileged(new PrivilegedAction() { + public Object run() { + Runtime.getRuntime().addShutdownHook(new Thread() { + public void run() { + LWJGLInstaller.uninstall(); + } + }); + return null; + } + }); + } + + // create a temporary dir for the native files + String user_temp_dir = getPriveledgedString("java.io.tmpdir"); + String path = createTemporaryDir(user_temp_dir); + if(path == null) { + throw new LWJGLException("Failed creation of temporary directory in " + user_temp_dir); + } + + // extract natives + for (int i = 0; i < libraries.length; i++) { + String library = System.mapLibraryName(libraries[i]); + if(!extract(library, path)) { + LWJGLUtil.log("Failed extract of " + library + " to " + path); + uninstall(); + return false; + } + } + + installDirectory = path; + return installed = true; + } + + /** + * Validates the certificates of the native libraries. + * When installing native libraries, it is imperative that we also check the certficates. + * The reson for this, is that a user may inject a malicious jar to the classpath + * before the "real" LWJGL jar, containing native libraries with unwanted code. + * By forcing all the native libraries to have the same certificate as the signed + * installer, we can also be sure that the native libraries indeed are correct. + * @throws LWJGLException If we encounter a certificate mismatch + */ + private static void validateCertificates() throws LWJGLException { + /* TODO */ + } + + /** + * Extracts a file in the classpath to a specified dir + * + * @param file File to extract + * @param path Path to extract to + * @return true if the file was extracted successdully + */ + private static boolean extract(final String file, final String path) throws LWJGLException { + return (Boolean) AccessController.doPrivileged(new PrivilegedAction() { + public Object run() { + // check for existing file, and get out + File out = new File(path + File.separator + file); + if (out.exists()) { + return false; + } + + // create the new file and copy it to its destination + try { + out.createNewFile(); + String in = "/native/" + LWJGLUtil.getPlatformName() + "/" + file; + OutputStream os = new BufferedOutputStream(new FileOutputStream(out)); + InputStream is = new BufferedInputStream(getClass().getResourceAsStream(in)); + + // Sanity check + // =========================================== + if (os == null) { + LWJGLUtil.log("Unable to write to outputstream at " + out.getAbsolutePath()); + return false; + } + + if (is == null) { + LWJGLUtil.log("Unable to read classpath inputstream from " + in); + return false; + } + // ------------------------------------------- + + // copy the actual file + copyFile(is, os); + } catch (IOException ioe) { + LWJGLUtil.log("Exception while extracting " + file + ": " + ioe.getMessage()); + return false; + } + return true; + } + }); + } + + /** + * Copies an inputstream to an outputstream + * @param is InputStream to read from + * @param os OutputStream to write to + * @throws IOException if the copy process fail in any way + */ + static void copyFile(InputStream is, OutputStream os) throws IOException { + int len; + while ((len = is.read(COPY_BUFFER)) > 0) { + os.write(COPY_BUFFER, 0, len); + } + is.close(); + os.close(); + } + + /** + * Creates the temporary dir to store lwjgl files in. + * The temporary dir will be created in the users temp dir and + * called 'lwjgl-' and appended System.currentTimeMillis(). A watermark file + * called '.lwjglinstaller' will also be created in the directory. + * @return Name of temp directory or null if directory creation failed + */ + static String createTemporaryDir(final String user_temp_dir) { + return (String) AccessController.doPrivileged(new PrivilegedAction() { + public Object run() { + // create the temp directory + File tempDir = new File(user_temp_dir + File.separator + "lwjgl-" + System.currentTimeMillis()); + if(!tempDir.mkdir()) { + return null; + } + + // add the watermark file + // TODO: Write some info to the file ? + try { + File watermark = new File(tempDir.getAbsolutePath() + File.separator + ".lwjglinstaller"); + watermark.createNewFile(); + } catch (IOException ioe) { + return null; + } + return tempDir.getAbsolutePath(); + } + }); + } + + + /** + * Gets a property as a privileged action. + */ + private static String getPriveledgedString(final String property) { + return (String) AccessController.doPrivileged(new PrivilegedAction() { + public Object run() { + return System.getProperty(property); + } + }); + } + + /** + * Uninstalls any PREVIOUS installations + * We cannot uninstall the current installation, since the files are locked + * by the VM. + */ + private static void uninstall() { + LWJGLUtil.log("running LWJGL uninstaller"); + + // locate all installer dirs and uninstall them + AccessController.doPrivileged(new PrivilegedAction() { + public Object run() { + String temp = System.getProperty("java.io.tmpdir"); + File tempDir = new File(temp); + File[] files = tempDir.listFiles(new FileFilter() { + + /* + * @see java.io.FileFilter#accept(java.io.File) + */ + public boolean accept(File pathname) { + return pathname.getAbsolutePath().indexOf("lwjgl") != -1 && isInstallDirectory(pathname); + } + + /** + * Checks whether the specified directory is an install directory. + * This is done by checking for the watermark file + * @param directory Directory to check + * @return true if the directory is an install directory + */ + private boolean isInstallDirectory(File directory) { + File installFile = new File(directory.getAbsolutePath() + File.separator + ".lwjglinstaller"); + return installFile.exists(); + } + + }); + + // uninstall each of the dirs + for (int i = 0; i < files.length; i++) { + uninstall(files[i]); + } + return null; + } + }); + } + + /** + * Uninstall LWJGL from a directory. This deletes all the files in the directory + * and deletes the directory too. + * @param file directory to uninstall LWJGL from + */ + private static void uninstall(File file) { + File[] files = file.listFiles(); + for (int i = 0; i < files.length; i++) { + files[i].delete(); + } + file.delete(); + } +} \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <ma...@us...> - 2006-07-02 21:50:55
|
Revision: 2407 Author: matzon Date: 2006-07-02 14:50:50 -0700 (Sun, 02 Jul 2006) ViewCVS: http://svn.sourceforge.net/java-game-lib/?rev=2407&view=rev Log Message: ----------- preliminary applet support Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/fmod3/FMOD.java Modified: trunk/LWJGL/src/java/org/lwjgl/fmod3/FMOD.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/fmod3/FMOD.java 2006-07-02 21:47:09 UTC (rev 2406) +++ trunk/LWJGL/src/java/org/lwjgl/fmod3/FMOD.java 2006-07-02 21:50:50 UTC (rev 2407) @@ -31,13 +31,17 @@ */ package org.lwjgl.fmod3; +import java.io.File; import java.lang.reflect.Method; import java.nio.FloatBuffer; +import java.security.AccessController; +import java.security.PrivilegedAction; import java.util.ArrayList; import java.util.HashMap; import org.lwjgl.LWJGLException; import org.lwjgl.LWJGLUtil; +import org.lwjgl.applet.LWJGLInstaller; /** * <br> @@ -189,17 +193,8 @@ /** The native JNI library name */ private static String JNI_LIBRARY_NAME = "lwjgl-fmod3"; - /** The native library name on win32 */ - private static String FMOD_WIN32_LIBRARY_NAME = "fmod"; - - /** The native library name on win32 */ - private static String FMOD_LINUX_LIBRARY_NAME = "fmod"; - - /** The native library name on win32 */ - private static String FMOD_OSX_LIBRARY_NAME = "fmod"; - /** Version of FMOD */ - public static final String VERSION = "1.0beta"; + public static final String VERSION = "1.0beta2"; static { initialize(); @@ -214,7 +209,11 @@ } initialized = true; - System.loadLibrary(JNI_LIBRARY_NAME); + if (LWJGLInstaller.installed) { + loadLibrary(LWJGLInstaller.installDirectory + File.separator + System.mapLibraryName(JNI_LIBRARY_NAME), true); + } else { + loadLibrary(JNI_LIBRARY_NAME, false); + } // check for mismatch String nativeVersion = getNativeLibraryVersion(); @@ -229,6 +228,19 @@ callbacks[i] = new HashMap(); } } + + private static void loadLibrary(final String name, final boolean usingPath) { + AccessController.doPrivileged(new PrivilegedAction() { + public Object run() { + if(usingPath) { + System.load(name); + } else { + System.loadLibrary(name); + } + return null; + } + }); + } /** * Return the version of the native library This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <ma...@us...> - 2006-07-02 21:47:14
|
Revision: 2406 Author: matzon Date: 2006-07-02 14:47:09 -0700 (Sun, 02 Jul 2006) ViewCVS: http://svn.sourceforge.net/java-game-lib/?rev=2406&view=rev Log Message: ----------- added version check preliminary applet support Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/devil/ILNative.java Modified: trunk/LWJGL/src/java/org/lwjgl/devil/ILNative.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/devil/ILNative.java 2006-07-02 21:44:58 UTC (rev 2405) +++ trunk/LWJGL/src/java/org/lwjgl/devil/ILNative.java 2006-07-02 21:47:09 UTC (rev 2406) @@ -31,8 +31,13 @@ */ package org.lwjgl.devil; +import java.io.File; +import java.security.AccessController; +import java.security.PrivilegedAction; + import org.lwjgl.LWJGLException; import org.lwjgl.LWJGLUtil; +import org.lwjgl.applet.LWJGLInstaller; /** * <p> @@ -44,9 +49,45 @@ * $Id$ */ class ILNative { + + /** The native JNI library name */ + private static String JNI_LIBRARY_NAME = "lwjgl-devil"; + /** Version of IL */ + public static final String VERSION = "1.0beta2"; + + /** + * utility loadlibrary to load the native library using elevated priviledges + * @param name Name of library to load, or full path if usingPath is true + * @param usingPath true if using the full path to the native + */ + private static void loadLibrary(final String name, final boolean usingPath) { + AccessController.doPrivileged(new PrivilegedAction() { + public Object run() { + if(usingPath) { + System.load(name); + } else { + System.loadLibrary(name); + } + return null; + } + }); + } + static { - System.loadLibrary("lwjgl-devil"); + if (LWJGLInstaller.installed) { + loadLibrary(LWJGLInstaller.installDirectory + File.separator + System.mapLibraryName(JNI_LIBRARY_NAME), true); + } else { + loadLibrary(JNI_LIBRARY_NAME, false); + } + + // check for mismatch + String nativeVersion = getNativeLibraryVersion(); + if (!nativeVersion.equals(VERSION)) { + throw new LinkageError( + "Version mismatch: jar version is '" + VERSION + + "', native libary version is '" + nativeVersion + "'"); + } } // IL @@ -55,6 +96,7 @@ static native void resetNativeStubsIL(Class clazz); static native void nCreateIL(String[] ilPaths) throws LWJGLException; static native void nDestroyIL(); + private static native String getNativeLibraryVersion(); static void createIL() throws LWJGLException { String[] illPaths = LWJGLUtil.getLibraryPaths(new String[]{ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <ma...@us...> - 2006-07-02 21:45:05
|
Revision: 2405 Author: matzon Date: 2006-07-02 14:44:58 -0700 (Sun, 02 Jul 2006) ViewCVS: http://svn.sourceforge.net/java-game-lib/?rev=2405&view=rev Log Message: ----------- beta2 tag updated applet tag to build all libs needed Modified Paths: -------------- trunk/LWJGL/build.xml Modified: trunk/LWJGL/build.xml =================================================================== --- trunk/LWJGL/build.xml 2006-07-02 21:24:50 UTC (rev 2404) +++ trunk/LWJGL/build.xml 2006-07-02 21:44:58 UTC (rev 2405) @@ -13,7 +13,7 @@ <property name="lwjgl.docs" value="./doc" /> <property name="lwjgl.temp" value="./temp" /> <property name="lwjgl.res" value="./res" /> - <property name="lwjgl.version" value="1.0beta" /> + <property name="lwjgl.version" value="1.0beta2" /> <property name="opengl-template-pattern" value="org/lwjgl/opengl/GL*.java,org/lwjgl/opengl/ARB*.java,org/lwjgl/opengl/ATI*.java,org/lwjgl/opengl/EXT*.java,org/lwjgl/opengl/NV*.java,org/lwjgl/opengl/HP*.java,org/lwjgl/opengl/IBM*.java,org/lwjgl/opengl/SUN*.java"/> <!-- ================================================================== --> @@ -340,7 +340,6 @@ <jar destfile="${lwjgl.temp}/jar/lwjgl_devil.jar" taskname="lwjgl_devil.jar"> <fileset refid="lwjgl_devil.fileset" /> </jar> - </target> <target name="applet" depends="jars"> @@ -349,7 +348,20 @@ <fileset refid="lwjgl_applet.fileset" /> </jar> <copy file="${lwjgl.lib}/lwjgl.jar" todir="applet"/> + <copy file="${lwjgl.lib}/lwjgl_util.jar" todir="applet"/> + <copy file="${lwjgl.lib}/lwjgl_fmod3.jar" todir="applet"/> + <copy file="${lwjgl.lib}/lwjgl_devil.jar" todir="applet"/> + <zip destfile="applet/res.jar"> + <zipfileset dir="${lwjgl.res}" includes="Footsteps.wav, ILtest.tga, Missing_you.mod"/> + </zip> + <zip destfile="applet/lwjgl.jar" update="true"> + <zipfileset dir="${lwjgl.lib}" prefix="native" includes="win32/**"/> +<!-- <zipfileset dir="${lwjgl.lib}" prefix="native" includes="linux/**"/> --> +<!-- <zipfileset dir="${lwjgl.lib}" prefix="native" includes="macosx/**"/> --> + </zip> <signjar jar="applet/lwjgl.jar" alias="lwjgl" keystore="applet/lwjglkeystore" storepass="123456"/> + <signjar jar="applet/lwjgl_fmod3.jar" alias="lwjgl" keystore="applet/lwjglkeystore" storepass="123456"/> + <signjar jar="applet/lwjgl_devil.jar" alias="lwjgl" keystore="applet/lwjglkeystore" storepass="123456"/> </target> <!-- Distributes files --> @@ -440,7 +452,7 @@ <class name="org.lwjgl.opengl.WindowsDirectInput8" /> <class name="org.lwjgl.opengl.WindowsDirectInputDevice8" /> <class name="org.lwjgl.opengl.WindowsDirectInput3" /> - <class name="org.lwjgl.opengl.WindowsDirectInputDevice3" /> + <class name="org.lwjgl.opengl.WindowsDirectInputDevice3" /> <class name="org.lwjgl.opengl.Win32PbufferPeerInfo" /> <class name="org.lwjgl.opengl.Win32Display" /> <class name="org.lwjgl.opengl.Win32Registry" /> @@ -693,9 +705,8 @@ <delete dir="${lwjgl.temp}"/> <!-- unzip common files --> - <unzip src="${lwjgl.dist}/lwjgl-win32-${lwjgl.version}.zip" dest="${lwjgl.temp}/jnlp/temp" overwrite="true"/> - <unzip src="${lwjgl.dist}/lwjgl-linux-${lwjgl.version}.zip" dest="${lwjgl.temp}/jnlp/temp" overwrite="true"/> - <unzip src="${lwjgl.dist}/lwjgl-macosx-${lwjgl.version}.zip" dest="${lwjgl.temp}/jnlp/temp" overwrite="true"/> + <unzip src="${lwjgl.dist}/lwjgl-${lwjgl.version}.zip" dest="${lwjgl.temp}/jnlp/temp" overwrite="true"/> + <unzip src="${lwjgl.dist}/lwjgl_optional-${lwjgl.version}.zip" dest="${lwjgl.temp}/jnlp/temp" overwrite="true"/> <!-- move relevant files to root --> <move todir="${lwjgl.temp}/jnlp" flatten="true"> @@ -705,27 +716,33 @@ </move> <!-- create native jars --> - <jar destfile="${lwjgl.temp}/jnlp/native_win32.jar" basedir="${lwjgl.temp}/jnlp/temp/lwjgl-win32-${lwjgl.version}/native/"/> - <jar destfile="${lwjgl.temp}/jnlp/native_linux.jar" basedir="${lwjgl.temp}/jnlp/temp/lwjgl-linux-${lwjgl.version}/native/"/> - <jar destfile="${lwjgl.temp}/jnlp/native_macosx.jar" basedir="${lwjgl.temp}/jnlp/temp/lwjgl-macosx-${lwjgl.version}/native/"/> + <jar destfile="${lwjgl.temp}/jnlp/native_win32.jar" basedir="${lwjgl.temp}/jnlp/temp/lwjgl-${lwjgl.version}/native/win32"/> + <jar destfile="${lwjgl.temp}/jnlp/native_linux.jar" basedir="${lwjgl.temp}/jnlp/temp/lwjgl-${lwjgl.version}/native/linux"/> + <jar destfile="${lwjgl.temp}/jnlp/native_macosx.jar" basedir="${lwjgl.temp}/jnlp/temp/lwjgl-${lwjgl.version}/native/macosx"/> <!-- create media jar --> <jar destfile="${lwjgl.temp}/jnlp/media.jar" basedir="${lwjgl.res}"/> <!-- sign 'em --> <input message="Please enter store password:" addproperty="store.pwd" /> - <signjar jar="${lwjgl.temp}/jnlp/lwjgl.jar" alias="matzon" storepass="${store.pwd}"/> - <signjar jar="${lwjgl.temp}/jnlp/lwjgl_devil.jar" alias="matzon" storepass="${store.pwd}"/> - <signjar jar="${lwjgl.temp}/jnlp/lwjgl_fmod3.jar" alias="matzon" storepass="${store.pwd}"/> - <signjar jar="${lwjgl.temp}/jnlp/lwjgl_test.jar" alias="matzon" storepass="${store.pwd}"/> - <signjar jar="${lwjgl.temp}/jnlp/lwjgl_util.jar" alias="matzon" storepass="${store.pwd}"/> - <signjar jar="${lwjgl.temp}/jnlp/media.jar" alias="matzon" storepass="${store.pwd}"/> - <signjar jar="${lwjgl.temp}/jnlp/native_linux.jar" alias="matzon" storepass="${store.pwd}"/> - <signjar jar="${lwjgl.temp}/jnlp/native_macosx.jar" alias="matzon" storepass="${store.pwd}"/> - <signjar jar="${lwjgl.temp}/jnlp/native_win32.jar" alias="matzon" storepass="${store.pwd}"/> - <signjar jar="${lwjgl.temp}/jnlp/jinput.jar" alias="matzon" storepass="${store.pwd}"/> + <signjar jar="${lwjgl.temp}/jnlp/lwjgl.jar" storetype="pkcs12" keystore="matzon.p12" alias="Brian Matzon's TDC ID" storepass="${store.pwd}"/> + <signjar jar="${lwjgl.temp}/jnlp/lwjgl_devil.jar" storetype="pkcs12" keystore="matzon.p12" alias="Brian Matzon's TDC ID" storepass="${store.pwd}"/> + <signjar jar="${lwjgl.temp}/jnlp/lwjgl_fmod3.jar" storetype="pkcs12" keystore="matzon.p12" alias="Brian Matzon's TDC ID" storepass="${store.pwd}"/> + <signjar jar="${lwjgl.temp}/jnlp/lwjgl_test.jar" storetype="pkcs12" keystore="matzon.p12" alias="Brian Matzon's TDC ID" storepass="${store.pwd}"/> + <signjar jar="${lwjgl.temp}/jnlp/lwjgl_util.jar" storetype="pkcs12" keystore="matzon.p12" alias="Brian Matzon's TDC ID" storepass="${store.pwd}"/> + <signjar jar="${lwjgl.temp}/jnlp/media.jar" storetype="pkcs12" keystore="matzon.p12" alias="Brian Matzon's TDC ID" storepass="${store.pwd}"/> + <signjar jar="${lwjgl.temp}/jnlp/native_linux.jar" storetype="pkcs12" keystore="matzon.p12" alias="Brian Matzon's TDC ID" storepass="${store.pwd}"/> + <signjar jar="${lwjgl.temp}/jnlp/native_macosx.jar" storetype="pkcs12" keystore="matzon.p12" alias="Brian Matzon's TDC ID" storepass="${store.pwd}"/> + <signjar jar="${lwjgl.temp}/jnlp/native_win32.jar" storetype="pkcs12" keystore="matzon.p12" alias="Brian Matzon's TDC ID" storepass="${store.pwd}"/> + <signjar jar="${lwjgl.temp}/jnlp/jinput.jar" storetype="pkcs12" keystore="matzon.p12" alias="Brian Matzon's TDC ID" storepass="${store.pwd}"/> </target> + <!-- --> + <target name="signapplet"> + <input message="Please enter store password:" addproperty="store.pwd" /> + <signjar jar="applet_loader.jar" storetype="pkcs12" keystore="matzon.p12" alias="Brian Matzon's TDC ID" storepass="${store.pwd}"/> + </target> + <target name="changelog"> <cvschangelog destfile="changelog.xml"/> <style in="changelog.xml" out="changelog.html" style="${ant.home}/etc/changelog.xsl"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <ma...@us...> - 2006-07-02 21:24:59
|
Revision: 2404 Author: matzon Date: 2006-07-02 14:24:50 -0700 (Sun, 02 Jul 2006) ViewCVS: http://svn.sourceforge.net/java-game-lib/?rev=2404&view=rev Log Message: ----------- default to OpenGL test Modified Paths: -------------- trunk/LWJGL/applet/applet.html Modified: trunk/LWJGL/applet/applet.html =================================================================== --- trunk/LWJGL/applet/applet.html 2006-07-02 20:26:49 UTC (rev 2403) +++ trunk/LWJGL/applet/applet.html 2006-07-02 21:24:50 UTC (rev 2404) @@ -1,5 +1,7 @@ <html> <body> -<applet code="org.lwjgl.test.applet.LWJGLApplet" archive="lwjgl_applet.jar,lwjgl.jar" width="640" height="480"></applet> + <applet code="org.lwjgl.test.applet.AppletTest" archive="lwjgl_applet.jar,lwjgl.jar,res.jar,lwjgl_util.jar,lwjgl_fmod3.jar,lwjgl_devil.jar" width="640" height="480"> + <param name="test" value="org.lwjgl.test.applet.OpenGL"> + </applet> </body> </html> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <ma...@us...> - 2006-07-02 20:26:57
|
Revision: 2403 Author: matzon Date: 2006-07-02 13:26:49 -0700 (Sun, 02 Jul 2006) ViewCVS: http://svn.sourceforge.net/java-game-lib/?rev=2403&view=rev Log Message: ----------- made Display priveledged action private. Fixes a possible security exploit that would allow anyone to get a boolean from System properties *gasp* Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXFrame.java Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java 2006-07-01 05:33:14 UTC (rev 2402) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java 2006-07-02 20:26:49 UTC (rev 2403) @@ -711,7 +711,7 @@ /** * Gets a boolean property as a privileged action. */ - static boolean getPrivilegedBoolean(final String property_name) { + 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)); Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXFrame.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXFrame.java 2006-07-01 05:33:14 UTC (rev 2402) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXFrame.java 2006-07-02 20:26:49 UTC (rev 2403) @@ -48,6 +48,7 @@ import java.awt.event.WindowEvent; import java.awt.event.WindowListener; import java.security.AccessController; +import java.security.PrivilegedAction; import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; @@ -72,7 +73,7 @@ addComponentListener(this); canvas = new MacOSXGLCanvas(); add(canvas, BorderLayout.CENTER); - boolean undecorated = Display.getPrivilegedBoolean("org.lwjgl.opengl.Window.undecorated"); + boolean undecorated = getPrivilegedBoolean("org.lwjgl.opengl.Window.undecorated"); setUndecorated(fullscreen || undecorated); if ( fullscreen ) { try { @@ -212,4 +213,16 @@ } return result; } + + /** + * Gets a boolean property as a privileged action. + */ + 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(); + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |