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
|
From: <ma...@us...> - 2007-06-11 18:10:21
|
Revision: 2851 http://svn.sourceforge.net/java-game-lib/?rev=2851&view=rev Author: matzon Date: 2007-06-11 11:10:19 -0700 (Mon, 11 Jun 2007) Log Message: ----------- applied kappaOne's Permision denied handling made some minor cleanup Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java Modified: trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2007-06-10 20:31:41 UTC (rev 2850) +++ trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2007-06-11 18:10:19 UTC (rev 2851) @@ -47,7 +47,6 @@ import java.io.InputStream; import java.io.OutputStream; import java.lang.reflect.Method; -import java.net.MalformedURLException; import java.net.URL; import java.net.URLClassLoader; import java.net.URLConnection; @@ -165,9 +164,6 @@ /** urls of the jars to download */ protected URL[] urlList; - /** list of jars to download */ - protected String jarList; - /** actual thread that does the loading */ protected Thread loaderThread; @@ -197,6 +193,14 @@ "Plese contact support to resolve this issue.", "<placeholder for error message>"}; + /** whether a certificate refused error occured */ + protected boolean certificateRefused; + + /** error message to display if user refuses to accept certicate*/ + protected String[] certificateRefusedMessage = { "Permissions for Applet Refused.", + "Please accept the permissions dialog to allow", + "the applet to continue the loading process."}; + /* * @see java.applet.Applet#init() */ @@ -223,17 +227,10 @@ logo = getImage("/" + getParameter("al_logo")); progressbar = getImage("/" + getParameter("al_progressbar")); - // jars to load - jarList = getParameter("al_jars"); - //sanity check if(logo == null || progressbar == null) { fatalErrorOccured("Unable to load logo and progressbar images"); - return; } - - // parse the urls for the jars into the url list - loadJarURLs(); } /* @@ -247,7 +244,7 @@ animationThread = new Thread() { public void run() { - while(state != STATE_DONE) { + while(loaderThread != null) { repaint(); AppletLoader.this.sleep(100); } @@ -307,7 +304,7 @@ /* * @see java.awt.Container#paint(java.awt.Graphics) */ - public final synchronized void paint(Graphics g) { + public synchronized void paint(Graphics g) { // paint applet if available if(lwjglApplet != null && state == STATE_DONE) { @@ -337,49 +334,18 @@ } og.setColor(fgColor); - String message = null; + String message = getDescriptionForState(); - switch (state) { - case STATE_INIT: - message = "Initializing loader"; - break; - case STATE_DETERMINING_PACKAGES: - message = "Determining packages to load"; - break; - case STATE_CHECKING_CACHE: - message = "Checking cache for existing files"; - break; - case STATE_DOWNLOADING: - message = "Downloading packages"; - break; - case STATE_EXTRACTING_PACKAGES: - message = "Extracting downloaded packages"; - break; - case STATE_UPDATING_CLASSPATH: - message = "Updating classpath"; - break; - case STATE_SWITCHING_APPLET: - message = "Switching applet"; - break; - case STATE_INITIALIZE_REAL_APPLET: - message = "Initializing real applet"; - break; - case STATE_START_REAL_APPLET: - message = "Starting real applet"; - break; - case STATE_DONE: - message = "Done loading"; - break; - } - + // if we had a failure of some sort, notify the user if (fatalError) { - genericErrorMessage[genericErrorMessage.length-1] = fatalErrorDescription; - for(int i=0; i<genericErrorMessage.length; i++) { - int messageX = (getWidth() - fm.stringWidth(genericErrorMessage[i])) / 2; - int messageY = (getHeight() - (fm.getHeight() * genericErrorMessage.length)) / 2; + String[] errorMessage = (certificateRefused) ? certificateRefusedMessage : genericErrorMessage; + + for(int i=0; i<errorMessage.length; i++) { + int messageX = (getWidth() - fm.stringWidth(errorMessage[i])) / 2; + int messageY = (getHeight() - (fm.getHeight() * errorMessage.length)) / 2; og.setColor(errorColor); - og.drawString(genericErrorMessage[i], messageX, messageY + i*fm.getHeight()); + og.drawString(errorMessage[i], messageX, messageY + i*fm.getHeight()); } } else { og.setColor(fgColor); @@ -411,49 +377,77 @@ } /** + * @return string describing the state of the loader + */ + protected String getDescriptionForState() { + switch (state) { + case STATE_INIT: + return "Initializing loader"; + case STATE_DETERMINING_PACKAGES: + return "Determining packages to load"; + case STATE_CHECKING_CACHE: + return "Checking cache for existing files"; + case STATE_DOWNLOADING: + return "Downloading packages"; + case STATE_EXTRACTING_PACKAGES: + return "Extracting downloaded packages"; + case STATE_UPDATING_CLASSPATH: + return "Updating classpath"; + case STATE_SWITCHING_APPLET: + return "Switching applet"; + case STATE_INITIALIZE_REAL_APPLET: + return "Initializing real applet"; + case STATE_START_REAL_APPLET: + return "Starting real applet"; + case STATE_DONE: + return "Done loading"; + default: + return "unknown state"; + } + } + + /** * Reads list of jars to download and adds the urls to urlList * also finds out which OS you are on and adds appropriate native * jar to the urlList */ - protected void loadJarURLs() { + protected void loadJarURLs() throws Exception { state = STATE_DETERMINING_PACKAGES; - + + // jars to load + String jarList = getParameter("al_jars"); + StringTokenizer jar = new StringTokenizer(jarList, ", "); int jarCount = jar.countTokens() + 1; urlList = new URL[jarCount]; - try { - URL path = getCodeBase(); + URL path = getCodeBase(); - // set jars urls - for (int i = 0; i < jarCount - 1; i++) { - urlList[i] = new URL(path, jar.nextToken()); - } + // set jars urls + for (int i = 0; i < jarCount - 1; i++) { + urlList[i] = new URL(path, jar.nextToken()); + } - // native jar url - String osName = System.getProperty("os.name"); - String nativeJar = null; + // native jar url + String osName = System.getProperty("os.name"); + String nativeJar = null; + + if (osName.startsWith("Win")) { + nativeJar = getParameter("al_windows"); + } else if (osName.startsWith("Linux") || osName.startsWith("FreeBSD") || osName.startsWith("SunOS")) { + nativeJar = getParameter("al_linux"); + } else if (osName.startsWith("Mac")) { + nativeJar = getParameter("al_mac"); + } else { + fatalErrorOccured("OS (" + osName + ") not supported"); + } - if (osName.startsWith("Win")) { - nativeJar = getParameter("al_windows"); - } else if (osName.startsWith("Linux") || osName.startsWith("FreeBSD") || osName.startsWith("SunOS")) { - nativeJar = getParameter("al_linux"); - } else if (osName.startsWith("Mac")) { - nativeJar = getParameter("al_mac"); - } else { - fatalErrorOccured("OS (" + osName + ") not supported"); - } - - if (nativeJar == null) { - fatalErrorOccured("no lwjgl natives files found"); - } else { - urlList[jarCount - 1] = new URL(path, nativeJar); - } - - } catch (MalformedURLException e) { - fatalErrorOccured(e.getMessage()); + if (nativeJar == null) { + fatalErrorOccured("no lwjgl natives files found"); + } else { + urlList[jarCount - 1] = new URL(path, nativeJar); } } @@ -478,6 +472,9 @@ sleep(2000); } + // parse the urls for the jars into the url list + loadJarURLs(); + // get path where applet will be stored String path = (String) AccessController.doPrivileged(new PrivilegedExceptionAction() { public Object run() throws Exception { @@ -542,10 +539,12 @@ state = STATE_DONE; } catch (AccessControlException ace) { fatalErrorOccured(ace.getMessage()); + certificateRefused = true; } catch (Exception e) { fatalErrorOccured(e.getMessage()); } finally { loaderThread = null; + repaint(); } } @@ -797,6 +796,10 @@ subtaskMessage = ""; jarFile.close(); + + // delete native jar as it is no longer needed + File f = new File(path + nativeJar); + f.delete(); } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ma...@us...> - 2007-06-10 20:31:42
|
Revision: 2850 http://svn.sourceforge.net/java-game-lib/?rev=2850&view=rev Author: matzon Date: 2007-06-10 13:31:41 -0700 (Sun, 10 Jun 2007) Log Message: ----------- appletloader sample Added Paths: ----------- trunk/LWJGL/applet/appletloader.html Added: trunk/LWJGL/applet/appletloader.html =================================================================== --- trunk/LWJGL/applet/appletloader.html (rev 0) +++ trunk/LWJGL/applet/appletloader.html 2007-06-10 20:31:41 UTC (rev 2850) @@ -0,0 +1,57 @@ +<html><head><title>AppletLoader</title> + +<APPLET code="org.lwjgl.util.applet.AppletLoader" archive="lwjgl_util_applet.jar" codebase="." width="640" height="480"> + +<!-- The following tags are mandatory --> + +<!-- Name of Applet, will be used as name of directory it is saved in, and will uniquely identify it in cache --> +<param name="al_title" value="appletloadertest"> + +<!-- Main Applet Class --> +<param name="al_main" value="org.lwjgl.test.applet.AppletLoaderTest"> + +<!-- logo to paint while loading, will be centered --> +<param name="al_logo" value="appletlogo.png"> + +<!-- progressbar to paint while loading. Will be painted on top of logo, width clipped to percentage done --> +<param name="al_progressbar" value="appletprogress.gif"> + +<!-- List of Jars to add to classpath --> +<param name="al_jars" value="lwjgl_applet.jar, lwjgl.jar, jinput.jar, lwjgl_devil.jar, lwjgl_fmod3.jar, lwjgl_util.jar, res.jar"> + +<!-- signed windows natives jar in a jar --> +<param name="al_windows" value="windows_natives.jar"> + +<!-- signed linux natives jar in a jar --> +<param name="al_linux" value="linux_natives.jar"> + +<!-- signed mac osx natives jar in a jar --> +<param name="al_mac" value="macosx_natives.jar"> + +<!-- Tags under here are optional --> + +<!-- Version of Applet, important otherwise applet won't be cached, version change will update applet, must be int or float --> +<!-- <param name="al_version" value="0.1"> --> + +<!-- background color to paint with, defaults to white --> +<!-- <param name="al_bgcolor" value="000000"> --> + +<!-- foreground color to paint with, defaults to black --> +<!-- <param name="al_fgcolor" value="ffffff"> --> + +<!-- error color to paint with, defaults to red --> +<!-- <param name="al_errorcolor" value="ff0000"> --> + +<!-- whether to run in debug mode --> +<!-- <param name="al_debug" value="false"> --> + +<!-- main applet specific params --> +<param name="test" value="org.lwjgl.test.opengl.awt.AWTGearsCanvas"> + +</APPLET> + +<p> + if <code>al_debug</code> is true the applet will load and extract resources with a delay, to be able to see the loader process. +</p> + +</body></html> \ 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...> - 2007-06-10 20:31:11
|
Revision: 2849 http://svn.sourceforge.net/java-game-lib/?rev=2849&view=rev Author: matzon Date: 2007-06-10 13:31:09 -0700 (Sun, 10 Jun 2007) Log Message: ----------- support for AppletLoader Modified Paths: -------------- trunk/LWJGL/build.xml Modified: trunk/LWJGL/build.xml =================================================================== --- trunk/LWJGL/build.xml 2007-06-10 20:30:03 UTC (rev 2848) +++ trunk/LWJGL/build.xml 2007-06-10 20:31:09 UTC (rev 2849) @@ -77,6 +77,7 @@ <fileset id="lwjgl_applet.fileset" dir="${lwjgl.bin}"> <exclude name="**.*"/> <include name="org/lwjgl/test/applet/**"/> + <include name="org/lwjgl/test/opengl/awt/AWTGearsCanvas.class"/> </fileset> <!-- Files to make Javadoc from --> @@ -447,11 +448,12 @@ <include name="macosx_natives.jar"/> </fileset> </jar> - <delete file="applet/windows_natives.jar"/> - <delete file="applet/linux_natives.jar"/> - <delete file="applet/macosx_natives.jar"/> - <copy file="${lwjgl.lib}/lwjgl.jar" todir="applet"/> + <jar destfile="${lwjgl.lib}/lwjgl_util_applet.jar" update="true"> + <fileset dir="${lwjgl.res}" includes="applet*"/> + </jar> + + <copy file="${lwjgl.lib}/lwjgl.jar" todir="applet"/> <copy file="${lwjgl.lib}/lwjgl_util_applet.jar" todir="applet"/> <copy file="${lwjgl.lib}/lwjgl_util.jar" todir="applet"/> <copy file="${lwjgl.lib}/lwjgl_fmod3.jar" todir="applet"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ma...@us...> - 2007-06-10 20:30:06
|
Revision: 2848 http://svn.sourceforge.net/java-game-lib/?rev=2848&view=rev Author: matzon Date: 2007-06-10 13:30:03 -0700 (Sun, 10 Jun 2007) Log Message: ----------- initial checking on AppletLoader Added Paths: ----------- trunk/LWJGL/res/appletlogo.png trunk/LWJGL/res/appletprogress.gif trunk/LWJGL/src/java/org/lwjgl/test/applet/AppletLoaderTest.java trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java Added: trunk/LWJGL/res/appletlogo.png =================================================================== (Binary files differ) Property changes on: trunk/LWJGL/res/appletlogo.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/LWJGL/res/appletprogress.gif =================================================================== (Binary files differ) Property changes on: trunk/LWJGL/res/appletprogress.gif ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: trunk/LWJGL/src/java/org/lwjgl/test/applet/AppletLoaderTest.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/test/applet/AppletLoaderTest.java (rev 0) +++ trunk/LWJGL/src/java/org/lwjgl/test/applet/AppletLoaderTest.java 2007-06-10 20:30:03 UTC (rev 2848) @@ -0,0 +1,75 @@ +/* + * 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 org.lwjgl.opengl.AWTInputAdapter; + +public class AppletLoaderTest extends Applet { + + Test test = null; + + public void destroy() { + super.destroy(); + System.out.println("*** destroy ***"); + AWTInputAdapter.destroy(); + } + + public void start() { + super.start(); + System.out.println("*** start ***"); + } + + public void stop() { + super.stop(); + System.out.println("*** stop ***"); + test.stop(); + } + + public void init() { + System.out.println("*** init ***"); + + 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/util/applet/AppletLoader.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java (rev 0) +++ trunk/LWJGL/src/java/org/lwjgl/util/applet/AppletLoader.java 2007-06-10 20:30:03 UTC (rev 2848) @@ -0,0 +1,907 @@ +/* + * Copyright (c) 2002-2007 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.util.applet; + +import java.applet.Applet; +import java.applet.AppletStub; +import java.awt.Color; +import java.awt.FontMetrics; +import java.awt.Graphics; +import java.awt.GridLayout; +import java.awt.Image; +import java.awt.Toolkit; +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.InputStream; +import java.io.OutputStream; +import java.lang.reflect.Method; +import java.net.MalformedURLException; +import java.net.URL; +import java.net.URLClassLoader; +import java.net.URLConnection; +import java.security.AccessControlException; +import java.security.AccessController; +import java.security.PrivilegedExceptionAction; +import java.security.cert.Certificate; +import java.util.Enumeration; +import java.util.StringTokenizer; +import java.util.jar.JarEntry; +import java.util.jar.JarFile; + +/** + * <p> + * The AppletLoader enables deployment of LWJGL to applets in an easy + * and polished way. The loader will display a configurable logo and progressbar + * while the relevant jars (generic and native) are downloaded from a specified source. + * </p> + * <p> + * The downloaded are extracted to the users temporary directory - and if enabled, cached for + * faster loading in future uses. + * </p> + * <p> + * The following applet parameters are required: + * <ul> + * <li>al_main - [String] Full package and class the applet to instantiate and display when loaded.</li> + * <li>al_logo - [String Path of of the logo resource to paint while loading.</li> + * <li>al_progressbar - [String] Path of the progressbar resource to paint on top of the logo, width clipped by percentage.</li> + * <li>al_jars - [String] Comma seperated list of jars to download.</li> + * <li>al_windows - [String] Jar containing native files for windows.</li> + * <li>al_linux - [String] Jar containing native files for linux.</li> + * <li>al_mac - [String] Jar containing native files for mac.</li> + * </ul> + * </p> + * <p> + * Additionally the following parameters can be supplied to tweak the behaviour of the AppletLoader. + * <ul> + * <li>al_version - [int or float] Version of deployment. If this is specified, the jars will be cached and + * reused if the version matches. If version doesn't match all of the files are reloaded.</li> + * <li>al_bgcolor - [String] Hex formated color to use as background. <i>Default: ffffff</i>.</li> + * <li>al_fgcolor - [String] Hex formated color to use as foreground. <i>Default: 000000</i>.</li> + * <li>al_errorcolor - [String] Hex formated color to use as foreground color on error. <i>Default: ff0000</i>.</li> + * <li>al_debug - [boolean] Whether to enable debug mode. <i>Default: false</i>.</li> + * </ul> + * </p> + * @author kappaOne + * @author Brian Matzon <br...@ma...> + * @version $Revision$ + * $Id$ + */ +public class AppletLoader extends Applet implements Runnable, AppletStub { + /** initializing */ + public static final int STATE_INIT = 1; + + /** determining which packages that are required */ + public static final int STATE_DETERMINING_PACKAGES = 2; + + /** checking for already downloaded files */ + public static final int STATE_CHECKING_CACHE = 3; + + /** downloading packages */ + public static final int STATE_DOWNLOADING = 4; + + /** extracting packages */ + public static final int STATE_EXTRACTING_PACKAGES = 5; + + /** updating the classpath */ + public static final int STATE_UPDATING_CLASSPATH = 6; + + /** switching to real applet */ + public static final int STATE_SWITCHING_APPLET = 7; + + /** initializing real applet */ + public static final int STATE_INITIALIZE_REAL_APPLET = 8; + + /** stating real applet */ + public static final int STATE_START_REAL_APPLET = 9; + + /** done */ + public static final int STATE_DONE = 10; + + /** used to calculate length of progress bar */ + protected int percentage; + + /** current size of download in bytes */ + protected int currentSizeDownload; + + /** total size of download in bytes */ + protected int totalSizeDownload; + + /** current size of extracted in bytes */ + protected int currentSizeExtract; + + /** total size of extracted in bytes */ + protected int totalSizeExtract; + + /** logo to be shown while loading */ + protected Image logo; + + /** progressbar to render while loading */ + protected Image progressbar; + + /** offscreen image used */ + protected Image offscreen; + + /** background color of applet */ + protected Color bgColor = Color.white; + + /** Color to write errors in */ + protected Color errorColor = Color.red; + + /** color to write forground in */ + protected Color fgColor = Color.black; + + /** urls of the jars to download */ + protected URL[] urlList; + + /** list of jars to download */ + protected String jarList; + + /** actual thread that does the loading */ + protected Thread loaderThread; + + /** animation thread that renders our loaderscreen while loading */ + protected Thread animationThread; + + /** applet to load after all downloads are complete */ + protected Applet lwjglApplet; + + /** whether a fatal error occured */ + protected boolean fatalError; + + /** fatal error that occured */ + protected String fatalErrorDescription; + + /** whether we're running in debug mode */ + protected boolean debugMode; + + /** String to display as a subtask */ + protected String subtaskMessage = ""; + + /** state of applet loader */ + protected int state = STATE_INIT; + + /** generic error message to display on error */ + protected String[] genericErrorMessage = { "An error occured while loading the applet.", + "Plese contact support to resolve this issue.", + "<placeholder for error message>"}; + + /* + * @see java.applet.Applet#init() + */ + public void init() { + + // sanity check + String[] requiredArgs = {"al_main", "al_logo", "al_progressbar", "al_jars"}; + for(int i=0; i<requiredArgs.length; i++) { + if(getParameter(requiredArgs[i]) == null) { + fatalErrorOccured("missing required applet parameter: " + requiredArgs[i]); + return; + } + } + + // whether to run in debug mode + debugMode = getBooleanParameter("al_debug", false); + + // get colors of applet + bgColor = getColor("al_bgcolor", Color.white); + fgColor = getColor("al_fgcolor", Color.black); + errorColor = getColor("al_errorcolor", Color.red); + + // load logos + logo = getImage("/" + getParameter("al_logo")); + progressbar = getImage("/" + getParameter("al_progressbar")); + + // jars to load + jarList = getParameter("al_jars"); + + //sanity check + if(logo == null || progressbar == null) { + fatalErrorOccured("Unable to load logo and progressbar images"); + return; + } + + // parse the urls for the jars into the url list + loadJarURLs(); + } + + /* + * @see java.applet.Applet#start() + */ + public void start() { + if(loaderThread == null && !fatalError) { + loaderThread = new Thread(this); + loaderThread.setName("AppletLoader.loaderThread"); + loaderThread.start(); + + animationThread = new Thread() { + public void run() { + while(state != STATE_DONE) { + repaint(); + AppletLoader.this.sleep(100); + } + animationThread = null; + } + }; + animationThread.setName("AppletLoader.animationthread"); + animationThread.start(); + } + } + + /* + * @see java.applet.Applet#stop() + */ + public void stop() { + if (lwjglApplet != null) { + lwjglApplet.stop(); + } + super.stop(); + } + + /* + * @see java.applet.Applet#destroy() + */ + public void destroy() { + if (lwjglApplet != null) { + lwjglApplet.destroy(); + } + + progressbar = null; + logo = null; + + super.destroy(); + } + + /** + * Retrieves the applet that has been loaded. Usefull for liveconnect. + */ + public Applet getApplet() { + return lwjglApplet; + } + + /* + * @see java.applet.AppletStub#appletResize(int, int) + */ + public void appletResize(int width, int height) { + /* uhm? */ + } + + /* + * @see java.awt.Container#update(java.awt.Graphics) + */ + public final void update(Graphics g) { + paint(g); + } + + /* + * @see java.awt.Container#paint(java.awt.Graphics) + */ + public final synchronized void paint(Graphics g) { + + // paint applet if available + if(lwjglApplet != null && state == STATE_DONE) { + lwjglApplet.paint(g); + return; + } + + // create offscreen if missing + if (offscreen == null) { + offscreen = createImage(getWidth(), getHeight()); + } + + // draw everything onto an image before drawing to avoid flicker + Graphics og = offscreen.getGraphics(); + FontMetrics fm = og.getFontMetrics(); + + // set background color + og.setColor(bgColor); + og.fillRect(0, 0, getWidth(), getHeight()); + + // get logo position so its in the middle of applet + int x = 0, y = 0; + + if(logo != null && !fatalError) { + x = (getWidth() - logo.getWidth(this)) / 2; + y = (getHeight() - logo.getHeight(this)) / 2; + } + + og.setColor(fgColor); + String message = null; + + switch (state) { + case STATE_INIT: + message = "Initializing loader"; + break; + case STATE_DETERMINING_PACKAGES: + message = "Determining packages to load"; + break; + case STATE_CHECKING_CACHE: + message = "Checking cache for existing files"; + break; + case STATE_DOWNLOADING: + message = "Downloading packages"; + break; + case STATE_EXTRACTING_PACKAGES: + message = "Extracting downloaded packages"; + break; + case STATE_UPDATING_CLASSPATH: + message = "Updating classpath"; + break; + case STATE_SWITCHING_APPLET: + message = "Switching applet"; + break; + case STATE_INITIALIZE_REAL_APPLET: + message = "Initializing real applet"; + break; + case STATE_START_REAL_APPLET: + message = "Starting real applet"; + break; + case STATE_DONE: + message = "Done loading"; + break; + } + + if (fatalError) { + genericErrorMessage[genericErrorMessage.length-1] = fatalErrorDescription; + for(int i=0; i<genericErrorMessage.length; i++) { + int messageX = (getWidth() - fm.stringWidth(genericErrorMessage[i])) / 2; + int messageY = (getHeight() - (fm.getHeight() * genericErrorMessage.length)) / 2; + + og.setColor(errorColor); + og.drawString(genericErrorMessage[i], messageX, messageY + i*fm.getHeight()); + } + } else { + og.setColor(fgColor); + + // draw logo + og.drawImage(logo, x, y, null); + + // draw message + int messageX = (getWidth() - fm.stringWidth(message)) / 2; + int messageY = y + logo.getHeight(null) + 20; + og.drawString(message, messageX, messageY); + + // draw subtaskmessage, if any + if(subtaskMessage.length() > 0) { + messageX = (getWidth() - fm.stringWidth(subtaskMessage)) / 2; + og.drawString(subtaskMessage, messageX, messageY+20); + } + + // draw loading bar, clipping it depending on percentage done + int barSize = (progressbar.getWidth(this) * percentage) / 100; + og.clipRect(0, 0, x + barSize, getHeight()); + og.drawImage(progressbar, x, y, null); + } + + og.dispose(); + + // finally draw it all + g.drawImage(offscreen, 0, 0, null); + } + + /** + * Reads list of jars to download and adds the urls to urlList + * also finds out which OS you are on and adds appropriate native + * jar to the urlList + */ + protected void loadJarURLs() { + state = STATE_DETERMINING_PACKAGES; + + StringTokenizer jar = new StringTokenizer(jarList, ", "); + + int jarCount = jar.countTokens() + 1; + + urlList = new URL[jarCount]; + + try { + URL path = getCodeBase(); + + // set jars urls + for (int i = 0; i < jarCount - 1; i++) { + urlList[i] = new URL(path, jar.nextToken()); + } + + // native jar url + String osName = System.getProperty("os.name"); + String nativeJar = null; + + if (osName.startsWith("Win")) { + nativeJar = getParameter("al_windows"); + } else if (osName.startsWith("Linux") || osName.startsWith("FreeBSD") || osName.startsWith("SunOS")) { + nativeJar = getParameter("al_linux"); + } else if (osName.startsWith("Mac")) { + nativeJar = getParameter("al_mac"); + } else { + fatalErrorOccured("OS (" + osName + ") not supported"); + } + + if (nativeJar == null) { + fatalErrorOccured("no lwjgl natives files found"); + } else { + urlList[jarCount - 1] = new URL(path, nativeJar); + } + + } catch (MalformedURLException e) { + fatalErrorOccured(e.getMessage()); + } + } + + /** + * 4 steps + * + * 1) check version of applet and decide whether to download jars + * 2) download the jars + * 3) extract natives + * 4) add to jars to class path + * 5) switch applets + * + */ + public void run() { + + state = STATE_CHECKING_CACHE; + + percentage = 5; + + try { + if(debugMode) { + sleep(2000); + } + + // get path where applet will be stored + String path = (String) AccessController.doPrivileged(new PrivilegedExceptionAction() { + public Object run() throws Exception { + return System.getProperty("java.io.tmpdir") + File.separator + getParameter("al_title") + File.separator; + } + }); + + File dir = new File(path); + + // create directory + if (!dir.exists()) { + dir.mkdir(); + } + dir = new File(dir, "version"); + + // if applet already available don't download anything + boolean cacheAvailable = false; + + // version of applet + String version = getParameter("al_version"); + float latestVersion = 0; + + // if applet version specifed, check if you have latest version of applet + if (version != null) { + + latestVersion = Float.parseFloat(version); + + // if version file exists + if (dir.exists()) { + // compare to new version + if (latestVersion <= readVersionFile(dir)) { + cacheAvailable = true; + percentage = 90; + if(debugMode) { + sleep(2000); + } + } + } + } + + // if jars not available or need updating download them + if (!cacheAvailable) { + // downloads jars from the server + downloadJars(path); // 10-65% + + // Extracts Native Files + extractNatives(path); // 65-85% + + // add version information once jars downloaded successfully + if (version != null) { + percentage = 90; + writeVersionFile(dir, latestVersion); + } + } + + // add the downloaded jars and natives to classpath + updateClassPath(path); + + // switch to LWJGL Applet + switchApplet(); + + state = STATE_DONE; + } catch (AccessControlException ace) { + fatalErrorOccured(ace.getMessage()); + } catch (Exception e) { + fatalErrorOccured(e.getMessage()); + } finally { + loaderThread = null; + } + } + + /** + * read the current version file + * + * @param file the file to read + * @return the version value of saved file + * @throws Exception if it fails to read value + */ + protected float readVersionFile(File file) throws Exception { + DataInputStream dis = new DataInputStream(new FileInputStream(file)); + float version = dis.readFloat(); + dis.close(); + return version; + } + + /** + * write out version file of applet + * + * @param file the file to write out to + * @param version the version of the applet as a float + * @throws Exception if it fails to write file + */ + protected void writeVersionFile(File file, float version) throws Exception { + DataOutputStream dos = new DataOutputStream(new FileOutputStream(file)); + dos.writeFloat(version); + dos.close(); + } + + /** + * Edits the ClassPath at runtime to include the jars + * that have just been downloaded and then adds the + * lwjgl natives folder property. + * + * @param path location where applet is stored + * @throws Exception if it fails to add classpath + */ + protected void updateClassPath(String path) throws Exception { + + state = STATE_UPDATING_CLASSPATH; + + percentage = 95; + + Class[] parameters = new Class[] { URL.class}; + + // modify class path by adding downloaded jars to it + for (int i = 0; i < urlList.length; i++) { + // get location of jar as a url + URL u = new URL("file:" + path + getFileName(urlList[i])); + + // add to class path + Method method = URLClassLoader.class.getDeclaredMethod("addURL", parameters); + method.setAccessible(true); + method.invoke((URLClassLoader) ClassLoader.getSystemClassLoader(), new Object[] { u}); + } + + if(debugMode) { + sleep(2000); + } + + // add natives files path to native class path + System.setProperty("org.lwjgl.librarypath", path + "natives"); + + // Make sure jinput knows about the new path too + System.setProperty("net.java.games.input.librarypath", path + "natives"); + + // replace security system to avoid bug where vm fails to + // recognise downloaded jars as signed, when they are + System.setSecurityManager(null); + } + + /** + * replace the current applet with the lwjgl applet + * using AppletStub and initialise and start it + */ + protected void switchApplet() throws Exception { + + state = STATE_SWITCHING_APPLET; + percentage = 100; + + if(debugMode) { + sleep(2000); + } + + Class appletClass = Class.forName(getParameter("al_main")); + lwjglApplet = (Applet) appletClass.newInstance(); + + lwjglApplet.setStub(this); + + setLayout(new GridLayout(1, 1)); + add(lwjglApplet); + validate(); + + state = STATE_INITIALIZE_REAL_APPLET; + lwjglApplet.init(); + + state = STATE_START_REAL_APPLET; + lwjglApplet.start(); + } + + /** + * Will download the jars from the server using the list of urls + * in urlList, while at the same time updating progress bar + * + * @param path location of the directory to save to + * @throws Exception if download fails + */ + protected void downloadJars(String path) throws Exception { + + state = STATE_DOWNLOADING; + + URLConnection urlconnection; + + // calculate total size of jars to download + for (int i = 0; i < urlList.length; i++) { + urlconnection = urlList[i].openConnection(); + totalSizeDownload += urlconnection.getContentLength(); + } + + int initialPercentage = percentage = 10; + + // download each jar + byte buffer[] = new byte[65536]; + for (int i = 0; i < urlList.length; i++) { + if(debugMode) { + sleep(2000); + } + + urlconnection = urlList[i].openConnection(); + + String currentFile = getFileName(urlList[i]); + InputStream inputstream = urlconnection.getInputStream(); + FileOutputStream fos = new FileOutputStream(path + currentFile); + + + int bufferSize; + while ((bufferSize = inputstream.read(buffer, 0, buffer.length)) != -1) { + if(debugMode) { + sleep(10); + } + fos.write(buffer, 0, bufferSize); + currentSizeDownload += bufferSize; + percentage = initialPercentage + ((currentSizeDownload * 55) / totalSizeDownload); + subtaskMessage = "Retrieving: " + currentFile + " " + ((currentSizeDownload * 100) / totalSizeDownload) + "%"; + } + } + subtaskMessage = ""; + } + + /** + * This method will extract all file from the native jar and extract them + * to the subdirectory called "natives" in the local path, will also check + * to see if the native jar files is signed properly + * + * @param path base folder containing all downloaded jars + * @throws Exception if it fails to extract files + */ + protected void extractNatives(String path) throws Exception { + + state = STATE_EXTRACTING_PACKAGES; + + int initialPercentage = percentage; + + // get name of jar file with natives from urlList, it will be the last url + String nativeJar = getFileName(urlList[urlList.length - 1]); + + // get the current certificate to compare against native files + Certificate[] certificate = AppletLoader.class.getProtectionDomain().getCodeSource().getCertificates(); + + // create native folder + File nativeFolder = new File(path + "natives"); + if (!nativeFolder.exists()) { + nativeFolder.mkdir(); + } + + // open jar file + JarFile jarFile = new JarFile(path + nativeJar, true); + + // get list of files in jar + Enumeration entities = jarFile.entries(); + + totalSizeExtract = 0; + + // calculate the size of the files to extract for progress bar + while (entities.hasMoreElements()) { + JarEntry entry = (JarEntry) entities.nextElement(); + + // skip directories and anything in directories + // conveniently ignores the manifest + if (entry.isDirectory() || entry.getName().indexOf('/') != -1) { + continue; + } + totalSizeExtract += entry.getSize(); + } + + currentSizeExtract = 0; + + // reset point to begining by getting list of file again + entities = jarFile.entries(); + + // extract all files from the jar + while (entities.hasMoreElements()) { + JarEntry entry = (JarEntry) entities.nextElement(); + + // skip directories and anything in directories + // conveniently ignores the manifest + if (entry.isDirectory() || entry.getName().indexOf('/') != -1) { + continue; + } + + // check if native file already exists if so delete it to make room for new one + // useful when using the reload button on the browser + File f = new File(path + "natives" + File.separator + entry.getName()); + if (f.exists()) { + if (!f.delete()) { + continue; // unable to delete file, it is in use, skip extracting it + } + } + + if(debugMode) { + sleep(1000); + } + + InputStream in = jarFile.getInputStream(jarFile.getEntry(entry.getName())); + OutputStream out = new FileOutputStream(path + "natives" + File.separator + entry.getName()); + + int bufferSize; + byte buffer[] = new byte[65536]; + + while ((bufferSize = in.read(buffer, 0, buffer.length)) != -1) { + if(debugMode) { + sleep(10); + } + out.write(buffer, 0, bufferSize); + currentSizeExtract += bufferSize; + + // update progress bar + percentage = initialPercentage + ((currentSizeExtract * 20) / totalSizeExtract); + subtaskMessage = "Extracting: " + entry.getName() + " " + ((currentSizeExtract * 100) / totalSizeExtract) + "%"; + } + + // validate if the certificate for native file is correct + validateCertificateChain(certificate, entry.getCertificates()); + + in.close(); + out.close(); + } + subtaskMessage = ""; + + jarFile.close(); + } + + /** + * Validates the certificate chain for a single file + * + * @param ownCerts Chain of certificates to check against + * @param native_certs Chain of certificates to check + * @return true if the chains match + */ + protected static void validateCertificateChain(Certificate[] ownCerts, Certificate[] native_certs) throws Exception { + if (native_certs == null) + throw new Exception("Unable to validate certificate chain. Native entry did not have a certificate chain at all"); + + if (ownCerts.length != native_certs.length) + throw new Exception("Unable to validate certificate chain. Chain differs in length [" + ownCerts.length + " vs " + native_certs.length + "]"); + + for (int i = 0; i < ownCerts.length; i++) { + if (!ownCerts[i].equals(native_certs[i])) { + throw new Exception("Certificate mismatch: " + ownCerts[i] + " != " + native_certs[i]); + } + } + } + + /** + * Get Image from path provided + * + * @param s location of the image + * @return the Image file + */ + protected Image getImage(String s) { + try { + DataInputStream datainputstream = new DataInputStream(getClass().getResourceAsStream(s)); + byte abyte0[] = new byte[datainputstream.available()]; + datainputstream.readFully(abyte0); + datainputstream.close(); + return Toolkit.getDefaultToolkit().createImage(abyte0); + } catch (Exception e) { + /* */ + } + return null; + } + + + /** + * Get file name portion of URL. + * + * @param url Get file name from this url + * @return file name as string + */ + protected String getFileName(URL url) { + String fileName = url.getFile(); + return fileName.substring(fileName.lastIndexOf('/') + 1); + } + + /** + * Retrieves the color + * + * @param color Color to load + * @param defaultColor Default color to use if no color to load + * @return Color to use + */ + protected Color getColor(String color, Color defaultColor) { + String param_color = getParameter(color); + if (param_color != null) { + return new Color(Integer.parseInt(param_color, 16)); + } + return defaultColor; + } + + /** + * Retrieves the boolean value for the applet + * @param name Name of parameter + * @param defaultValue default value to return if no such parameter + * @return value of parameter or defaultValue + */ + protected boolean getBooleanParameter(String name, boolean defaultValue) { + String parameter = getParameter(name); + if(parameter != null) { + return Boolean.parseBoolean(parameter); + } + return defaultValue; + } + + /** + * Sets the state of the loaded and prints some debug information + * + * @param error Error message to print + * @param state State to enter + */ + protected void fatalErrorOccured(String error) { + fatalError = true; + fatalErrorDescription = "Fatal error occured (" + state + "): " + error; + System.out.println(fatalErrorDescription); + repaint(); + } + + /** + * Utility method for sleeping + * @param ms milliseconds to sleep + */ + protected void sleep(long ms) { + try { + Thread.sleep(ms); + } catch (Exception e) { + /* ignored */ + } + } +} \ 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...> - 2007-06-10 20:28:52
|
Revision: 2847 http://svn.sourceforge.net/java-game-lib/?rev=2847&view=rev Author: matzon Date: 2007-06-10 13:28:49 -0700 (Sun, 10 Jun 2007) Log Message: ----------- split gears implementation into own canvas, to be reused Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/test/opengl/awt/AWTGears.java Added Paths: ----------- trunk/LWJGL/src/java/org/lwjgl/test/opengl/awt/AWTGearsCanvas.java Modified: trunk/LWJGL/src/java/org/lwjgl/test/opengl/awt/AWTGears.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/test/opengl/awt/AWTGears.java 2007-06-06 13:56:03 UTC (rev 2846) +++ trunk/LWJGL/src/java/org/lwjgl/test/opengl/awt/AWTGears.java 2007-06-10 20:28:49 UTC (rev 2847) @@ -78,67 +78,7 @@ setTitle("Gears"); setSize(300, 300); setBackground(Color.BLACK); - add(canvas0 = new AWTGLCanvas() { - long startTime = 0; - long fps = 0; - int current_width; - int current_height; - public void paintGL() { - - if(startTime == 0) { - setup(); - startTime = System.currentTimeMillis() + 5000; - } - - try { - angle += 2.0f; - if (getWidth() != current_width || getHeight() != current_height) { - current_width = getWidth(); - current_height = getHeight(); - GL11.glViewport(0, 0, current_width, current_height); - } - GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT); - - GL11.glPushMatrix(); - GL11.glRotatef(view_rotx, 1.0f, 0.0f, 0.0f); - GL11.glRotatef(view_roty, 0.0f, 1.0f, 0.0f); - GL11.glRotatef(view_rotz, 0.0f, 0.0f, 1.0f); - - GL11.glPushMatrix(); - GL11.glTranslatef(-3.0f, -2.0f, 0.0f); - GL11.glRotatef(angle, 0.0f, 0.0f, 1.0f); - GL11.glCallList(gear1); - GL11.glPopMatrix(); - - GL11.glPushMatrix(); - GL11.glTranslatef(3.1f, -2.0f, 0.0f); - GL11.glRotatef(-2.0f * angle - 9.0f, 0.0f, 0.0f, 1.0f); - GL11.glCallList(gear2); - GL11.glPopMatrix(); - - GL11.glPushMatrix(); - GL11.glTranslatef(-3.1f, 4.2f, 0.0f); - GL11.glRotatef(-2.0f * angle - 25.0f, 0.0f, 0.0f, 1.0f); - GL11.glCallList(gear3); - GL11.glPopMatrix(); - - GL11.glPopMatrix(); - swapBuffers(); - repaint(); - } catch (LWJGLException e) { - throw new RuntimeException(e); - } - 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; - } - } - }); + add(new AWTGearsCanvas()); addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { dispose(); Added: trunk/LWJGL/src/java/org/lwjgl/test/opengl/awt/AWTGearsCanvas.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/test/opengl/awt/AWTGearsCanvas.java (rev 0) +++ trunk/LWJGL/src/java/org/lwjgl/test/opengl/awt/AWTGearsCanvas.java 2007-06-10 20:28:49 UTC (rev 2847) @@ -0,0 +1,325 @@ +/* + * Copyright (c) 2002-2005 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.opengl.awt; + +import java.nio.FloatBuffer; + +import org.lwjgl.BufferUtils; +import org.lwjgl.LWJGLException; +import org.lwjgl.opengl.ARBTransposeMatrix; +import org.lwjgl.opengl.AWTGLCanvas; +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GLContext; +import org.lwjgl.test.applet.Test; + +/** + * <p> + * AWT version of the gears demo + * <p> + * @version $Revision$ + * @author Brian Matzon <br...@ma...> + * $Id$ + */ +public class AWTGearsCanvas extends AWTGLCanvas implements Test { + + private float view_rotx = 20.0f; + + private float view_roty = 30.0f; + + private float view_rotz = 0.0f; + + private int gear1; + + private int gear2; + + private int gear3; + + private float angle = 0.0f; + + long startTime = 0; + long fps = 0; + int current_width; + int current_height; + + /** + * C'tor + */ + public AWTGearsCanvas() throws LWJGLException { + super(); + } + + public void paintGL() { + + if(startTime == 0) { + setup(); + startTime = System.currentTimeMillis() + 5000; + } + + try { + angle += 2.0f; + if (getWidth() != current_width || getHeight() != current_height) { + current_width = getWidth(); + current_height = getHeight(); + GL11.glViewport(0, 0, current_width, current_height); + } + GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT); + + GL11.glPushMatrix(); + GL11.glRotatef(view_rotx, 1.0f, 0.0f, 0.0f); + GL11.glRotatef(view_roty, 0.0f, 1.0f, 0.0f); + GL11.glRotatef(view_rotz, 0.0f, 0.0f, 1.0f); + + GL11.glPushMatrix(); + GL11.glTranslatef(-3.0f, -2.0f, 0.0f); + GL11.glRotatef(angle, 0.0f, 0.0f, 1.0f); + GL11.glCallList(gear1); + GL11.glPopMatrix(); + + GL11.glPushMatrix(); + GL11.glTranslatef(3.1f, -2.0f, 0.0f); + GL11.glRotatef(-2.0f * angle - 9.0f, 0.0f, 0.0f, 1.0f); + GL11.glCallList(gear2); + GL11.glPopMatrix(); + + GL11.glPushMatrix(); + GL11.glTranslatef(-3.1f, 4.2f, 0.0f); + GL11.glRotatef(-2.0f * angle - 25.0f, 0.0f, 0.0f, 1.0f); + GL11.glCallList(gear3); + GL11.glPopMatrix(); + + GL11.glPopMatrix(); + swapBuffers(); + repaint(); + } catch (LWJGLException e) { + throw new RuntimeException(e); + } + 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; + } + } + + private void setup() { + // setup ogl + FloatBuffer pos = BufferUtils.createFloatBuffer(4).put(new float[] { 5.0f, 5.0f, 10.0f, 0.0f}); + FloatBuffer red = BufferUtils.createFloatBuffer(4).put(new float[] { 0.8f, 0.1f, 0.0f, 1.0f}); + FloatBuffer green = BufferUtils.createFloatBuffer(4).put(new float[] { 0.0f, 0.8f, 0.2f, 1.0f}); + FloatBuffer blue = BufferUtils.createFloatBuffer(4).put(new float[] { 0.2f, 0.2f, 1.0f, 1.0f}); + pos.flip(); + red.flip(); + green.flip(); + blue.flip(); + + GL11.glLight(GL11.GL_LIGHT0, GL11.GL_POSITION, pos); + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_LIGHT0); + GL11.glEnable(GL11.GL_DEPTH_TEST); + + /* make the gears */ + gear1 = GL11.glGenLists(1); + GL11.glNewList(gear1, GL11.GL_COMPILE); + GL11.glMaterial(GL11.GL_FRONT, GL11.GL_AMBIENT_AND_DIFFUSE, red); + gear(1.0f, 4.0f, 1.0f, 20, 0.7f); + GL11.glEndList(); + + gear2 = GL11.glGenLists(1); + GL11.glNewList(gear2, GL11.GL_COMPILE); + GL11.glMaterial(GL11.GL_FRONT, GL11.GL_AMBIENT_AND_DIFFUSE, green); + gear(0.5f, 2.0f, 2.0f, 10, 0.7f); + GL11.glEndList(); + + gear3 = GL11.glGenLists(1); + GL11.glNewList(gear3, GL11.GL_COMPILE); + GL11.glMaterial(GL11.GL_FRONT, GL11.GL_AMBIENT_AND_DIFFUSE, blue); + gear(1.3f, 2.0f, 0.5f, 10, 0.7f); + GL11.glEndList(); + + GL11.glEnable(GL11.GL_NORMALIZE); + + GL11.glMatrixMode(GL11.GL_PROJECTION); + + System.err.println("GL_VENDOR: " + GL11.glGetString(GL11.GL_VENDOR)); + System.err.println("GL_RENDERER: " + GL11.glGetString(GL11.GL_RENDERER)); + System.err.println("GL_VERSION: " + GL11.glGetString(GL11.GL_VERSION)); + System.err.println(); + System.err.println("glLoadTransposeMatrixfARB() supported: " + GLContext.getCapabilities().GL_ARB_transpose_matrix); + if (!GLContext.getCapabilities().GL_ARB_transpose_matrix) { + // --- not using extensions + GL11.glLoadIdentity(); + } else { + // --- using extensions + final FloatBuffer identityTranspose = BufferUtils.createFloatBuffer(16).put( + new float[] { 1, 0, 0, 0, 0, 1, 0, 0, + 0, 0, 1, 0, 0, 0, 0, 1}); + identityTranspose.flip(); + ARBTransposeMatrix.glLoadTransposeMatrixARB(identityTranspose); + } + + float h = (float) 300 / (float) 300; + GL11.glFrustum(-1.0f, 1.0f, -h, h, 5.0f, 60.0f); + GL11.glMatrixMode(GL11.GL_MODELVIEW); + GL11.glLoadIdentity(); + GL11.glTranslatef(0.0f, 0.0f, -40.0f); + } + + /** + * Draw a gear wheel. You'll probably want to call this function when + * building a display list since we do a lot of trig here. + * + * @param inner_radius radius of hole at center + * @param outer_radius radius at center of teeth + * @param width width of gear + * @param teeth number of teeth + * @param tooth_depth depth of tooth + */ + private void gear(float inner_radius, float outer_radius, float width, int teeth, float tooth_depth) { + int i; + float r0, r1, r2; + float angle, da; + float u, v, len; + + r0 = inner_radius; + r1 = outer_radius - tooth_depth / 2.0f; + r2 = outer_radius + tooth_depth / 2.0f; + + da = 2.0f * (float) Math.PI / teeth / 4.0f; + + GL11.glShadeModel(GL11.GL_FLAT); + + GL11.glNormal3f(0.0f, 0.0f, 1.0f); + + /* draw front face */ + GL11.glBegin(GL11.GL_QUAD_STRIP); + for (i = 0; i <= teeth; i++) { + angle = i * 2.0f * (float) Math.PI / teeth; + GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), width * 0.5f); + GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), width * 0.5f); + if (i < teeth) { + GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), width * 0.5f); + GL11.glVertex3f(r1 * (float) Math.cos(angle + 3.0f * da), r1 * (float) Math.sin(angle + 3.0f * da), + width * 0.5f); + } + } + GL11.glEnd(); + + /* draw front sides of teeth */ + GL11.glBegin(GL11.GL_QUADS); + for (i = 0; i < teeth; i++) { + angle = i * 2.0f * (float) Math.PI / teeth; + GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), width * 0.5f); + GL11.glVertex3f(r2 * (float) Math.cos(angle + da), r2 * (float) Math.sin(angle + da), width * 0.5f); + GL11.glVertex3f(r2 * (float) Math.cos(angle + 2.0f * da), r2 * (float) Math.sin(angle + 2.0f * da), width * 0.5f); + GL11.glVertex3f(r1 * (float) Math.cos(angle + 3.0f * da), r1 * (float) Math.sin(angle + 3.0f * da), width * 0.5f); + } + GL11.glEnd(); + + /* draw back face */ + GL11.glBegin(GL11.GL_QUAD_STRIP); + for (i = 0; i <= teeth; i++) { + angle = i * 2.0f * (float) Math.PI / teeth; + GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), -width * 0.5f); + GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), -width * 0.5f); + GL11.glVertex3f(r1 * (float) Math.cos(angle + 3 * da), r1 * (float) Math.sin(angle + 3 * da), -width * 0.5f); + GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), -width * 0.5f); + } + GL11.glEnd(); + + /* draw back sides of teeth */ + GL11.glBegin(GL11.GL_QUADS); + for (i = 0; i < teeth; i++) { + angle = i * 2.0f * (float) Math.PI / teeth; + GL11.glVertex3f(r1 * (float) Math.cos(angle + 3 * da), r1 * (float) Math.sin(angle + 3 * da), -width * 0.5f); + GL11.glVertex3f(r2 * (float) Math.cos(angle + 2 * da), r2 * (float) Math.sin(angle + 2 * da), -width * 0.5f); + GL11.glVertex3f(r2 * (float) Math.cos(angle + da), r2 * (float) Math.sin(angle + da), -width * 0.5f); + GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), -width * 0.5f); + } + GL11.glEnd(); + + /* draw outward faces of teeth */ + GL11.glBegin(GL11.GL_QUAD_STRIP); + for (i = 0; i < teeth; i++) { + angle = i * 2.0f * (float) Math.PI / teeth; + GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), width * 0.5f); + GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), -width * 0.5f); + u = r2 * (float) Math.cos(angle + da) - r1 * (float) Math.cos(angle); + v = r2 * (float) Math.sin(angle + da) - r1 * (float) Math.sin(angle); + len = (float) Math.sqrt(u * u + v * v); + u /= len; + v /= len; + GL11.glNormal3f(v, -u, 0.0f); + GL11.glVertex3f(r2 * (float) Math.cos(angle + da), r2 * (float) Math.sin(angle + da), width * 0.5f); + GL11.glVertex3f(r2 * (float) Math.cos(angle + da), r2 * (float) Math.sin(angle + da), -width * 0.5f); + GL11.glNormal3f((float) Math.cos(angle), (float) Math.sin(angle), 0.0f); + GL11.glVertex3f(r2 * (float) Math.cos(angle + 2 * da), r2 * (float) Math.sin(angle + 2 * da), width * 0.5f); + GL11.glVertex3f(r2 * (float) Math.cos(angle + 2 * da), r2 * (float) Math.sin(angle + 2 * da), -width * 0.5f); + u = r1 * (float) Math.cos(angle + 3 * da) - r2 * (float) Math.cos(angle + 2 * da); + v = r1 * (float) Math.sin(angle + 3 * da) - r2 * (float) Math.sin(angle + 2 * da); + GL11.glNormal3f(v, -u, 0.0f); + GL11.glVertex3f(r1 * (float) Math.cos(angle + 3 * da), r1 * (float) Math.sin(angle + 3 * da), width * 0.5f); + GL11.glVertex3f(r1 * (float) Math.cos(angle + 3 * da), r1 * (float) Math.sin(angle + 3 * da), -width * 0.5f); + GL11.glNormal3f((float) Math.cos(angle), (float) Math.sin(angle), 0.0f); + } + GL11.glVertex3f(r1 * (float) Math.cos(0), r1 * (float) Math.sin(0), width * 0.5f); + GL11.glVertex3f(r1 * (float) Math.cos(0), r1 * (float) Math.sin(0), -width * 0.5f); + GL11.glEnd(); + + GL11.glShadeModel(GL11.GL_SMOOTH); + + /* draw inside radius cylinder */ + GL11.glBegin(GL11.GL_QUAD_STRIP); + for (i = 0; i <= teeth; i++) { + angle = i * 2.0f * (float) Math.PI / teeth; + GL11.glNormal3f(-(float) Math.cos(angle), -(float) Math.sin(angle), 0.0f); + GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), -width * 0.5f); + GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), width * 0.5f); + } + GL11.glEnd(); + } + + /* + * @see org.lwjgl.test.applet.Test#start() + */ + public void start() { + } + + /* + * @see org.lwjgl.test.applet.Test#stop() + */ + public void stop() { + } +} \ 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: Alexander P. <xt...@am...> - 2007-06-10 12:30:50
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> </head> <body bgcolor="#ffffff" text="#000000"> <img alt="shoe" src="http://nfhare.hk/unchanged.gif"><br> He does not own shares in any of the companies in this story.<br> " That's a sobering thought, but not to worry: There are still plenty of bargains to be found.<br> Shannon Zimmerman runs point on the Fool's Champion Funds newsletter service and co-advises Motley Fool Green Light with his pal Dayana Yochim. Sales and membership drive it allLook at the first page of Costco's annual report. In short, it's a great look for Ask.<br> is that layoffs and corporate reshufflings may cost them their hides.<br> He owns no shares of companies mentioned here. This is what savvy investors understand, and why they pay a premium to own the Costco store. If the next stock that's pitched to you doesn't possess these traits, then you're probably better off passing. Small companies offer individual investors like us many other advantages. Tap into the potential of this DBA community to expand your business!<br> Most institutional investors, who have billions of dollars to allocate, must avoid small caps at least until they grow larger. That's because the company is designed to create value and share it with consumers in the form of lower and lower prices.<br> Wal-Mart just announced that it is slowing new Supercenter growth to curb cannibalization.<br> The ace in the hole for Costco investors is that management cares more about their members than they do about Wall Street analysts. But history shows that the good outweighs the bad, and you can do better investing in stocks than in any other asset class. But a dividend is a positive indicator, a telling sign of both financial strength and management's confidence that the company will continue to be solid through good times and bad.<br> Our guess is that Sal wants to live better than that. Yet Costco's growth rate is no better than average, and it's actually slower than either Target's or Best Buy's.<br> com for guidance you had Jeeves the butler showing you around. In the book Thomas offers advice you can follow to avoid this syndrome.<br> Motley Fool contributor Timothy M.<br> Even better, they'll help you earn great returns for decades.<br> A marginal investmentLacking a reason to argue, I'd like to use my allotted space to add a little context to this discussion.<br> Beating the market with small-cap stocks, as we've been doing in Hidden Gems, is not as difficult as you might think. Flipping and flipping until the Miami condo market came down around him.<br> </body> </html> |
From: <eli...@us...> - 2007-06-06 13:56:05
|
Revision: 2846 http://svn.sourceforge.net/java-game-lib/?rev=2846&view=rev Author: elias_naur Date: 2007-06-06 06:56:03 -0700 (Wed, 06 Jun 2007) Log Message: ----------- Removed unused, private Display.getContext() Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java 2007-06-06 12:27:40 UTC (rev 2845) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java 2007-06-06 13:56:03 UTC (rev 2846) @@ -874,13 +874,6 @@ } /** - * @return the unique Display context (or null, if the Display has not been created) - */ - private static Context getContext() { - return context; - } - - /** * @return true if the window's native peer has been created */ public static boolean isCreated() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2007-06-06 12:27:42
|
Revision: 2845 http://svn.sourceforge.net/java-game-lib/?rev=2845&view=rev Author: elias_naur Date: 2007-06-06 05:27:40 -0700 (Wed, 06 Jun 2007) Log Message: ----------- Added gl extension/core aliases in BaseReferences Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/BaseReferences.java Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/BaseReferences.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/BaseReferences.java 2007-06-06 12:18:33 UTC (rev 2844) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/BaseReferences.java 2007-06-06 12:27:40 UTC (rev 2845) @@ -47,7 +47,7 @@ IntBuffer temp = caps.scratch_int_buffer; int max_vertex_attribs; - if (caps.GL_ARB_vertex_shader) { + if (caps.OpenGL20 || caps.GL_ARB_vertex_shader) { GL11.glGetInteger(ARBVertexShader.GL_MAX_VERTEX_ATTRIBS_ARB, temp); max_vertex_attribs = temp.get(0); } else @@ -55,7 +55,7 @@ glVertexAttribPointer_buffer = new Buffer[max_vertex_attribs]; int max_texture_units; - if (caps.OpenGL13) { + if (caps.OpenGL13 || caps.GL_ARB_multitexture) { GL11.glGetInteger(GL13.GL_MAX_TEXTURE_UNITS, temp); max_texture_units = temp.get(0); } else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2007-06-06 12:18:34
|
Revision: 2844 http://svn.sourceforge.net/java-game-lib/?rev=2844&view=rev Author: elias_naur Date: 2007-06-06 05:18:33 -0700 (Wed, 06 Jun 2007) Log Message: ----------- Missing change to ContextCapabilitiesGenerator from last commit Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/util/generator/ContextCapabilitiesGenerator.java Modified: trunk/LWJGL/src/java/org/lwjgl/util/generator/ContextCapabilitiesGenerator.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/util/generator/ContextCapabilitiesGenerator.java 2007-06-06 12:07:45 UTC (rev 2843) +++ trunk/LWJGL/src/java/org/lwjgl/util/generator/ContextCapabilitiesGenerator.java 2007-06-06 12:18:33 UTC (rev 2844) @@ -75,7 +75,6 @@ public static void generateInitializerPrologue(PrintWriter writer) { writer.println("\t" + Utils.CONTEXT_CAPS_CLASS_NAME + "() throws LWJGLException {"); writer.println("\t\tSet " + CACHED_EXTS_VAR_NAME + " = " + ALL_INIT_METHOD_NAME + "();"); - writer.println("\t\ttracker = new StateTracker();"); } private static String translateFieldName(String interface_name) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2007-06-06 12:07:53
|
Revision: 2843 http://svn.sourceforge.net/java-game-lib/?rev=2843&view=rev Author: elias_naur Date: 2007-06-06 05:07:45 -0700 (Wed, 06 Jun 2007) Log Message: ----------- Don't use GL13 and ARB_vertex_shader constants in BaseReferences if they're not supported Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/BaseReferences.java trunk/LWJGL/src/java/org/lwjgl/util/generator/ContextGeneratorProcessorFactory.java Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/BaseReferences.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/BaseReferences.java 2007-06-06 09:01:09 UTC (rev 2842) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/BaseReferences.java 2007-06-06 12:07:45 UTC (rev 2843) @@ -46,11 +46,21 @@ BaseReferences(ContextCapabilities caps) { IntBuffer temp = caps.scratch_int_buffer; - GL11.glGetInteger(ARBVertexShader.GL_MAX_VERTEX_ATTRIBS_ARB, temp); - glVertexAttribPointer_buffer = new Buffer[temp.get(0)]; + int max_vertex_attribs; + if (caps.GL_ARB_vertex_shader) { + GL11.glGetInteger(ARBVertexShader.GL_MAX_VERTEX_ATTRIBS_ARB, temp); + max_vertex_attribs = temp.get(0); + } else + max_vertex_attribs = 0; + glVertexAttribPointer_buffer = new Buffer[max_vertex_attribs]; - GL11.glGetInteger(GL13.GL_MAX_TEXTURE_UNITS, temp); - glTexCoordPointer_buffer = new Buffer[temp.get(0)]; + int max_texture_units; + if (caps.OpenGL13) { + GL11.glGetInteger(GL13.GL_MAX_TEXTURE_UNITS, temp); + max_texture_units = temp.get(0); + } else + max_texture_units = 0; + glTexCoordPointer_buffer = new Buffer[max_texture_units]; } void clear() { Modified: trunk/LWJGL/src/java/org/lwjgl/util/generator/ContextGeneratorProcessorFactory.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/util/generator/ContextGeneratorProcessorFactory.java 2007-06-06 09:01:09 UTC (rev 2842) +++ trunk/LWJGL/src/java/org/lwjgl/util/generator/ContextGeneratorProcessorFactory.java 2007-06-06 12:07:45 UTC (rev 2843) @@ -168,6 +168,7 @@ if (Utils.isFinal(interface_decl)) ContextCapabilitiesGenerator.generateInitializer(writer, interface_decl); } + writer.println("\t\ttracker = new StateTracker();"); writer.println("\t}"); writer.println("}"); writer.close(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2007-06-06 09:01:10
|
Revision: 2842 http://svn.sourceforge.net/java-game-lib/?rev=2842&view=rev Author: elias_naur Date: 2007-06-06 02:01:09 -0700 (Wed, 06 Jun 2007) Log Message: ----------- Removed dead code from WindowsKeyboard Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsKeyboard.java Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsKeyboard.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsKeyboard.java 2007-06-06 08:38:45 UTC (rev 2841) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsKeyboard.java 2007-06-06 09:01:09 UTC (rev 2842) @@ -112,7 +112,6 @@ } private int translateShift(int scan_code, byte state) { - int state_mask = state != 0 ? 0x8000 : 0x0000; if (checkShiftKey(WindowsKeycodes.VK_LSHIFT, state)) { return WindowsKeycodes.VK_LSHIFT; } else if (checkShiftKey(WindowsKeycodes.VK_RSHIFT, state)) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2007-06-06 08:38:49
|
Revision: 2841 http://svn.sourceforge.net/java-game-lib/?rev=2841&view=rev Author: elias_naur Date: 2007-06-06 01:38:45 -0700 (Wed, 06 Jun 2007) Log Message: ----------- Tweaked KeyboardTest Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/test/input/KeyboardTest.java Modified: trunk/LWJGL/src/java/org/lwjgl/test/input/KeyboardTest.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/test/input/KeyboardTest.java 2007-06-05 16:52:01 UTC (rev 2840) +++ trunk/LWJGL/src/java/org/lwjgl/test/input/KeyboardTest.java 2007-06-06 08:38:45 UTC (rev 2841) @@ -150,7 +150,7 @@ int character_code = ((int)Keyboard.getEventCharacter()) & 0xffff; System.out.println("Checking key:" + Keyboard.getKeyName(Keyboard.getEventKey())); System.out.println("Pressed:" + Keyboard.getEventKeyState()); - System.out.println("Key character code: " + character_code); + System.out.println("Key character code: 0x" + Integer.toHexString(character_code)); System.out.println("Key character: " + Keyboard.getEventCharacter()); System.out.println("Repeat event: " + Keyboard.isRepeatEvent()); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2007-06-05 16:52:03
|
Revision: 2840 http://svn.sourceforge.net/java-game-lib/?rev=2840&view=rev Author: elias_naur Date: 2007-06-05 09:52:01 -0700 (Tue, 05 Jun 2007) Log Message: ----------- Fixed svn properties on WindowsKeycodes.java Property Changed: ---------------- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsKeycodes.java Property changes on: trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsKeycodes.java ___________________________________________________________________ Name: svn:executable - * Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2007-06-05 16:33:35
|
Revision: 2839 http://svn.sourceforge.net/java-game-lib/?rev=2839&view=rev Author: elias_naur Date: 2007-06-05 09:33:33 -0700 (Tue, 05 Jun 2007) Log Message: ----------- Removed unused org.lwjgl.util.IGL Removed Paths: ------------- trunk/LWJGL/src/java/org/lwjgl/util/IGL.java Deleted: trunk/LWJGL/src/java/org/lwjgl/util/IGL.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/util/IGL.java 2007-05-31 22:09:46 UTC (rev 2838) +++ trunk/LWJGL/src/java/org/lwjgl/util/IGL.java 2007-06-05 16:33:33 UTC (rev 2839) @@ -1,5594 +0,0 @@ -/* - * Copyright (c) 2002-2004 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.util; - -import java.nio.ByteBuffer; -import java.nio.DoubleBuffer; -import java.nio.FloatBuffer; -import java.nio.IntBuffer; -import java.nio.ShortBuffer; - -/** - * OpenGL1.1, 1.2, 1.3, 1.4, 1.5, and all the EXT and ARB extensions in the LWJGL library. Its main purpose is to stop - * object-oriented zealots annoying us any more. - * - * @author $Author$ - * @version $Revision$ - * $Id$ This is an interface describing an Object that can render using - */ -public interface IGL { - - /** - * @param op - * @param value - */ - void glAccum(int op, float value); - - /** - * @param func - * @param ref - */ - void glAlphaFunc(int func, float ref); - - /** - * @param i - */ - void glArrayElement(int i); - - /** - * @param mode - */ - void glBegin(int mode); - - /** - * @param target - * @param texture - */ - void glBindTexture(int target, int texture); - - /** - * @param width - * @param height - * @param xorig - * @param yorig - * @param xmove - * @param ymove - * @param bitmap - */ - void glBitmap(int width, int height, float xorig, float yorig, float xmove, float ymove, ByteBuffer bitmap); - - /** - * - * @param width - * @param height - * @param xorig - * @param yorig - * @param xmove - * @param ymove - * @param buffer_offect - */ - void glBitmap(int width, int height, float xorig, float yorig, float xmove, float ymove, int buffer_offect); - - /** - * @param sfactor - * @param dfactor - */ - void glBlendFunc(int sfactor, int dfactor); - - /** - * @param list - */ - void glCallList(int list); - - /** - * @param lists - */ - void glCallLists(ByteBuffer lists); - - /** - * @param lists - */ - void glCallLists(IntBuffer lists); - - /** - * @param lists - */ - void glCallLists(ShortBuffer lists); - - /** - * @param mask - */ - void glClear(int mask); - - /** - * @param red - * @param green - * @param blue - * @param alpha - */ - void glClearAccum(float red, float green, float blue, float alpha); - - /** - * @param red - * @param green - * @param blue - * @param alpha - */ - void glClearColor(float red, float green, float blue, float alpha); - - /** - * @param depth - */ - void glClearDepth(double depth); - - /** - * @param c - */ -// void glClearIndex(float c); - - /** - * @param s - */ - void glClearStencil(int s); - - /** - * @param plane - * @param equation - */ - void glClipPlane(int plane, DoubleBuffer equation); - - /** - * @param red - * @param green - * @param blue - */ - void glColor3b(byte red, byte green, byte blue); - - /** - * @param red - * @param green - * @param blue - */ - void glColor3f(float red, float green, float blue); - - /** - * @param red - * @param green - * @param blue - */ - void glColor3ub(byte red, byte green, byte blue); - - /** - * @param red - * @param green - * @param blue - * @param alpha - */ - void glColor4b(byte red, byte green, byte blue, byte alpha); - - /** - * @param red - * @param green - * @param blue - * @param alpha - */ - void glColor4f(float red, float green, float blue, float alpha); - - /** - * @param red - * @param green - * @param blue - * @param alpha - */ - void glColor4ub(byte red, byte green, byte blue, byte alpha); - - /** - * @param red - * @param green - * @param blue - * @param alpha - */ - void glColorMask(boolean red, boolean green, boolean blue, boolean alpha); - - /** - * @param face - * @param mode - */ - void glColorMaterial(int face, int mode); - - /** - * @param size - * @param unsigned - * @param stride - * @param pointer - */ - void glColorPointer(int size, boolean unsigned, int stride, ByteBuffer pointer); - - /** - * @param size - * @param stride - * @param pointer - */ - void glColorPointer(int size, int stride, FloatBuffer pointer); - - /** - * @param size - * @param type - * @param stride - * @param buffer_offset - */ - void glColorPointer(int size, int type, int stride, int buffer_offset); - - /** - * @param x - * @param y - * @param width - * @param height - * @param type - */ - void glCopyPixels(int x, int y, int width, int height, int type); - - /** - * @param target - * @param level - * @param internalFormat - * @param x - * @param y - * @param width - * @param border - */ - void glCopyTexImage1D(int target, int level, int internalFormat, int x, int y, int width, int border); - - - /** - * @param target - * @param level - * @param internalFormat - * @param x - * @param y - * @param width - * @param height - * @param border - */ - void glCopyTexImage2D(int target, int level, int internalFormat, int x, int y, int width, int height, int border); - - - /** - * @param target - * @param level - * @param xoffset - * @param x - * @param y - * @param width - */ - void glCopyTexSubImage1D(int target, int level, int xoffset, int x, int y, int width); - - /** - * @param target - * @param level - * @param xoffset - * @param yoffset - * @param x - * @param y - * @param width - * @param height - */ - void glCopyTexSubImage2D(int target, int level, int xoffset, int yoffset, int x, int y, int width, int height); - - - /** - * @param mode - */ - void glCullFace(int mode); - - /** - * @param list - * @param range - */ - void glDeleteLists(int list, int range); - - /** - * @param textures - */ - void glDeleteTextures(IntBuffer textures); - - /** - * @param func - */ - void glDepthFunc(int func); - - /** - * @param flag - */ - void glDepthMask(boolean flag); - - /** - * @param zNear - * @param zFar - */ - void glDepthRange(double zNear, double zFar); - - /** - * @param cap - */ - void glDisable(int cap); - - /** - * @param cap - */ - void glDisableClientState(int cap); - - /** - * @param mode - * @param first - * @param count - */ - void glDrawArrays(int mode, int first, int count); - - /** - * @param mode - */ - void glDrawBuffer(int mode); - - /** - * @param mode - * @param indices - */ - void glDrawElements(int mode, ByteBuffer indices); - - /** - * @param mode - * @param count - * @param type - * @param buffer_offset - */ - void glDrawElements(int mode, int count, int type, int buffer_offset); - - /** - * @param mode - * @param indices - */ - void glDrawElements(int mode, IntBuffer indices); - - /** - * @param mode - * @param indices - */ - void glDrawElements(int mode, ShortBuffer indices); - - /** - * @param width - * @param height - * @param format - * @param type - * @param pixels - */ - void glDrawPixels(int width, int height, int format, int type, ByteBuffer pixels); - - /** - * @param width - * @param height - * @param format - * @param type - * @param pixels - */ - void glDrawPixels(int width, int height, int format, int type, IntBuffer pixels); - - /** - * @param width - * @param height - * @param format - * @param type - * @param pixels - */ - void glDrawPixels(int width, int height, int format, int type, ShortBuffer pixels); - - /** - * - * @param width - * @param height - * @param format - * @param type - * @param buffer_offset - */ - void glDrawPixels(int width, int height, int format, int type, int buffer_offset); - - /** - * @param flag - */ - void glEdgeFlag(boolean flag); - - /** - * @param stride - * @param pointer - */ - void glEdgeFlagPointer(int stride, ByteBuffer pointer); - - /** - * @param stride - * @param buffer_offset - */ - void glEdgeFlagPointer(int stride, int buffer_offset); - - /** - * @param cap - */ - void glEnable(int cap); - - /** - * @param cap - */ - void glEnableClientState(int cap); - - /** - * - */ - void glEnd(); - - /** - * - */ - void glEndList(); - - /** - * @param u - */ - void glEvalCoord1f(float u); - - /** - * @param u - * @param v - */ - void glEvalCoord2f(float u, float v); - - /** - * @param mode - * @param i1 - * @param i2 - */ - void glEvalMesh1(int mode, int i1, int i2); - - /** - * @param mode - * @param i1 - * @param i2 - * @param j1 - * @param j2 - */ - void glEvalMesh2(int mode, int i1, int i2, int j1, int j2); - - /** - * @param i - */ - void glEvalPoint1(int i); - - /** - * @param i - * @param j - */ - void glEvalPoint2(int i, int j); - - /** - * @param type - * @param buffer - */ - void glFeedbackBuffer(int type, FloatBuffer buffer); - - /** - * - */ - void glFinish(); - - /** - * - */ - void glFlush(); - - /** - * @param pname - * @param params - */ - void glFog(int pname, FloatBuffer params); - - /** - * @param pname - * @param params - */ - void glFog(int pname, IntBuffer params); - - /** - * @param pname - * @param param - */ - void glFogf(int pname, float param); - - /** - * @param pname - * @param param - */ - void glFogi(int pname, int param); - - /** - * @param mode - */ - void glFrontFace(int mode); - - /** - * @param left - * @param right - * @param bottom - * @param top - * @param zNear - * @param zFar - */ - void glFrustum(double left, double right, double bottom, double top, double zNear, double zFar); - - /** - * @param range - * - * @return - */ - int glGenLists(int range); - - /** - * @param textures - */ - void glGenTextures(IntBuffer textures); - - /** - * @param pname - * @param params - */ - void glGetBoolean(int pname, ByteBuffer params); - - /** - * @param plane - * @param equation - */ - void glGetClipPlane(int plane, DoubleBuffer equation); - - /** - * @param pname - * @param params - */ - void glGetDouble(int pname, DoubleBuffer params); - - /** - * @return - */ - int glGetError(); - - /** - * @param pname - * @param params - */ - void glGetFloat(int pname, FloatBuffer params); - - /** - * @param pname - * @param params - */ - void glGetInteger(int pname, IntBuffer params); - - /** - * @param light - * @param pname - * @param params - */ - void glGetLight(int light, int pname, FloatBuffer params); - - /** - * @param light - * @param pname - * @param params - */ - void glGetLight(int light, int pname, IntBuffer params); - - /** - * @param target - * @param query - * @param v - */ - void glGetMap(int target, int query, FloatBuffer v); - - /** - * @param target - * @param query - * @param v - */ - void glGetMap(int target, int query, IntBuffer v); - - /** - * @param face - * @param pname - * @param params - */ - void glGetMaterial(int face, int pname, FloatBuffer params); - - /** - * @param face - * @param pname - * @param params - */ - void glGetMaterial(int face, int pname, IntBuffer params); - - /** - * @param map - * @param values - */ - void glGetPixelMap(int map, FloatBuffer values); - - /** - * @param map - * @param buffer_offset - */ - void glGetPixelMapfv(int map, int buffer_offset); - - /** - * @param map - * @param values - */ - void glGetPixelMapu(int map, IntBuffer values); - - /** - * @param map - * @param buffer_offset - */ - void glGetPixelMapuiv(int map, int buffer_offset); - - /** - * @param map - * @param values - */ - void glGetPixelMapu(int map, ShortBuffer values); - - /** - * @param map - * @param buffer_offset - */ - void glGetPixelMapusv(int map, int buffer_offset); - - /** - * @param pname - * @param size - * - * @return - */ - ByteBuffer glGetPointer(int pname, int size); - - /** - * @param mask - */ - void glGetPolygonStipple(ByteBuffer mask); - - /** - * @param buffer_offset - */ - void glGetPolygonStipple(int buffer_offset); - - /** - * @param name - * - * @return - */ - String glGetString(int name); - - /** - * @param coord - * @param pname - * @param params - */ - void glGetTexEnv(int coord, int pname, FloatBuffer params); - - /** - * @param coord - * @param pname - * @param params - */ - void glGetTexEnv(int coord, int pname, IntBuffer params); - - /** - * @param coord - * @param pname - * @param params - */ - void glGetTexGen(int coord, int pname, FloatBuffer params); - - /** - * @param coord - * @param pname - * @param params - */ - void glGetTexGen(int coord, int pname, IntBuffer params); - - /** - * @param target - * @param level - * @param format - * @param type - * @param pixels - */ - void glGetTexImage(int target, int level, int format, int type, ByteBuffer pixels); - - /** - * @param target - * @param level - * @param format - * @param type - * @param pixels - */ - void glGetTexImage(int target, int level, int format, int type, IntBuffer pixels); - - /** - * @param target - * @param level - * @param format - * @param type - * @param pixels - */ - void glGetTexImage(int target, int level, int format, int type, ShortBuffer pixels); - - /** - * @param target - * @param level - * @param format - * @param type - * @param buffer_offset - */ - void glGetTexImage(int target, int level, int format, int type, int buffer_offset); - - /** - * @param target - * @param level - * @param pname - * @param params - */ - void glGetTexLevelParameter(int target, int level, int pname, FloatBuffer params); - - /** - * @param target - * @param level - * @param pname - * @param params - */ - void glGetTexLevelParameter(int target, int level, int pname, IntBuffer params); - - /** - * @param target - * @param pname - * @param params - */ - void glGetTexParameter(int target, int pname, FloatBuffer params); - - /** - * @param target - * @param pname - * @param params - */ - void glGetTexParameter(int target, int pname, IntBuffer params); - - /** - * @param target - * @param mode - */ - void glHint(int target, int mode); - - /** - * - */ - void glInitNames(); - - /** - * @param format - * @param stride - * @param pointer - */ - void glInterleavedArrays(int format, int stride, ByteBuffer pointer); - - /** - * @param format - * @param stride - * @param pointer - */ - void glInterleavedArrays(int format, int stride, FloatBuffer pointer); - - /** - * @param format - * @param stride - * @param buffer_offset - */ - void glInterleavedArrays(int format, int stride, int buffer_offset); - - /** - * @param format - * @param stride - * @param pointer - */ - void glInterleavedArrays(int format, int stride, IntBuffer pointer); - - /** - * @param format - * @param stride - * @param pointer - */ - void glInterleavedArrays(int format, int stride, ShortBuffer pointer); - - /** - * @param cap - * - * @return - */ - boolean glIsEnabled(int cap); - - /** - * @param list - * - * @return - */ - boolean glIsList(int list); - - /** - * @param texture - * - * @return - */ - boolean glIsTexture(int texture); - - /** - * @param light - * @param pname - * @param params - */ - void glLight(int light, int pname, FloatBuffer params); - - /** - * @param light - * @param pname - * @param params - */ - void glLight(int light, int pname, IntBuffer params); - - /** - * @param light - * @param pname - * @param param - */ - void glLightf(int light, int pname, float param); - - /** - * @param light - * @param pname - * @param param - */ - void glLighti(int light, int pname, int param); - - /** - * @param pname - * @param params - */ - void glLightModel(int pname, FloatBuffer params); - - /** - * @param pname - * @param params - */ - void glLightModel(int pname, IntBuffer params); - - /** - * @param pname - * @param param - */ - void glLightModelf(int pname, float param); - - /** - * @param pname - * @param param - */ - void glLightModeli(int pname, int param); - - /** - * @param factor - * @param pattern - */ - void glLineStipple(int factor, short pattern); - - /** - * @param width - */ - void glLineWidth(float width); - - /** - * @param base - */ - void glListBase(int base); - - /** - * - */ - void glLoadIdentity(); - - /** - * @param m - */ - void glLoadMatrix(FloatBuffer m); - - /** - * @param name - */ - void glLoadName(int name); - - /** - * @param opcode - */ - void glLogicOp(int opcode); - - /** - * @param target - * @param u1 - * @param u2 - * @param stride - * @param order - * @param points - */ - void glMap1f(int target, float u1, float u2, int stride, int order, FloatBuffer points); - - /** - * @param target - * @param u1 - * @param u2 - * @param ustride - * @param uorder - * @param v1 - * @param v2 - * @param vstride - * @param vorder - * @param points - */ - void glMap2f(int target, float u1, float u2, int ustride, int uorder, float v1, float v2, int vstride, int vorder, FloatBuffer points); - - - /** - * @param un - * @param u1 - * @param u2 - */ - void glMapGrid1f(int un, float u1, float u2); - - /** - * @param un - * @param u1 - * @param u2 - * @param vn - * @param v1 - * @param v2 - */ - void glMapGrid2f(int un, float u1, float u2, int vn, float v1, float v2); - - /** - * @param face - * @param pname - * @param params - */ - void glMaterial(int face, int pname, FloatBuffer params); - - /** - * @param face - * @param pname - * @param params - */ - void glMaterial(int face, int pname, IntBuffer params); - - /** - * @param face - * @param pname - * @param param - */ - void glMaterialf(int face, int pname, float param); - - /** - * @param face - * @param pname - * @param param - */ - void glMateriali(int face, int pname, int param); - - /** - * @param mode - */ - void glMatrixMode(int mode); - - /** - * @param m - */ - void glMultMatrix(FloatBuffer m); - - /** - * @param list - * @param mode - */ - void glNewList(int list, int mode); - - /** - * @param nx - * @param ny - * @param nz - */ - void glNormal3b(byte nx, byte ny, byte nz); - - /** - * @param nx - * @param ny - * @param nz - */ - void glNormal3f(float nx, float ny, float nz); - - /** - * @param nx - * @param ny - * @param nz - */ - void glNormal3i(int nx, int ny, int nz); - - /** - * @param stride - * @param pointer - */ - void glNormalPointer(int stride, ByteBuffer pointer); - - /** - * @param stride - * @param pointer - */ - void glNormalPointer(int stride, FloatBuffer pointer); - - /** - * @param type - * @param stride - * @param buffer_offset - */ - void glNormalPointer(int type, int stride, int buffer_offset); - - /** - * @param stride - * @param pointer - */ - void glNormalPointer(int stride, IntBuffer pointer); - - /** - * @param left - * @param right - * @param bottom - * @param top - * @param zNear - * @param zFar - */ - void glOrtho(double left, double right, double bottom, double top, double zNear, double zFar); - - /** - * @param token - */ - void glPassThrough(float token); - - /** - * @param map - * @param values - */ - void glPixelMap(int map, FloatBuffer values); - - /** - * @param map - * @param values - */ - void glPixelMapu(int map, IntBuffer values); - - /** - * @param map - * @param values - */ - void glPixelMapu(int map, ShortBuffer values); - - /** - * - * @param map - * @param mapsize - * @param buffer_offset - */ - void glPixelMapfv(int map, int mapsize, int buffer_offset); - - /** - * - * @param map - * @param mapsize - * @param buffer_offset - */ - void glPixelMapuiv(int map, int mapsize, int buffer_offset); - - /** - * - * @param map - * @param mapsize - * @param buffer_offset - */ - void glPixelMapusv(int map, int mapsize, int buffer_offset); - - /** - * @param pname - * @param param - */ - void glPixelStoref(int pname, float param); - - /** - * @param pname - * @param param - */ - void glPixelStorei(int pname, int param); - - /** - * @param pname - * @param param - */ - void glPixelTransferf(int pname, float param); - - /** - * @param pname - * @param param - */ - void glPixelTransferi(int pname, int param); - - /** - * @param xfactor - * @param yfactor - */ - void glPixelZoom(float xfactor, float yfactor); - - /** - * @param size - */ - void glPointSize(float size); - - /** - * @param face - * @param mode - */ - void glPolygonMode(int face, int mode); - - /** - * @param factor - * @param units - */ - void glPolygonOffset(float factor, float units); - - /** - * @param mask - */ - void glPolygonStipple(ByteBuffer mask); - - /** - * - * @param buffer_offset - */ - void glPolygonStipple(int buffer_offset); - - /** - * - */ - void glPopAttrib(); - - /** - * - */ - void glPopClientAttrib(); - - /** - * - */ - void glPopMatrix(); - - /** - * - */ - void glPopName(); - - /** - * @param mask - */ - void glPushAttrib(int mask); - - /** - * @param mask - */ - void glPushClientAttrib(int mask); - - /** - * - */ - void glPushMatrix(); - - /** - * @param name - */ - void glPushName(int name); - - /** - * @param x - * @param y - */ - void glRasterPos2f(float x, float y); - - /** - * @param x - * @param y - */ - void glRasterPos2i(int x, int y); - - /** - * @param x - * @param y - * @param z - */ - void glRasterPos3f(float x, float y, float z); - - /** - * @param x - * @param y - * @param z - */ - void glRasterPos3i(int x, int y, int z); - - /** - * @param x - * @param y - * @param z - * @param w - */ - void glRasterPos4f(float x, float y, float z, float w); - - /** - * @param x - * @param y - * @param z - * @param w - */ - void glRasterPos4i(int x, int y, int z, int w); - - /** - * @param mode - */ - void glReadBuffer(int mode); - - /** - * @param x - * @param y - * @param width - * @param height - * @param format - * @param type - * @param pixels - */ - void glReadPixels(int x, int y, int width, int height, int format, int type, ByteBuffer pixels); - - /** - * @param x - * @param y - * @param width - * @param height - * @param format - * @param type - * @param pixels - */ - void glReadPixels(int x, int y, int width, int height, int format, int type, IntBuffer pixels); - - /** - * @param x - * @param y - * @param width - * @param height - * @param format - * @param type - * @param pixels - */ - void glReadPixels(int x, int y, int width, int height, int format, int type, ShortBuffer pixels); - - /** - * @param x - * @param y - * @param width - * @param height - * @param format - * @param type - * @param buffer_offset - */ - void glReadPixels(int x, int y, int width, int height, int format, int type, int buffer_offset); - - /** - * @param x1 - * @param y1 - * @param x2 - * @param y2 - */ - void glRectf(float x1, float y1, float x2, float y2); - - /** - * @param x1 - * @param y1 - * @param x2 - * @param y2 - */ - void glRecti(int x1, int y1, int x2, int y2); - - /** - * @param mode - * - * @return - */ - int glRenderMode(int mode); - - /** - * @param angle - * @param x - * @param y - * @param z - */ - void glRotatef(float angle, float x, float y, float z); - - /** - * @param x - * @param y - * @param z - */ - void glScalef(float x, float y, float z); - - /** - * @param x - * @param y - * @param width - * @param height - */ - void glScissor(int x, int y, int width, int height); - - /** - * @param buffer - */ - void glSelectBuffer(IntBuffer buffer); - - /** - * @param mode - */ - void glShadeModel(int mode); - - /** - * @param func - * @param ref - * @param mask - */ - void glStencilFunc(int func, int ref, int mask); - - /** - * @param mask - */ - void glStencilMask(int mask); - - /** - * @param fail - * @param zfail - * @param zpass - */ - void glStencilOp(int fail, int zfail, int zpass); - - /** - * @param s - */ - void glTexCoord1f(float s); - - /** - * @param s - * @param t - */ - void glTexCoord2f(float s, float t); - - /** - * @param s - * @param t - * @param r - */ - void glTexCoord3f(float s, float t, float r); - - /** - * @param s - * @param t - * @param r - * @param q - */ - void glTexCoord4f(float s, float t, float r, float q); - - /** - * @param size - * @param stride - * @param pointer - */ - void glTexCoordPointer(int size, int stride, FloatBuffer pointer); - - /** - * @param size - * @param type - * @param stride - * @param buffer_offset - */ - void glTexCoordPointer(int size, int type, int stride, int buffer_offset); - - /** - * @param target - * @param pname - * @param params - */ - void glTexEnv(int target, int pname, FloatBuffer params); - - /** - * @param target - * @param pname - * @param params - */ - void glTexEnv(int target, int pname, IntBuffer params); - - /** - * @param target - * @param pname - * @param param - */ - void glTexEnvf(int target, int pname, float param); - - /** - * @param target - * @param pname - * @param param - */ - void glTexEnvi(int target, int pname, int param); - - /** - * @param coord - * @param pname - * @param params - */ - void glTexGen(int coord, int pname, FloatBuffer params); - - /** - * @param coord - * @param pname - * @param params - */ - void glTexGen(int coord, int pname, IntBuffer params); - - /** - * @param coord - * @param pname - * @param param - */ - void glTexGenf(int coord, int pname, float param); - - /** - * @param coord - * @param pname - * @param param - */ - void glTexGeni(int coord, int pname, int param); - - /** - * @param target - * @param level - * @param internalformat - * @param width - * @param border - * @param format - * @param type - * @param pixels - */ - void glTexImage1D(int target, int level, int internalformat, int width, int border, int format, int type, ByteBuffer pixels); - - - /** - * @param target - * @param level - * @param internalformat - * @param width - * @param border - * @param format - * @param type - * @param pixels - */ - void glTexImage1D(int target, int level, int internalformat, int width, int border, int format, int type, FloatBuffer pixels); - - - /** - * @param target - * @param level - * @param internalformat - * @param width - * @param border - * @param format - * @param type - * @param pixels - */ - void glTexImage1D(int target, int level, int internalformat, int width, int border, int format, int type, IntBuffer pixels); - - - /** - * @param target - * @param level - * @param internalformat - * @param width - * @param border - * @param format - * @param type - * @param pixels - */ - void glTexImage1D(int target, int level, int internalformat, int width, int border, int format, int type, ShortBuffer pixels); - - /** - * - * @param target - * @param level - * @param internalformat - * @param width - * @param border - * @param format - * @param type - * @param buffer_offset - */ - void glTexImage1D(int target, int level, int internalformat, int width, int border, int format, int type, int buffer_offset); - - /** - * @param target - * @param level - * @param internalformat - * @param width - * @param height - * @param border - * @param format - * @param type - * @param pixels - */ - void glTexImage2D(int target, int level, int internalformat, int width, int height, int border, int format, int type, ByteBuffer pixels); - - - /** - * @param target - * @param level - * @param internalformat - * @param width - * @param height - * @param border - * @param format - * @param type - * @param pixels - */ - void glTexImage2D(int target, int level, int internalformat, int width, int height, int border, int format, int type, FloatBuffer pixels); - - - /** - * @param target - * @param level - * @param internalformat - * @param width - * @param height - * @param border - * @param format - * @param type - * @param pixels - */ - void glTexImage2D(int target, int level, int internalformat, int width, int height, int border, int format, int type, IntBuffer pixels); - - - /** - * @param target - * @param level - * @param internalformat - * @param width - * @param height - * @param border - * @param format - * @param type - * @param pixels - */ - void glTexImage2D(int target, int level, int internalformat, int width, int height, int border, int format, int type, ShortBuffer pixels); - - /** - * - * @param target - * @param level - * @param internalformat - * @param width - * @param height - * @param border - * @param format - * @param type - * @param buffer_offset - */ - void glTexImage2D(int target, int level, int internalformat, int width, int height, int border, int format, int type, int buffer_offset); - - /** - * @param target - * @param pname - * @param param - */ - void glTexParameter(int target, int pname, FloatBuffer param); - - /** - * @param target - * @param pname - * @param param - */ - void glTexParameter(int target, int pname, IntBuffer param); - - /** - * @param target - * @param pname - * @param param - */ - void glTexParameterf(int target, int pname, float param); - - /** - * @param target - * @param pname - * @param param - */ - void glTexParameteri(int target, int pname, int param); - - /** - * @param target - * @param level - * @param xoffset - * @param width - * @param format - * @param type - * @param pixels - */ - void glTexSubImage1D(int target, int level, int xoffset, int width, int format, int type, ByteBuffer pixels); - - - /** - * @param target - * @param level - * @param xoffset - * @param width - * @param format - * @param type - * @param pixels - */ - void glTexSubImage1D(int target, int level, int xoffset, int width, int format, int type, IntBuffer pixels); - - /** - * - * @param target - * @param level - * @param xoffset - * @param width - * @param format - * @param type - * @param buffer_offset - */ - void glTexSubImage1D(int target, int level, int xoffset, int width, int format, int type, int buffer_offset); - - /** - * @param target - * @param level - * @param xoffset - * @param width - * @param format - * @param type - * @param pixels - */ - void glTexSubImage1D(int target, int level, int xoffset, int width, int format, int type, ShortBuffer pixels); - - - /** - * @param target - * @param level - * @param xoffset - * @param yoffset - * @param width - * @param height - * @param format - * @param type - * @param pixels - */ - void glTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int type, ByteBuffer pixels); - - - /** - * @param target - * @param level - * @param xoffset - * @param yoffset - * @param width - * @param height - * @param format - * @param type - * @param pixels - */ - void glTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int type, IntBuffer pixels); - - - /** - * @param target - * @param level - * @param xoffset - * @param yoffset - * @param width - * @param height - * @param format - * @param type - * @param pixels - */ - void glTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int type, ShortBuffer pixels); - - /** - * - * @param target - * @param level - * @param xoffset - * @param yoffset - * @param width - * @param height - * @param format - * @param type - * @param buffer_offset - */ - void glTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int type, int buffer_offset); - - /** - * @param x - * @param y - * @param z - */ - void glTranslatef(float x, float y, float z); - - /** - * @param x - * @param y - */ - void glVertex2f(float x, float y); - - /** - * @param x - * @param y - */ - void glVertex2i(int x, int y); - - /** - * @param x - * @param y - * @param z - */ - void glVertex3f(float x, float y, float z); - - /** - * @param x - * @param y - * @param z - */ - void glVertex3i(int x, int y, int z); - - /** - * @param x - * @param y - * @param z - * @param w - */ - void glVertex4f(float x, float y, float z, float w); - - /** - * @param x - * @param y - * @param z - * @param w - */ - void glVertex4i(int x, int y, int z, int w); - - /** - * @param size - * @param stride - * @param pointer - */ - void glVertexPointer(int size, int stride, FloatBuffer pointer); - - /** - * @param size - * @param type - * @param stride - * @param buffer_offset - */ - void glVertexPointer(int size, int type, int stride, int buffer_offset); - - /** - * @param size - * @param stride - * @param pointer - */ - void glVertexPointer(int size, int stride, IntBuffer pointer); - - /** - * @param x - * @param y - * @param width - * @param height - */ - void glViewport(int x, int y, int width, int height); - - /** - * @param target - * @param level - * @param xoffset - * @param yoffset - * @param zoffset - * @param x - * @param y - * @param width - * @param height - */ - void glCopyTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int x, int y, int width, int height); - - - /** - * @param mode - * @param start - * @param end - * @param indices - */ - void glDrawRangeElements(int mode, int start, int end, ByteBuffer indices); - - /** - * @param mode - * @param start - * @param end - * @param count - * @param type - * @param buffer_offset - */ - void glDrawRangeElements(int mode, int start, int end, int count, int type, int buffer_offset); - - /** - * @param mode - * @param start - * @param end - * @param indices - */ - void glDrawRangeElements(int mode, int start, int end, IntBuffer indices); - - /** - * @param mode - * @param start - * @param end - * @param indices - */ - void glDrawRangeElements(int mode, int start, int end, ShortBuffer indices); - - /** - * @param target - * @param level - * @param internalFormat - * @param width - * @param height - * @param depth - * @param border - * @param format - * @param type - * @param pixels - */ - void glTexImage3D(int target, int level, int internalFormat, int width, int height, int depth, int border, int format, int type, ByteBuffer pixels); - - - /** - * @param target - * @param level - * @param internalFormat - * @param width - * @param height - * @param depth - * @param border - * @param format - * @param type - * @param pixels - */ - void glTexImage3D(int target, int level, int internalFormat, int width, int height, int depth, int border, int format, int type, FloatBuffer pixels); - - - /** - * @param target - * @param level - * @param internalFormat - * @param width - * @param height - * @param depth - * @param border - * @param format - * @param type - * @param pixels - */ - void glTexImage3D(int target, int level, int internalFormat, int width, int height, int depth, int border, int format, int type, IntBuffer pixels); - - /** - * @param target - * @param level - * @param internalFormat - * @param width - * @param height - * @param depth - * @param border - * @param format - * @param type - * @param pixels - */ - void glTexImage3D(int target, int level, int internalFormat, int width, int height, int depth, int border, int format, int type, ShortBuffer pixels); - - /** - * @param target - * @param level - * @param internalFormat - * @param width - * @param height - * @param depth - * @param border - * @param format - * @param type - * @param buffer_offset - */ - void glTexImage3D(int target, int level, int internalFormat, int width, int height, int depth, int border, int format, int type, int buffer_offset); - - /** - * @param target - * @param level - * @param xoffset - * @param yoffset - * @param zoffset - * @param width - * @param height - * @param depth - * @param format - * @param type - * @param pixels - */ - void glTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, ByteBuffer pixels); - - - /** - * @param target - * @param level - * @param xoffset - * @param yoffset - * @param zoffset - * @param width - * @param height - * @param depth - * @param format - * @param type - * @param pixels - */ - void glTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, FloatBuffer pixels); - - - /** - * @param target - * @param level - * @param xoffset - * @param yoffset - * @param zoffset - * @param width - * @param height - * @param depth - * @param format - * @param type - * @param pixels - */ - void glTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, IntBuffer pixels); - - - /** - * @param target - * @param level - * @param xoffset - * @param yoffset - * @param zoffset - * @param width - * @param height - * @param depth - * @param format - * @param type - * @param pixels - */ - void glTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, ShortBuffer pixels); - - /** - * - * @param target - * @param level - * @param xoffset - * @param yoffset - * @param zoffset - * @param width - * @param height - * @param depth - * @param format - * @param type - * @param buffer_offset - */ - void glTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, int buffer_offset); - - /** - * @param texture - */ - void glActiveTexture(int texture); - - /** - * @param texture - */ - void glClientActiveTexture(int texture); - - /** - * @param target - * @param level - * @param internalformat - * @param width - * @param border - * @param imageSize - * @param data - */ - void glCompressedTexImage1D(int target, int level, int internalformat, int width, int border, int imageSize, ByteBuffer data); - - - /** - * @param target - * @param level - * @param internalformat - * @param width - * @param border - * @param imageSize - * @param data - */ - void glCompressedTexImage1D(int target, int level, int internalformat, int width, int border, int imageSize, FloatBuffer data); - - - /** - * @param target - * @param level - * @param internalformat - * @param width - * @param border - * @param imageSize - * @param data - */ - void glCompressedTexImage1D(int target, int level, int internalformat, int width, int border, int imageSize, IntBuffer data); - - - /** - * @param target - * @param level - * @param internalformat - * @param width - * @param border - * @param imageSize - * @param data - */ - void glCompressedTexImage1D(int target, int level, int internalformat, int width, int border, int imageSize, ShortBuffer data); - - /** - * @param target - * @param level - * @param internalformat - * @param width - * @param border - * @param imageSize - * @param buffer_offset - */ - void glCompressedTexImage1D(int target, int level, int internalformat, int width, int border, int imageSize, int buffer_offset); - - /** - * @param target - * @param level - * @param internalformat - * @param width - * @param height - * @param border - * @param imageSize - * @param data - */ - void glCompressedTexImage2D(int target, int level, int internalformat, int width, int height, int border, int imageSize, ByteBuffer data); - - - /** - * @param target - * @param level - * @param internalformat - * @param width - * @param height - * @param border - * @param imageSize - * @param data - */ - void glCompressedTexImage2D(int target, int level, int internalformat, int width, int height, int border, int imageSize, FloatBuffer data); - - /** - * @param target - * @param level - * @param internalformat - * @param width - * @param height - * @param border - * @param imageSize - * @param data - */ - void glCompressedTexImage2D(int target, int level, int internalformat, int width, int height, int border, int imageSize, IntBuffer data); - - /** - * @param target - * @param level - * @param internalformat - * @param width - * @param height - * @param border - * @param imageSize - * @param data - */ - void glCompressedTexImage2D(int target, int level, int internalformat, int width, int height, int border, int imageSize, ShortBuffer data); - - /** - * @param target - * @param level - * @param internalformat - * @param width - * @param height - * @param border - * @param imageSize - * @param buffer_offset - */ - void glCompressedTexImage2D(int target, int level, int internalformat, int width, int height, int border, int imageSize, int buffer_offset); - - /** - * @param target - * @param level - * @param internalformat - * @param width - * @param height - * @param depth - * @param border - * @param imageSize - * @param data - */ - void glCompressedTexImage3D(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, ByteBuffer data); - - /** - * @param target - * @param level - * @param internalformat - * @param width - * @param height - * @param depth - * @param border - * @param imageSize - * @param data - */ - void glCompressedTexImage3D(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, FloatBuffer data); - - /** - * @param target - * @param level - * @param internalformat - * @param width - * @param height - * @param depth - * @param border - * @param imageSize - * @param data - */ - void glCompressedTexImage3D(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, IntBuffer data); - - /** - * @param target - * @param level - * @param internalformat - * @param width - * @param height - * @param depth - * @param border - * @param imageSize - * @param data - */ - void glCompressedTexImage3D(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, ShortBuffer data); - - /** - * @param target - * @param level - * @param internalformat - * @param width - * @param height - * @param depth - * @param border - * @param imageSize - * @param buffer_offset - */ - void glCompressedTexImage3D(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, int buffer_offset); - - /** - * @param target - * @param level - * @param xoffset - * @param width - * @param format - * @param imageSize - * @param data - */ - void glCompressedTexSubImage1D(int target, int level, int xoffset, int width, int format, int imageSize, ByteBuffer data); - - - /** - * @param target - * @param level - * @param xoffset - * @param width - * @param format - * @param imageSize - * @param data - */ - void glCompressedTexSubImage1D(int target, int level, int xoffset, int width, int format, int imageSize, FloatBuffer data); - - - /** - * @param target - * @param level - * @param xoffset - * @param width - * @param format - * @param imageSize - * @param data - */ - void glCompressedTexSubImage1D(int target, int level, int xoffset, int width, int format, int imageSize, IntBuffer data); - - - /** - * @param target - * @param level - * @param xoffset - * @param width - * @param format - * @param imageSize - * @param data - */ - void glCompressedTexSubImage1D(int target, int level, int xoffset, int width, int format, int imageSize, ShortBuffer data); - - /** - * @param target - * @param level - * @param xoffset - * @param width - * @param format - * @param imageSize - * @param buffer_offset - */ - void glCompressedTexSubImage1D(int target, int level, int xoffset, int width, int format, int imageSize, int buffer_offset); - - /** - * @param target - * @param level - * @param xoffset - * @param yoffset - * @param width - * @param height - * @param format - * @param imageSize - * @param data - */ - void glCompressedTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, ByteBuffer data); - - /** - * @param target - * @param level - * @param xoffset - * @param yoffset - * @param width - * @param height - * @param format - * @param imageSize - * @param data - */ - void glCompressedTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, FloatBuffer data); - - /** - * @param target - * @param level - * @param xoffset - * @param yoffset - * @param width - * @param height - * @param format - * @param imageSize - * @param data - */ - void glCompressedTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, IntBuffer data); - - - /** - * @param target - * @param level - * @param xoffset - * @param yoffset - * @param width - * @param height - * @param format - * @param imageSize - * @param data - */ - void glCompressedTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, ShortBuffer data); - - /** - * @param target - * @param level - * @param xoffset - * @param yoffset - * @param width - * @param height - * @param format - * @param imageSize - * @param buffer_offset - */ - void glCompressedTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, int buffer_offset); - - /** - * @param target - * @param level - * @param xoffset - * @param yoffset - * @param zoffset - * @param width - * @param height - * @param depth - * @param format - * @param imageSize - * @param data - */ - void glCompressedTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, ByteBuffer data); - - /** - * @param target - * @param level - * @param xoffset - * @param yoffset - * @param zoffset - * @param width - * @param height - * @param depth - * @param format - * @param imageSize - * @param data - */ - void glCompressedTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, FloatBuffer data); - - /** - * @param target - * @param level - * @param xoffset - * @param yoffset - * @param zoffset - * @param width - * @param height - * @param depth - * @param format - * @param imageSize - * @param data - */ - void glCompressedTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, IntBuffer data); - - /** - * @param target - * @param level - * @param xoffset - * @param yoffset - * @param zoffset - * @param width - * @param height - * @param depth - * @param format - * @param imageSize - * @param data - */ - void glCompressedTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, ShortBuffer data); - - /** - * @param target - * @param level - * @param xoffset - * @param yoffset - * @param zoffset - * @param width - * @param height - * @param depth - * @param format - * @param imageSize - * @param buffer_offset - */ - void glCompressedTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, int buffer_offset); - - /** - * @param target - * @param lod - * @param img - */ - void glGetCompressedTexImage(int target, int lod, ByteBuffer img); - - /** - * @param target - * @param lod - * @param img - */ - void glGetCompressedTexImage(int target, int lod, IntBuffer img); - - /** - * @param target - * @param lod - * @param img - */ - void glGetCompressedTexImage(int target, int lod, ShortBuffer img); - - /** - * @param target - * @param lod - * @param buffer_offset - */ - void glGetCompressedTexImage(int target, int lod, int buffer_offset); - - /** - * @param m - */ - void glLoadTransposeMatrix(FloatBuffer m); - - /** - * @param target - * @param s - */ - void glMultiTexCoord1f(int target, float s); - - /** - * @param target - * @param s - * @param t - */ - void glMultiTexCoord2f(int target, float s, float t); - - /** - * @param target - * @param s - * @param t - * @param r - */ - void glMultiTexCoord3f(int target, float s, float t, float r); - - /** - * @param target - * @param s - * @param t - * @param r - * @param q - */ - void glMultiTexCoord4f(int target, float s, float t, float r, float q); - - /** - * @param m - */ - void glMultTransposeMatrix(FloatBuffer m); - - /** - * @param value - * @param invert - */ - void glSampleCoverage(float value, boolean invert); - - /** - * @param red - * @param green - * @param blue - * @param alpha - */ - void glBlendColor(float red, float green, float blue, float alpha); - - /** - * @param mode - */ - void glBlendEquation(int mode); - - /** - * @param sfactorRGB - * @param dfactorRGB - * @param sfactorAlpha - * @param dfactorAlpha - */ - void glBlendFuncSeparate(int sfactorRGB, int dfactorRGB, int sfactorAlpha, int dfactorAlpha); - - - /** - * @param coord - */ - void glFogCoordf(float coord); - - /** - * @param stride - * @param data - */ - void glFogCoordPointer(int stride, FloatBuffer data); - - /** - * @param type - * @param stride - * @param buffer_offset - */ - void glFogCoordPointer(int type, int stride, int buffer_offset); - - /** - * @param mode - * @param piFirst - * @param piCount - */ - void glMultiDrawArrays(int mode, IntBuffer piFirst, IntBuffer piCount); - - /** - * @param pname - * @param params - */ - void glPointParameter(int pname, FloatBuffer params); - - /** - * @param pname - * @param param - */ - void glPointParameterf(int pname, float param); - - /** - * @param red - * @param green - * @param blue - */ - void glSecondaryColor3b(byte red, byte green, byte blue); - - /** - * @param red - * @param green - * @param blue - */ - void glSecondaryColor3f(float red, float green, float blue); - - /** - * @param red - * @param green - * @param blue - */ - void glSecondaryColor3ub(byte red, byte green, byte blue); - - /** - * @param size - * @param unsigned - * @param stride - * @param data - */ - void glSecondaryColorPointer(int size, boolean unsigned, int stride, ByteBuffer data); - - /** - * @param size - * @param stride - * @param data - */ - void glSecondaryColorPointer(int size, int stride, FloatBuffer data); - - /** - * @param size - * @param type - * @param stride - * @param buffer_offset - */ - void glSecondaryColorPointer(int size, int type, int stride, int buffer_offset); - - /** - * @param x - * @param y - */ - void glWindowPos2f(float x, float y); - - /** - * @param x - * @param y - */ - void glWindowPos2i(int x, int y); - - /** - * @param x - * @param y - * @param z - */ - void glWindowPos3f(float x, float y, float z); - - /** - * @param x - * @param y - * @param z - */ - void glWindowPos3i(int x, int y, int z); - - /** - * @param target - * @param id - */ - void glBeginQuery(int target, int id); - - /** - * @param target - * @param buffer - */ - void glBindBuffer(int target, int buffer); - - /** - * @param target - * @param size - * @param usage - */ - void glBufferData(int target, int size, int usage); - - /** - * @param target - * @param data - * @param usage - */ - void glBufferData(int target, ByteBuffer data, int usage); - - /** - * @param target - * @param data - * @param usage - */ - void glBufferData(int target, FloatBuffer data, int usage); - - /** - * @param target - * @param data - * @param usage - */ - void glBufferData(int target, IntBuffer data, int usage); - - /** - * @param target - * @param data - * @param usage - */ - void glBufferData(int target, ShortBuffer data, int usage); - - /** - * @param target - * @param offset - * @param data - */ - void glBufferSubData(int target, int offset, ByteBuffer data); - - /** - * @param target - * @param offset - * @param data - */ - void glBufferSubData(int target, int offset, FloatBuffer data); - - /** - * @param target - * @param offset - * @param data - */ - void glBufferSubData(int target, int offset, IntBuffer data); - - /** - * @param target - * @param offset - * @param data - */ - void glBufferSubData(int target, int offset, ShortBuffer data); - - /** - * @param buffers - */ - void glDeleteBuffers(IntBuffer buffers); - - /** - * @param ids - */ - void glDeleteQueries(IntBuffer ids); - - /** - * @param target - */ - void glEndQuery(int target); - - /** - * @param buffers - */ - void glGenBuffers(IntBuffer buffers); - - /** - * @param ids - */ - void glGenQueries(IntBuffer ids); - - /** - * @param target - * @param pname - * @param params - */ - void glGetBufferParameter(int target, int pname, IntBuffer params); - - /** - * @param target - * @param pname - * @param size - * - * @return - */ - ByteBuffer glGetBufferPointer(int target, int pname, int size); - - /** - * @param target - * @param offset - * @param data - */ - void glGetBufferSubData(int target, int offset, ByteBuffer data); - - /** - * @param target - * @param offset - * @param data - */ - void glGetBufferSubData(int target, int offset, FloatBuffer data); - - /** - * @param target - * @param offset - * @param data - */ - void glGetBufferSubData(int target, int offset, IntBuffer data); - - /** - * @param target - * @param offset - * @param data - */ - void glGetBufferSubData(int target, int offset, ShortBuffer data); - - /** - * @param target - * @param pname - * @param params - */ - void glGetQuery(int target, int pname, IntBuffer params); - - /** - * @param id - * @param pname - * @param params - */ - void glGetQueryObject(int id, int pname, IntBuffer params); - - /** - * @param id - * @param pname - * @param params - */ - void glGetQueryObjectu(int id, int pname, IntBuffer params); - - /** - * @param buffer - * - * @return - */ - boolean glIsBuffer(int buffer); - - /** - * @param id - * - * @return - */ - boolean glIsQuery(int id); - - /** - * @param target - * @param access - * @param size - * @param oldBuffer - * - * @return - */ - ByteBuffer glMapBuffer(int target, int access, int size, ByteBuffer oldBuffer); - - /** - * @param target - * - * @return - */ - boolean glUnmapBuffer(int target); - - /** - * @param target - * @param buffer - */ - void glBindBufferARB(int target, int buffer); - - /** - * @param target - * @param size - * @param usage - */ - void glBufferDataARB(int target, int size, int usage); - - /** - * @param target - * @param data - * @param usage - */ - void glBufferDataARB(int target, ByteBuffer data, int usage); - - /** - * @param target - * @param data - * @param usage - */ - void glBufferDataARB(int target, FloatBuffer data, int usage); - - /** - * @param target - * @param data - * @param usage - */ - void glBufferDataARB(int target, IntBuffer data, int usage); - - /** - * @param target - * @param data - * @param usage - */ - void glBufferDataARB(int target, ShortBuffer data, int usage); - - /** - * @param target - * @param offset - * @param data - */ - void glBufferSubDataARB(int target, int offset, ByteBuffer data); - - /** - * @param target - * @param offset - * @param data - */ - void glBufferSubDataARB(int target, int offset, FloatBuffer data); - - /** - * @param target - * @param offset - * @param data - */ - void glBufferSubDataARB(int target, int offset, IntBuffer data); - - /** - * @param target - * @param offset - * @param data - */ - void glBufferSubDataARB(int target, int offset, ShortBuffer data); - - /** - * @param buffers - */ - void glDeleteBuffersARB(IntBuffer buffers); - - /** - * @param buffers - */ - void glGenBuffersARB(IntBuffer buffers); - - /** - * @param target - * @param pname - * @param params - */ - void glGetBufferParameterARB(int target, int pname, IntBuffer params); - - /** - * @param target - * @param pname - * @param size - * - * @return - */ - ByteBuffer glGetBufferPointerARB(int target, int pname, int size); - - /** - * @param target - * @param offset - * @param data - */ - void glGetBufferSubDataARB(int target, int offset, ByteBuffer data); - - /** - * @param target - * @param offset - * @param data - */ - void glGetBufferSubDataARB(int target, int offset, FloatBuffer data); - - /** - * @param target - * @param offset - * @param data - */ - void glGetBufferSubDataARB(int target, int offset, IntBuffer data); - - /** - * @param target - * @param offset - * @param data - */ - void glGetBufferSubDataARB(int target, int offset, ShortBuffer data); - - /** - * @param buffer - * - * @return - */ - boolean glIsBufferARB(int buffer); - - /** - * @param target - * @param access - * @param size - * @param oldBuffer - * - * @return - */ - ByteBuffer glMapBufferARB(int target, int access, int size, ByteBuffer oldBuffer); - - /** - * @param target - * - * @return - */ - boolean glUnmapBufferARB(int target); - - /** - * @param target - * @param program - */ - void glBindProgramARB(int target, int program); - - /** - * @param programs - */ - void glDeleteProgramsARB(IntBuffer programs); - - /** - * @param programs - */ - void glGenProgramsARB(IntBuffer programs); - - /** - * @param target - * @param parameterName - * @param params - */ - void glGetProgramARB(int target, int parameterName, IntBuffer params); - - /** - * @param target - * @param index - * @param params - */ - void glGetProgramEnvParameterARB(int target, int index, FloatBuffer params); - - /** - * @param target - * @param index - * @param params - */ - void glGetProgramLocalParameterARB(int target, int index, FloatBuffer params); - - /** - * @param target - * @param parameterName - * @param paramString - */ - void glGetProgramStringARB(int target, int parameterName, ByteBuffer paramString); - - - /** - * @param program - * - * @return - */ - boolean glIsProgramARB(int program); - - /** - * @param target - * @param index - * @param x - * @param y - * @param z - * @param w - */ - void glProgramEnvParameter4fARB(int target, int index, float x, float y, float z, float w); - - - /** - * @param target - * @param index - * @param params - */ - void glProgramEnvParameter4ARB(int target, int index, FloatBuffer params); - - /** - * @param target - * @param index - * @param x - * @param y - * @param z - * @param w - */ - void glProgramLocalParameter4fARB(int target, int index, float x, float y, float z, float w); - - - /** - * @param target - * @param index - * @param params - */ - void glProgramLocalParameter4ARB(int target, int index, FloatBuffer params); - - /** - * @param target - * @param format - * @param string - */ - void glProgramStringARB(int target, int format, ByteBuffer string); - - /** - * @param target - * @param start - * @param count - * @param format - * @param typ... [truncated message content] |
From: Yahoo! G. <no...@ya...> - 2007-06-01 00:42:19
|
We are unable to deliver the message from <jav...@li...> to <jav...@ya...>. Your message was not delivered because it was sent to an announcement-only group, where only the moderator may post. A copy of your original message is attached. If you would like to unsubscribe from this group, please forward this message to jav...@ya... To contact the group moderator, send an email to jav...@ya... For further assistance, please visit http://help.yahoo.com/help/us/groups/ |
From: <eli...@us...> - 2007-05-31 22:09:52
|
Revision: 2838 http://svn.sourceforge.net/java-game-lib/?rev=2838&view=rev Author: elias_naur Date: 2007-05-31 15:09:46 -0700 (Thu, 31 May 2007) Log Message: ----------- Mac OS X: When grabbing the mouse, skip the next event to avoid bogus deltas Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXMouseEventQueue.java Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXMouseEventQueue.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXMouseEventQueue.java 2007-05-31 21:11:34 UTC (rev 2837) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXMouseEventQueue.java 2007-05-31 22:09:46 UTC (rev 2838) @@ -53,6 +53,7 @@ final class MacOSXMouseEventQueue extends MouseEventQueue { private final IntBuffer delta_buffer = BufferUtils.createIntBuffer(2); + private boolean skip_event; private static boolean is_grabbed; MacOSXMouseEventQueue(Component component) { @@ -84,6 +85,10 @@ getMouseDeltas(delta_buffer); int dx = delta_buffer.get(0); int dy = -delta_buffer.get(1); + if (skip_event) { + skip_event = false; + return; + } if ( dx != 0 || dy != 0 ) { putMouseEventWithCoords((byte)-1, (byte)0, dx, dy, 0, nanos); addDelta(dx, dy); @@ -92,6 +97,10 @@ } void warpCursor() { + synchronized (this) { + // If we're going to warp the cursor position, we'll skip the next event to avoid bogus delta values + skip_event = isGrabbed(); + } if (isGrabbed()) { Rectangle bounds = getComponent().getBounds(); Point location_on_screen = getComponent().getLocationOnScreen(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2007-05-31 21:11:34
|
Revision: 2837 http://svn.sourceforge.net/java-game-lib/?rev=2837&view=rev Author: elias_naur Date: 2007-05-31 14:11:34 -0700 (Thu, 31 May 2007) Log Message: ----------- Mac OS X: Synchronized access to grabbed state Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXMouseEventQueue.java Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXMouseEventQueue.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXMouseEventQueue.java 2007-05-31 21:04:52 UTC (rev 2836) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXMouseEventQueue.java 2007-05-31 21:11:34 UTC (rev 2837) @@ -62,12 +62,16 @@ public void setGrabbed(boolean grab) { super.setGrabbed(grab); warpCursor(); + grabMouse(grab); + } + + private static synchronized void grabMouse(boolean grab) { if (is_grabbed != grab) { is_grabbed = grab; nGrabMouse(grab); } } - + protected void resetCursorToCenter() { super.resetCursorToCenter(); /* Clear accumulated deltas */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2007-05-31 21:04:53
|
Revision: 2836 http://svn.sourceforge.net/java-game-lib/?rev=2836&view=rev Author: elias_naur Date: 2007-05-31 14:04:52 -0700 (Thu, 31 May 2007) Log Message: ----------- Mac OS X: Track grabbed state in MacOSXMouseEventQueue Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXMouseEventQueue.java Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXMouseEventQueue.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXMouseEventQueue.java 2007-05-31 21:00:13 UTC (rev 2835) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/MacOSXMouseEventQueue.java 2007-05-31 21:04:52 UTC (rev 2836) @@ -53,6 +53,8 @@ final class MacOSXMouseEventQueue extends MouseEventQueue { private final IntBuffer delta_buffer = BufferUtils.createIntBuffer(2); + private static boolean is_grabbed; + MacOSXMouseEventQueue(Component component) { super(component); } @@ -60,7 +62,10 @@ public void setGrabbed(boolean grab) { super.setGrabbed(grab); warpCursor(); - nGrabMouse(grab); + if (is_grabbed != grab) { + is_grabbed = grab; + nGrabMouse(grab); + } } protected void resetCursorToCenter() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2007-05-31 21:00:14
|
Revision: 2835 http://svn.sourceforge.net/java-game-lib/?rev=2835&view=rev Author: elias_naur Date: 2007-05-31 14:00:13 -0700 (Thu, 31 May 2007) Log Message: ----------- Mac OS X: Don't use global is_grabbed variable in MacOSXMouseEventQueue.nWarpCursor Modified Paths: -------------- trunk/LWJGL/src/native/macosx/org_lwjgl_input_Mouse.c Modified: trunk/LWJGL/src/native/macosx/org_lwjgl_input_Mouse.c =================================================================== --- trunk/LWJGL/src/native/macosx/org_lwjgl_input_Mouse.c 2007-05-31 08:52:55 UTC (rev 2834) +++ trunk/LWJGL/src/native/macosx/org_lwjgl_input_Mouse.c 2007-05-31 21:00:13 UTC (rev 2835) @@ -44,18 +44,12 @@ #include "org_lwjgl_opengl_MacOSXMouseEventQueue.h" #include "common_tools.h" -static bool is_grabbed; - JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXMouseEventQueue_nGrabMouse(JNIEnv *env, jclass unused, jboolean grab) { - bool new_grabbed = grab == JNI_TRUE; - if (is_grabbed != new_grabbed) { - is_grabbed = new_grabbed; - CGAssociateMouseAndMouseCursorPosition(is_grabbed ? FALSE : TRUE); - if (is_grabbed) - CGDisplayHideCursor(kCGDirectMainDisplay); - else - CGDisplayShowCursor(kCGDirectMainDisplay); - } + CGAssociateMouseAndMouseCursorPosition(grab == JNI_TRUE ? FALSE : TRUE); + if (grab) + CGDisplayHideCursor(kCGDirectMainDisplay); + else + CGDisplayShowCursor(kCGDirectMainDisplay); } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_MacOSXMouseEventQueue_nWarpCursor(JNIEnv *env, jclass unused, jint x, jint y) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2007-05-31 08:52:56
|
Revision: 2834 http://svn.sourceforge.net/java-game-lib/?rev=2834&view=rev Author: elias_naur Date: 2007-05-31 01:52:55 -0700 (Thu, 31 May 2007) Log Message: ----------- Windows: Fix repeated character codes Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsKeyboard.java Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2007-05-30 20:33:40 UTC (rev 2833) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2007-05-31 08:52:55 UTC (rev 2834) @@ -599,10 +599,9 @@ private void handleChar(long wParam, long lParam, long millis) { byte previous_state = (byte)((lParam >>> 30) & 0x1); byte state = (byte)(1 - ((lParam >>> 31) & 0x1)); - if (state == previous_state) - return; // Auto-repeat message + boolean repeat = state == previous_state; if (keyboard != null) - keyboard.handleChar((int)(wParam & 0xFF), millis); + keyboard.handleChar((int)(wParam & 0xFF), millis, repeat); } private void handleKeyButton(long wParam, long lParam, long millis) { Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsKeyboard.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsKeyboard.java 2007-05-30 20:33:40 UTC (rev 2833) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsKeyboard.java 2007-05-31 08:52:55 UTC (rev 2834) @@ -161,12 +161,13 @@ retained_millis = millis; retained_char = 0; retained_repeat = repeat; -// translate(virt_key, event_state, millis*1000000); } - public void handleChar(int event_char, long millis) { + public void handleChar(int event_char, long millis, boolean repeat) { + if (has_retained_event && retained_char != 0) + flushRetained(); if (!has_retained_event) { - putEvent(0, (byte)0, event_char, millis, false); + putEvent(0, (byte)0, event_char, millis, repeat); } else retained_char = event_char; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2007-05-30 20:33:48
|
Revision: 2833 http://svn.sourceforge.net/java-game-lib/?rev=2833&view=rev Author: elias_naur Date: 2007-05-30 13:33:40 -0700 (Wed, 30 May 2007) Log Message: ----------- Removed unnecessary (and deadlock prone) synchronized modifiers from methods in Keyboard and Mouse Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/input/Keyboard.java trunk/LWJGL/src/java/org/lwjgl/input/Mouse.java Modified: trunk/LWJGL/src/java/org/lwjgl/input/Keyboard.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/input/Keyboard.java 2007-05-27 15:32:25 UTC (rev 2832) +++ trunk/LWJGL/src/java/org/lwjgl/input/Keyboard.java 2007-05-30 20:33:40 UTC (rev 2833) @@ -303,7 +303,7 @@ * * @throws LWJGLException if the keyboard could not be created for any reason */ - public static synchronized void create() throws LWJGLException { + public static void create() throws LWJGLException { synchronized (OpenGLPackageAccess.global_lock) { if (!Display.isCreated()) throw new IllegalStateException("Display must be created."); @@ -321,7 +321,7 @@ /** * @return true if the keyboard has been created */ - public static synchronized boolean isCreated() { + public static boolean isCreated() { synchronized (OpenGLPackageAccess.global_lock) { return created; } @@ -330,7 +330,7 @@ /** * "Destroy" the keyboard */ - public static synchronized void destroy() { + public static void destroy() { synchronized (OpenGLPackageAccess.global_lock) { if (!created) return; @@ -358,7 +358,7 @@ * @see org.lwjgl.input.Keyboard#getEventKeyState() * @see org.lwjgl.input.Keyboard#getEventCharacter() */ - public static synchronized void poll() { + public static void poll() { synchronized (OpenGLPackageAccess.global_lock) { if (!created) throw new IllegalStateException("Keyboard must be created before you can poll the device"); @@ -378,7 +378,7 @@ * @param key Keycode to check * @return true if the key is down according to the last poll() */ - public static synchronized boolean isKeyDown(int key) { + public static boolean isKeyDown(int key) { synchronized (OpenGLPackageAccess.global_lock) { if (!created) throw new IllegalStateException("Keyboard must be created before you can query key state"); @@ -423,7 +423,7 @@ * Gets the number of keyboard events waiting after doing a buffer enabled poll(). * @return the number of keyboard events */ - public static synchronized int getNumKeyboardEvents() { + public static int getNumKeyboardEvents() { synchronized (OpenGLPackageAccess.global_lock) { if (!created) throw new IllegalStateException("Keyboard must be created before you can read events"); @@ -447,7 +447,7 @@ * @see org.lwjgl.input.Keyboard#getEventCharacter() * @return true if a keyboard event was read, false otherwise */ - public static synchronized boolean next() { + public static boolean next() { synchronized (OpenGLPackageAccess.global_lock) { if (!created) throw new IllegalStateException("Keyboard must be created before you can read events"); @@ -467,8 +467,10 @@ * * @see org.lwjgl.input.Keyboard#getEventKey() */ - public static synchronized void enableRepeatEvents(boolean enable) { - repeat_enabled = enable; + public static void enableRepeatEvents(boolean enable) { + synchronized (OpenGLPackageAccess.global_lock) { + repeat_enabled = enable; + } } /** @@ -477,8 +479,10 @@ * @return true is repeat events are reported, false if not. * @see org.lwjgl.input.Keyboard#getEventKey() */ - public static synchronized boolean areRepeatEventsEnabled() { - return repeat_enabled; + public static boolean areRepeatEventsEnabled() { + synchronized (OpenGLPackageAccess.global_lock) { + return repeat_enabled; + } } private static boolean readNext(KeyEvent event) { @@ -496,16 +500,14 @@ /** * @return Number of keys on this keyboard */ - public static synchronized int getKeyCount() { - synchronized (OpenGLPackageAccess.global_lock) { - return keyCount; - } + public static int getKeyCount() { + return keyCount; } /** * @return The character from the current event */ - public static synchronized char getEventCharacter() { + public static char getEventCharacter() { synchronized (OpenGLPackageAccess.global_lock) { return (char)current_event.character; } @@ -518,7 +520,7 @@ * * @return The key from the current event */ - public static synchronized int getEventKey() { + public static int getEventKey() { synchronized (OpenGLPackageAccess.global_lock) { return current_event.key; } @@ -530,7 +532,7 @@ * * @return True if key was down, or false if released */ - public static synchronized boolean getEventKeyState() { + public static boolean getEventKeyState() { synchronized (OpenGLPackageAccess.global_lock) { return current_event.state; } @@ -543,7 +545,7 @@ * origin. * @return The time in nanoseconds of the current event */ - public static synchronized long getEventNanoseconds() { + public static long getEventNanoseconds() { synchronized (OpenGLPackageAccess.global_lock) { return current_event.nanos; } @@ -554,7 +556,7 @@ * @return true if the current event is a repeat event, false if * the current event is not a repeat even or if repeat events are disabled. */ - public static synchronized boolean isRepeatEvent() { + public static boolean isRepeatEvent() { synchronized (OpenGLPackageAccess.global_lock) { return current_event.repeat; } Modified: trunk/LWJGL/src/java/org/lwjgl/input/Mouse.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/input/Mouse.java 2007-05-27 15:32:25 UTC (rev 2832) +++ trunk/LWJGL/src/java/org/lwjgl/input/Mouse.java 2007-05-30 20:33:40 UTC (rev 2833) @@ -146,7 +146,7 @@ * * @return the currently bound native cursor, if any. */ - public static synchronized Cursor getNativeCursor() { + public static Cursor getNativeCursor() { synchronized (OpenGLPackageAccess.global_lock) { return currentCursor; } @@ -163,7 +163,7 @@ * @return The previous Cursor object set, or null. * @throws LWJGLException if the cursor could not be set for any reason */ - public static synchronized Cursor setNativeCursor(Cursor cursor) throws LWJGLException { + public static Cursor setNativeCursor(Cursor cursor) throws LWJGLException { synchronized (OpenGLPackageAccess.global_lock) { if ((Cursor.getCapabilities() & Cursor.CURSOR_ONE_BIT_TRANSPARENCY) == 0) throw new IllegalStateException("Mouse doesn't support native cursors"); @@ -190,7 +190,7 @@ * @param y The y coordinate of the new cursor position in OpenGL coordinates relative * to the window origin. */ - public static synchronized void setCursorPosition(int new_x, int new_y) { + public static void setCursorPosition(int new_x, int new_y) { synchronized (OpenGLPackageAccess.global_lock) { if (!isCreated()) throw new IllegalStateException("Mouse is not created"); @@ -260,7 +260,7 @@ * * @throws LWJGLException if the mouse could not be created for any reason */ - public static synchronized void create() throws LWJGLException { + public static void create() throws LWJGLException { synchronized (OpenGLPackageAccess.global_lock) { if (!Display.isCreated()) throw new IllegalStateException("Display must be created."); @@ -271,7 +271,7 @@ /** * @return true if the mouse has been created */ - public static synchronized boolean isCreated() { + public static boolean isCreated() { synchronized (OpenGLPackageAccess.global_lock) { return created; } @@ -280,7 +280,7 @@ /** * "Destroy" the mouse. */ - public static synchronized void destroy() { + public static void destroy() { synchronized (OpenGLPackageAccess.global_lock) { if (!created) return; created = false; @@ -312,7 +312,7 @@ * @see org.lwjgl.input.Mouse#getDY() * @see org.lwjgl.input.Mouse#getDWheel() */ - public static synchronized void poll() { + public static void poll() { synchronized (OpenGLPackageAccess.global_lock) { if (!created) throw new IllegalStateException("Mouse must be created before you can poll it"); implementation.pollMouse(coord_buffer, buttons); @@ -353,7 +353,7 @@ * @param button The index of the button you wish to test (0..getButtonCount-1) * @return true if the specified button is down */ - public static synchronized boolean isButtonDown(int button) { + public static boolean isButtonDown(int button) { synchronized (OpenGLPackageAccess.global_lock) { if (!created) throw new IllegalStateException("Mouse must be created before you can poll the button state"); if (button >= buttonCount || button < 0) @@ -368,7 +368,7 @@ * @param button The button * @return a String with the button's human readable name in it or null if the button is unnamed */ - public static synchronized String getButtonName(int button) { + public static String getButtonName(int button) { synchronized (OpenGLPackageAccess.global_lock) { if (button >= buttonName.length || button < 0) return null; @@ -381,7 +381,7 @@ * Get's a button's index. If the button is unrecognised then -1 is returned. * @param buttonName The button name */ - public static synchronized int getButtonIndex(String buttonName) { + public static int getButtonIndex(String buttonName) { synchronized (OpenGLPackageAccess.global_lock) { Integer ret = (Integer) buttonMap.get(buttonName); if (ret == null) @@ -400,7 +400,7 @@ * @see org.lwjgl.input.Mouse#getEventButtonState() * @return true if a mouse event was read, false otherwise */ - public static synchronized boolean next() { + public static boolean next() { synchronized (OpenGLPackageAccess.global_lock) { if (!created) throw new IllegalStateException("Mouse must be created before you can read events"); if (readBuffer.hasRemaining()) { @@ -432,7 +432,7 @@ /** * @return Current events button. Returns -1 if no button state was changed */ - public static synchronized int getEventButton() { + public static int getEventButton() { synchronized (OpenGLPackageAccess.global_lock) { return eventButton; } @@ -442,7 +442,7 @@ * Get the current events button state. * @return Current events button state. */ - public static synchronized boolean getEventButtonState() { + public static boolean getEventButtonState() { synchronized (OpenGLPackageAccess.global_lock) { return eventState; } @@ -451,7 +451,7 @@ /** * @return Current events delta x. Only valid when the mouse is grabbed. */ - public static synchronized int getEventDX() { + public static int getEventDX() { synchronized (OpenGLPackageAccess.global_lock) { return event_dx; } @@ -460,7 +460,7 @@ /** * @return Current events delta y. Only valid when the mouse is grabbed. */ - public static synchronized int getEventDY() { + public static int getEventDY() { synchronized (OpenGLPackageAccess.global_lock) { return event_dy; } @@ -469,7 +469,7 @@ /** * @return Current events absolute x. Only valid when the mouse is not grabbed. */ - public static synchronized int getEventX() { + public static int getEventX() { synchronized (OpenGLPackageAccess.global_lock) { return event_x; } @@ -478,7 +478,7 @@ /** * @return Current events absolute y. Only valid when the mouse is not grabbed. */ - public static synchronized int getEventY() { + public static int getEventY() { synchronized (OpenGLPackageAccess.global_lock) { return event_y; } @@ -487,7 +487,7 @@ /** * @return Current events delta z */ - public static synchronized int getEventDWheel() { + public static int getEventDWheel() { synchronized (OpenGLPackageAccess.global_lock) { return event_dwheel; } @@ -501,7 +501,7 @@ * * @return The time in nanoseconds of the current event */ - public static synchronized long getEventNanoseconds() { + public static long getEventNanoseconds() { synchronized (OpenGLPackageAccess.global_lock) { return event_nanos; } @@ -513,7 +513,7 @@ * * @return Absolute x axis position of mouse */ - public static synchronized int getX() { + public static int getX() { synchronized (OpenGLPackageAccess.global_lock) { return x; } @@ -525,7 +525,7 @@ * * @return Absolute y axis position of mouse */ - public static synchronized int getY() { + public static int getY() { synchronized (OpenGLPackageAccess.global_lock) { return y; } @@ -534,7 +534,7 @@ /** * @return Movement on the x axis since last time getDX() was called. Only valid when the mouse is grabbed. */ - public static synchronized int getDX() { + public static int getDX() { synchronized (OpenGLPackageAccess.global_lock) { int result = dx; dx = 0; @@ -545,7 +545,7 @@ /** * @return Movement on the y axis since last time getDY() was called. Only valid when the mouse is grabbed. */ - public static synchronized int getDY() { + public static int getDY() { synchronized (OpenGLPackageAccess.global_lock) { int result = dy; dy = 0; @@ -556,7 +556,7 @@ /** * @return Movement of the wheel since last time getDWheel() was called */ - public static synchronized int getDWheel() { + public static int getDWheel() { synchronized (OpenGLPackageAccess.global_lock) { int result = dwheel; dwheel = 0; @@ -567,7 +567,7 @@ /** * @return Number of buttons on this mouse */ - public static synchronized int getButtonCount() { + public static int getButtonCount() { synchronized (OpenGLPackageAccess.global_lock) { return buttonCount; } @@ -576,7 +576,7 @@ /** * @return Whether or not this mouse has wheel support */ - public static synchronized boolean hasWheel() { + public static boolean hasWheel() { synchronized (OpenGLPackageAccess.global_lock) { return hasWheel; } @@ -585,7 +585,7 @@ /** * @return whether or not the mouse has grabbed the cursor */ - public static synchronized boolean isGrabbed() { + public static boolean isGrabbed() { synchronized (OpenGLPackageAccess.global_lock) { return isGrabbed; } @@ -599,7 +599,7 @@ * * @param grab whether the mouse should be grabbed */ - public static synchronized void setGrabbed(boolean grab) { + public static void setGrabbed(boolean grab) { synchronized (OpenGLPackageAccess.global_lock) { isGrabbed = grab; if (isCreated()) { @@ -618,7 +618,7 @@ * This method is called automatically by the window on its update, and * shouldn't be called otherwise */ - public static synchronized void updateCursor() { + public static void updateCursor() { synchronized (OpenGLPackageAccess.global_lock) { if (emulateCursorAnimation && currentCursor != null && currentCursor.hasTimedOut()) { currentCursor.nextCursor(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2007-05-27 15:32:28
|
Revision: 2832 http://svn.sourceforge.net/java-game-lib/?rev=2832&view=rev Author: elias_naur Date: 2007-05-27 08:32:25 -0700 (Sun, 27 May 2007) Log Message: ----------- Windows: Fix up WindowsContextImplementation.nSetSwapInterval Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsContextImplementation.java trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsContextImplementation.c Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsContextImplementation.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsContextImplementation.java 2007-05-27 13:17:35 UTC (rev 2831) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsContextImplementation.java 2007-05-27 15:32:25 UTC (rev 2832) @@ -97,12 +97,12 @@ private static native boolean nIsCurrent(ByteBuffer context_handle) throws LWJGLException; public void setSwapInterval(int value) { - boolean success = nSetSwapInterval(value) == GL11.GL_TRUE ? true : false; + boolean success = nSetSwapInterval(value); if (!success) LWJGLUtil.log("Failed to set swap interval"); Util.checkGLError(); } - private static native int nSetSwapInterval(int value); + private static native boolean nSetSwapInterval(int value); public void destroy(PeerInfo peer_info, ByteBuffer handle) throws LWJGLException { nDestroy(handle); Modified: trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsContextImplementation.c =================================================================== --- trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsContextImplementation.c 2007-05-27 13:17:35 UTC (rev 2831) +++ trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsContextImplementation.c 2007-05-27 15:32:25 UTC (rev 2832) @@ -105,13 +105,14 @@ return wglGetCurrentContext() == context_info->context; } -JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_WindowsContextImplementation_nSetSwapInterval +JNIEXPORT jboolean JNICALL Java_org_lwjgl_opengl_WindowsContextImplementation_nSetSwapInterval (JNIEnv *env, jclass clazz, jint value) { WGLExtensions extensions; extgl_InitWGL(&extensions); if (extensions.WGL_EXT_swap_control) { - extensions.wglSwapIntervalEXT(value); - } + return extensions.wglSwapIntervalEXT(value) ? JNI_TRUE : JNI_FALSE; + } else + return JNI_FALSE; } JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsContextImplementation_nDestroy This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2007-05-27 13:17:37
|
Revision: 2831 http://svn.sourceforge.net/java-game-lib/?rev=2831&view=rev Author: elias_naur Date: 2007-05-27 06:17:35 -0700 (Sun, 27 May 2007) Log Message: ----------- Linux: Move input grab update from createWindow to when MapNotify is received. This avoid any input grabbing being ignored because the window is not yet mapped Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2007-05-27 13:09:48 UTC (rev 2830) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2007-05-27 13:17:35 UTC (rev 2831) @@ -373,7 +373,6 @@ grab = false; minimized = false; dirty = true; - updateInputGrab(); } finally { peer_info.unlock(); } @@ -615,6 +614,7 @@ case LinuxEvent.MapNotify: dirty = true; minimized = false; + updateInputGrab(); break; case LinuxEvent.UnmapNotify: dirty = true; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2007-05-27 13:09:49
|
Revision: 2830 http://svn.sourceforge.net/java-game-lib/?rev=2830&view=rev Author: elias_naur Date: 2007-05-27 06:09:48 -0700 (Sun, 27 May 2007) Log Message: ----------- Display: Add GL error check after initial makeCurrent() (for real this time) Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java 2007-05-27 07:48:43 UTC (rev 2829) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java 2007-05-27 13:09:48 UTC (rev 2830) @@ -767,7 +767,7 @@ private static void makeCurrentAndSetSwapInterval() throws LWJGLException { makeCurrent(); - Util.checkGLerror(); + Util.checkGLError(); setSwapInterval(swap_interval); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2007-05-27 07:48:45
|
Revision: 2829 http://svn.sourceforge.net/java-game-lib/?rev=2829&view=rev Author: elias_naur Date: 2007-05-27 00:48:43 -0700 (Sun, 27 May 2007) Log Message: ----------- Display: Add GL error check after initial makeCurrent() Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java 2007-05-27 05:19:19 UTC (rev 2828) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java 2007-05-27 07:48:43 UTC (rev 2829) @@ -767,6 +767,7 @@ private static void makeCurrentAndSetSwapInterval() throws LWJGLException { makeCurrent(); + Util.checkGLerror(); setSwapInterval(swap_interval); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |