Initial import of eclipse plugins. Note: The plugins are only skeletons, the actual plugins are to be build with the Ant script found in org.lwjgl.build/build.xml. See org.lwjgl.build/READ.ME for details.

Plugin lwjgl.org contains a binary version of LWJGL for development purposes (of this plugin) only. This binary version is ignored by the build script.
This commit is contained in:
Jens von Pilgrim 2011-03-30 09:35:14 +00:00
parent 48eccdc614
commit 0b5b6cbcb4
114 changed files with 4861 additions and 0 deletions

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src/java"/>
<classpathentry kind="src" path="test/java"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="anttasks"/>
</classpath>

View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.lwjgl.build</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
</natures>
</projectDescription>

View File

@ -0,0 +1,13 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: LWJGL Updatesite Build
Bundle-SymbolicName: org.lwjgl.build
Bundle-Version: 1.0.0
Export-Package: org.lwjgl.ant
Import-Package: org.apache.tools.ant,
org.apache.tools.ant.taskdefs,
org.apache.tools.ant.types,
org.apache.tools.ant.types.selectors,
org.apache.tools.ant.util,
org.junit;version="4.8.1"
Bundle-Vendor: Lightweight Java Game Library Project

View File

@ -0,0 +1,88 @@
The build plugin is part of the LWJGL Eclipse plugins. The following plugins are
required:
org.lwjgl
Skeleton plugin, that is it contains the Eclipse Activator for setting up the
native library path, but the lwjgl jars are missing. These jars are added by
the build script later on
org.lwjgl.source
Skeleton plugin for sources, plugin.xml etc are already configured, but again
the sources itself are only added by the build script later on
org.lwjgl.doc
Skeleton plugin for documentation, Javadoc is added by build script, however
some Eclipse help files are already in place
org.lwjgl.info
This plugin was called org.lwjgl.test in the elder version. I renamed it as it
does not really contain a test but Eclipse views. Besides the spinning torus
test view, I added an info view printing out current version of driver etc.
and capabilities of user's OpenGL system
org.lwjgl.tools
This plugin contains a library set up for plain Java projects, in order to get
rid of defining additional parameters in the run configuration. It is
documented in the help files. I have sent you this plugin once, but it never
made it into the update site. Well, now it is in place
org.lwjgl.feature
Feature plugin referencing the core lwjgl plugin. It contains two
feature.xml definitions, one used for playing around in Eclipse, and a
template which is used by the build script. If you ever change something
here, pay attention to also change the template file.
org.lwjgl.feature.sdk
Feature plugin referencing the src, doc, tools and info lwjgl plugin.
It contains two feature.xml definitions, one used for playing around in
Eclipse, and a template which is used by the build script. If you ever change
something here, pay attention to also change the template file.
org.lwjgl.updatesite
Well, this is the updatesite. As in the feature project, site.xml comes
together with a template version used by the build script.
org.lwjgl.build -- THIS Plugin
This is the build script project. Although it is an Eclipse project, you can
simply run the build script with ant from command line. See later on.
Everything is created in org.lwjgl.build/build.
Here is how to build the update site:
1) Create a new folder in org.lwjgl.build/lwjgl-archives , use the version
number as folder name. E.g., for version 2.6 create a folder "2.6",
for version 2.6.1 "2.6.1" and so on.
2) Copy the lwjgl, lwjgl-docs and lwjgl-source zips into that folder. E.g.,
for version 2.6, this folder must contain the following files:
org.lwjgl.build/lwjgl-archives
+ 2.6
- lwjgl-2.6.zip
- lwjgl-docs-2.6.zip
- lwjgl-source-2.6.zip
3) In order to run the build script, change to folder org.lwjgl.build and run
ant with a parameter indicating the appropriate LWJGL version, e.g.
ant -Dversion=2.6 dist
You will find the updatesite in
org.lwjgl.build/build/plugins/org.lwjgl.updatesite
You may note that the jars are all signed. I have added a temporary keystore
with a dummy alias. In order to use your key, simply edit the properties
(line 11-14) in the build script. If you do not want to store the password in
the build script, simply define it via "-Dstorepass=****" in the command line.
Some additional remarks:
- The version number is automatically "normalized" to Eclipse standards,
that is 2.6 will become 2.6.0. You do not have to rename the initial archives,
you can use 2.6. Or 2.6.1 ;-)
- The lwjgl-debug.jar is not added to the org.lwjgl plugin, as I do not know
how to select one or the other. But I have not further investigated in
that direction.
- Note that only the created plugin and feature jars are signed, and not the
nested lwjgl.jar etc., as I figure that you will sign these jars yourself
when creating the zip files.
- When testing the update site and the installation of plugins, pay attention
to the Eclipse P2 system, which caches a lot of things. Simply uninstalling
a plugin does not remove the plugins from the Eclipse installation. When
the very same version is re-installed, instead of loading new files from the
update site these pre-installed versions are reused!

View File

@ -0,0 +1,3 @@
source.. = src/java/
bin.includes = META-INF/,\
.

View File

@ -0,0 +1,444 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Call with
ant -Dversion=1.9.1 dist
(C) 2011 LWJGL-Project
Author: Jens von Pilgrim, developer@jevopi.de
-->
<project default="help" basedir="." name="" xmlns:ant4eclipse="antlib:org.ant4eclipse" xmlns:antcontrib="antlib:net.sf.antcontrib">
<property name="keystore" value="teststore" />
<property name="alias" value="tester" />
<property name="storepass" value="tester" />
<property name="keypass" value="${storepass}" />
<property name="eclipse.updatesite" value="http://www.lwjgl.org/update/" />
<property name="bundle.vendor" value="lwjgl.org" />
<taskdef name="packagelist" classname="org.lwjgl.ant.PackageList">
<classpath>
<pathelement location="./anttasks" />
</classpath>
</taskdef>
<taskdef name="normalizeversion" classname="org.lwjgl.ant.NormalizeVersion">
<classpath>
<pathelement location="./anttasks" />
</classpath>
</taskdef>
<property name="version" value="unknown" />
<property name="archives.dir" value="lwjgl-archives/${version}" />
<property name="skeletons.dir" value=".." />
<property name="build.path" value="build" />
<property name="build.temp" value="${build.path}/temp" />
<property name="build.plugins" value="${build.path}/plugins" />
<property name="lwjgl.zip" value="lwjgl-${version}.zip" />
<property name="lwjgl_docs.zip" value="lwjgl-docs-${version}.zip" />
<property name="lwjgl_source.zip" value="lwjgl-source-${version}.zip" />
<property name="lwjgl.dir" value="${build.temp}/lwjgl-${version}" />
<property name="lwjgl_docs.dir" value="${build.temp}/javadoc" />
<property name="lwjgl_source.dir" value="${build.temp}/src" />
<property name="NL" value="&#10;" />
<!--
<property name="" value="" />
-->
<target name="init">
<normalizeversion version="${version}" property="normversion" />
<echo>Building plugins for version ${version}, normalized version ${normversion}</echo>
</target>
<target name="dist" depends="init">
<mkdir dir="${build.temp}" />
<!-- *******************************************************************
*
* Copy original plugins to build folder. Copy source to source plugin
* only, move classes into place.
*
******************************************************************** -->
<mkdir dir="${build.plugins}" />
<copy todir="${build.plugins}/org.lwjgl">
<fileset dir="${skeletons.dir}/org.lwjgl" casesensitive="yes">
<exclude name="**/src/**" />
<exclude name="**/*.jar" />
<!-- do not copy jars used for development -->
<exclude name="**/build/**" />
<exclude name="**/build.properties" />
<!-- do not copy development settings -->
<exclude name="**/.settings/**" />
<exclude name="**/.classpath" />
<exclude name="**/.project" />
</fileset>
</copy>
<copy todir="${build.plugins}/org.lwjgl">
<fileset dir="${skeletons.dir}/org.lwjgl/build/classes" casesensitive="yes">
</fileset>
</copy>
<copy todir="${build.plugins}/org.lwjgl.source">
<fileset dir="${skeletons.dir}/org.lwjgl.source" casesensitive="yes">
<exclude name="**/build.properties" />
<exclude name="**/.settings/**" />
<exclude name="**/.classpath" />
<exclude name="**/.project" />
</fileset>
</copy>
<copy todir="${build.plugins}/org.lwjgl.doc">
<fileset dir="${skeletons.dir}/org.lwjgl.doc" casesensitive="yes">
<exclude name="**/build.properties" />
<exclude name="**/.settings/**" />
<exclude name="**/.classpath" />
<exclude name="**/.project" />
</fileset>
</copy>
<copy todir="${build.plugins}/org.lwjgl.info">
<fileset dir="${skeletons.dir}/org.lwjgl.info" casesensitive="yes">
<exclude name="**/src/**" />
<exclude name="**/build/**" />
<exclude name="**/build.properties" />
<exclude name="**/.settings/**" />
<exclude name="**/.classpath" />
<exclude name="**/.project" />
</fileset>
</copy>
<copy todir="${build.plugins}/org.lwjgl.info">
<fileset dir="${skeletons.dir}/org.lwjgl.info/build/classes" casesensitive="yes">
</fileset>
</copy>
<copy todir="${build.plugins}/org.lwjgl.tools">
<fileset dir="${skeletons.dir}/org.lwjgl.tools" casesensitive="yes">
<exclude name="**/src/**" />
<exclude name="**/build/**" />
<exclude name="**/build.properties" />
<exclude name="**/.settings/**" />
<exclude name="**/.classpath" />
<exclude name="**/.project" />
</fileset>
</copy>
<copy todir="${build.plugins}/org.lwjgl.tools">
<fileset dir="${skeletons.dir}/org.lwjgl.tools/build/classes" casesensitive="yes">
</fileset>
</copy>
<copy todir="${build.plugins}/org.lwjgl.feature">
<fileset dir="${skeletons.dir}/org.lwjgl.feature" casesensitive="yes">
<exclude name="**/build.properties" />
<exclude name="**/.settings/**" />
<exclude name="**/.classpath" />
<exclude name="**/.project" />
<exclude name="**/*.template" />
</fileset>
</copy>
<copy todir="${build.plugins}/org.lwjgl.updatesite">
<fileset dir="${skeletons.dir}/org.lwjgl.updatesite" casesensitive="yes">
<exclude name="**/.settings/**" />
<exclude name="**/.classpath" />
<exclude name="**/.project" />
<exclude name="**/*.template" />
</fileset>
</copy>
<!-- *******************************************************************
*
* Unzip archives and move content into approriate plugins
*
******************************************************************** -->
<unzip src="${archives.dir}/${lwjgl.zip}" dest="${build.temp}" />
<copy todir="${build.plugins}/org.lwjgl/native">
<fileset dir="${lwjgl.dir}/native" />
</copy>
<copy todir="${build.plugins}/org.lwjgl/">
<fileset dir="${lwjgl.dir}/jar">
<exclude name="**/lwjgl-debug.jar" />
</fileset>
</copy>
<copy todir="${build.plugins}/org.lwjgl/doc">
<fileset dir="${lwjgl.dir}/doc" />
</copy>
<packagelist property="bundle.export-package" pathsep=",${NL} ">
<fileset dir="${lwjgl.dir}/jar">
<exclude name="**/lwjgl-debug.jar" />
</fileset>
<patternset>
<exclude name="**/test/**" />
<exclude name="**/examples/**" />
</patternset>
</packagelist>
<pathconvert property="bundle.classpath.jars" pathsep=",${NL} ">
<map from="${basedir}/${lwjgl.dir}/jar/" to="" />
<fileset dir="${lwjgl.dir}/jar">
<exclude name="**/lwjgl-debug.jar" />
<exclude name="**/lwjgl_test.jar" />
</fileset>
</pathconvert>
<!-- *******************************************************************
*
* Build plugins
*
******************************************************************** -->
<!-- *******************************************************************
*
* org.lwjgl
*
* Build manifest files, not using manifest task, since manifest wraps
* at the wrong positions (at least ant 1.7)
*
******************************************************************** -->
<echo file="${build.plugins}/org.lwjgl/META-INF/MANIFEST.MF" encoding="UTF-8">Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: LWJGL Lightweight Java Game Library
Bundle-SymbolicName: org.lwjgl
Bundle-Version: ${normversion}
Bundle-Vendor: ${bundle.vendor}
Bundle-Activator: org.lwjgl.eclipse.Activator
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime
Bundle-ActivationPolicy: lazy
Export-Package: org.lwjgl.eclipse,${NL} ${bundle.export-package}
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ClassPath: .,${NL} ${bundle.classpath.jars}
</echo>
<!-- *******************************************************************
*
* org.lwjgl.doc
*
* Build manifest files, not using manifest task, since manifest wraps
* at the wrong positions (at least ant 1.7)
*
******************************************************************** -->
<copy file="${archives.dir}/${lwjgl_docs.zip}" tofile="${build.plugins}/org.lwjgl.doc/doc.zip" />
<echo file="${build.plugins}/org.lwjgl.doc/META-INF/MANIFEST.MF" encoding="UTF-8">Manifest-Version: 1.0
Bundle-Vendor: ${bundle.vendor}
Bundle-Version: ${normversion}
Bundle-SymbolicName: org.lwjgl.doc;singleton:=true
Bundle-Localization: plugin
Require-Bundle: org.eclipse.help;bundle-version="3.2.0"
Eclipse-LazyStart: true
</echo>
<!-- *******************************************************************
*
* org.lwjgl.source
*
* Build manifest files, not using manifest task, since manifest wraps
* at the wrong positions (at least ant 1.7)
*
******************************************************************** -->
<unzip src="${archives.dir}/${lwjgl_source.zip}" dest="${build.temp}" />
<!-- Build src zips for plugin org.lwjgl -->
<property name="org.lwjgl.src.dir" value="${build.plugins}/org.lwjgl.source/src/org.lwjgl_${normversion}" />
<mkdir dir="${org.lwjgl.src.dir}" />
<zip destfile="${org.lwjgl.src.dir}/lwjglsrc.zip">
<fileset dir="${lwjgl_source.dir}/generated" />
<fileset dir="${lwjgl_source.dir}/java">
<exclude name="org/lwjgl/util/**" />
</fileset>
</zip>
<zip destfile="${org.lwjgl.src.dir}/lwjgl_utilsrc.zip">
<fileset dir="${lwjgl_source.dir}/java">
<include name="org/lwjgl/util/**" />
<exclude name="org/lwjgl/util/applet/**" />
</fileset>
</zip>
<!--
<zip destfile="${org.lwjgl.src.dir}/lwjgl_util_applet.zip">
<fileset dir="${lwjgl_source.dir}/java">
<include name="org/lwjgl/util/applet/**" />
</fileset>
</zip>
-->
<zip destfile="${org.lwjgl.src.dir}/lwjgl_eclipse.zip">
<fileset dir="${skeletons.dir}/org.lwjgl/src/java" casesensitive="yes">
<include name="org/lwjgl/**" />
</fileset>
</zip>
<zip destfile="${org.lwjgl.src.dir}/lwjgl_tools.zip">
<fileset dir="${skeletons.dir}/org.lwjgl.tools/src/java" casesensitive="yes">
<include name="org/lwjgl/**" />
</fileset>
</zip>
<zip destfile="${org.lwjgl.src.dir}/lwjgl_info.zip">
<fileset dir="${skeletons.dir}/org.lwjgl.info/src/java" casesensitive="yes">
<include name="org/lwjgl/**" />
</fileset>
</zip>
<!-- Build manfest -->
<!-- not using manifest task, since manifest wraps at the wrong positions -->
<echo file="${build.plugins}/org.lwjgl.source/META-INF/MANIFEST.MF" encoding="UTF-8">Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: LWJGL Sources
Bundle-Vendor: ${bundle.vendor}
Bundle-Version: ${normversion}
Bundle-SymbolicName: org.lwjgl.source;singleton:=true
Bundle-Localization: plugin
</echo>
<!-- *******************************************************************
*
* org.lwjgl.info
*
* Build manifest files, not using manifest task, since manifest wraps
* at the wrong positions (at least ant 1.7)
*
******************************************************************** -->
<echo file="${build.plugins}/org.lwjgl.info/META-INF/MANIFEST.MF" encoding="UTF-8">Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: LWJGL Test and Info View
Bundle-Vendor: ${bundle.vendor}
Bundle-Version: ${normversion}
Bundle-SymbolicName: org.lwjgl.info;singleton:=true
Bundle-Localization: plugin
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.ui.views,
org.eclipse.core.resources,
org.lwjgl
Bundle-RequiredExecutionEnvironment: J2SE-1.5
</echo>
<!-- Files are already in place -->
<!-- *******************************************************************
*
* org.lwjgl.tools
*
* Build manifest files, not using manifest task, since manifest wraps
* at the wrong positions (at least ant 1.7)
*
******************************************************************** -->
<!-- Build plugin org.lwjgl.tools -->
<echo file="${build.plugins}/org.lwjgl.tools/META-INF/MANIFEST.MF" encoding="UTF-8">Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: LWJGL Tools Plug-in
Bundle-SymbolicName: org.lwjgl.tools;singleton:=true
Bundle-Version: ${normversion}
Bundle-Vendor: ${bundle.vendor}
Bundle-Activator: org.lwjgl.tools.Activator
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.core.resources;bundle-version="3.4.0",
org.eclipse.jdt.core;bundle-version="3.4.0",
org.eclipse.jdt.ui;bundle-version="3.4.0",
org.lwjgl;bundle-version="${normversion}",
org.eclipse.jdt.launching;bundle-version="3.4.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
</echo>
<!-- Files are already in place -->
<!-- *******************************************************************
*
* org.lwjgl.feature
*
******************************************************************** -->
<!-- Build org.lwjgl.feature -->
<copy file="${skeletons.dir}/org.lwjgl.feature/feature.xml.template" tofile="${build.plugins}/org.lwjgl.feature/feature.xml" encoding="UTF-8" overwrite="true">
<filterset>
<filter token="VERSION" value="${normversion}" />
<filter token="PROVIDERNAME" value="${bundle.vendor}" />
<filter token="UPDATEURL" value="${eclipse.updatesite}" />
</filterset>
</copy>
<!-- *******************************************************************
*
* org.lwjgl.feature.sdk
*
*
******************************************************************** -->
<!-- Build org.lwjgl.feature -->
<copy file="${skeletons.dir}/org.lwjgl.feature.sdk/feature.xml.template" tofile="${build.plugins}/org.lwjgl.feature.sdk/feature.xml" encoding="UTF-8" overwrite="true">
<filterset>
<filter token="VERSION" value="${normversion}" />
<filter token="PROVIDERNAME" value="${bundle.vendor}" />
<filter token="UPDATEURL" value="${eclipse.updatesite}" />
</filterset>
</copy>
<!-- *******************************************************************
*
* Build update site, i.e. zip all plugins and feature with version
* number to appropriate place
*
******************************************************************** -->
<!-- Build update site -->
<copy file="${skeletons.dir}/org.lwjgl.updatesite/site.xml.template" tofile="${build.plugins}/org.lwjgl.updatesite/site.xml" encoding="UTF-8" overwrite="true">
<filterset>
<filter token="VERSION" value="${normversion}" />
<filter token="PROVIDERNAME" value="${bundle.vendor}" />
<filter token="UPDATEURL" value="${eclipse.updatesite}" />
</filterset>
</copy>
<mkdir dir="${build.plugins}/org.lwjgl.updatesite/plugins" />
<mkdir dir="${build.plugins}/org.lwjgl.updatesite/features" />
<jar destfile="${build.plugins}/org.lwjgl.updatesite/plugins/org.lwjgl_${normversion}.jar" manifest="${build.plugins}/org.lwjgl/META-INF/MANIFEST.MF">
<fileset dir="${build.plugins}/org.lwjgl" casesensitive="yes" />
</jar>
<jar destfile="${build.plugins}/org.lwjgl.updatesite/plugins/org.lwjgl.doc_${normversion}.jar" manifest="${build.plugins}/org.lwjgl.doc/META-INF/MANIFEST.MF">
<fileset dir="${build.plugins}/org.lwjgl.doc" casesensitive="yes" />
</jar>
<jar destfile="${build.plugins}/org.lwjgl.updatesite/plugins/org.lwjgl.source_${normversion}.jar" manifest="${build.plugins}/org.lwjgl.source/META-INF/MANIFEST.MF">
<fileset dir="${build.plugins}/org.lwjgl.source" casesensitive="yes" />
</jar>
<jar destfile="${build.plugins}/org.lwjgl.updatesite/plugins/org.lwjgl.info_${normversion}.jar" manifest="${build.plugins}/org.lwjgl.info/META-INF/MANIFEST.MF">
<fileset dir="${build.plugins}/org.lwjgl.info" casesensitive="yes" />
</jar>
<jar destfile="${build.plugins}/org.lwjgl.updatesite/plugins/org.lwjgl.tools_${normversion}.jar" manifest="${build.plugins}/org.lwjgl.tools/META-INF/MANIFEST.MF">
<fileset dir="${build.plugins}/org.lwjgl.tools" casesensitive="yes" />
</jar>
<jar destfile="${build.plugins}/org.lwjgl.updatesite/features/org.lwjgl_${normversion}.jar">
<fileset dir="${build.plugins}/org.lwjgl.feature" casesensitive="yes" />
</jar>
<jar destfile="${build.plugins}/org.lwjgl.updatesite/features/org.lwjgl.sdk_${normversion}.jar">
<fileset dir="${build.plugins}/org.lwjgl.feature.sdk" casesensitive="yes" />
</jar>
<!-- *******************************************************************
*
* Sign plugins and feature
*
******************************************************************** -->
<signjar jar="${build.plugins}/org.lwjgl.updatesite/features/org.lwjgl_${normversion}.jar" keystore="${keystore}" alias="${alias}" storepass="${storepass}" keypass="${keypass}" />
<signjar jar="${build.plugins}/org.lwjgl.updatesite/features/org.lwjgl.sdk_${normversion}.jar" keystore="${keystore}" alias="${alias}" storepass="${storepass}" keypass="${keypass}" />
<signjar jar="${build.plugins}/org.lwjgl.updatesite/plugins/org.lwjgl_${normversion}.jar" keystore="${keystore}" alias="${alias}" storepass="${storepass}" keypass="${keypass}" />
<signjar jar="${build.plugins}/org.lwjgl.updatesite/plugins/org.lwjgl.doc_${normversion}.jar" keystore="${keystore}" alias="${alias}" storepass="${storepass}" keypass="${keypass}" />
<signjar jar="${build.plugins}/org.lwjgl.updatesite/plugins/org.lwjgl.source_${normversion}.jar" keystore="${keystore}" alias="${alias}" storepass="${storepass}" keypass="${keypass}" />
<signjar jar="${build.plugins}/org.lwjgl.updatesite/plugins/org.lwjgl.info_${normversion}.jar" keystore="${keystore}" alias="${alias}" storepass="${storepass}" keypass="${keypass}" />
<signjar jar="${build.plugins}/org.lwjgl.updatesite/plugins/org.lwjgl.tools_${normversion}.jar" keystore="${keystore}" alias="${alias}" storepass="${storepass}" keypass="${keypass}" />
</target>
<target name="clean">
<delete dir="${build.path}" />
</target>
<target name="help">
<echo>Call this build with version number and target dist, e.g.</echo>
<echo> ant -Dversion=1.1.2 dist</echo>
</target>
</project>

View File

@ -0,0 +1,173 @@
/*******************************************************************************
* Copyright (c) 2011 LWJGL Project and others
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html, and under the terms of the
* BSD license, see http://lwjgl.org/license.php for details.
*
* Contributors:
* Jens von Pilgrim - initial implementation
******************************************************************************/
package org.lwjgl.ant;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Task;
/**
* Normalizes a version number and stores result in a property. The version
* number is normalized as "%n.%n.%n", e.g. "2.6" becomes "2.6.0"
*
* @author Jens von Pilgrim
* @since Nov 14, 2010
* @see http://wiki.eclipse.org/index.php/Version_Numbering
*/
public class NormalizeVersion extends Task {
/**
* name of the property to set
*/
protected String property;
protected String version;
/**
* @return the property
*/
public String getProperty() {
return property;
}
/**
* @param i_property the property to set
*/
public void setProperty(String i_property) {
property = i_property;
}
/**
* @return the versionNumber
*/
public String getVersion() {
return version;
}
/**
* @param i_versionNumber the versionNumber to set
*/
public void setVersion(String version) {
this.version =version;
}
/**
* check for errors
* @throws BuildException if we are not configured right
*/
private void validate() {
//validation
if (property == null) {
throw new BuildException("attribute property missing");
}
if (version == null) {
throw new BuildException("attribute version missing");
}
}
/**
* Sets given property with normalized version number accoring to
* major.minor.service[.qualifier]
* {@inheritDoc}
* @see org.apache.tools.ant.Task#execute()
*/
@Override
public void execute() throws BuildException {
validate();
//now exit here if the property is already set
if (getProject().getProperty(property) != null) {
return;
}
String normalizedVersionNumber = doExecute();
getProject().setNewProperty(property, normalizedVersionNumber);
}
/**
* @return
*/
protected String doExecute() {
String s = getVersion().trim();
StringBuilder n = new StringBuilder();
int snIndex = 0;
boolean qualifier = false;
String digits = "";
for (int i = 0; i < s.length(); i++) {
char c = s.charAt(i);
if (Character.isDigit(c) && !qualifier) {
digits += c;
} else if (c == '.') {
if (qualifier) {
throw new BuildException(
"Wrong format, qualifier must not contain a dot in "
+ s);
}
if (snIndex < 3) {
if (digits.length() > 0) {
if (snIndex > 0)
n.append('.');
n.append(digits);
digits = "";
snIndex++;
}
} else {
throw new BuildException(
"Wrong format, expected digit, was " + c
+ " at pos " + i + " of " + s);
}
} else if (Character.isJavaIdentifierPart(c)) {
if (digits.length() > 0) {
throw new BuildException(
"Wrong format, qualifier must not start with digits in "
+ s);
}
if (!qualifier) {
switch (snIndex) {
case 0: // e.g. "beta"
n.append("0");
break;
case 1: // e.g. "1.beta
n.append(".0");
case 2: // e.g. "1.2.beta
n.append(".0");
}
qualifier = true;
n.append('.');
}
n.append(c);
}
}
if (!qualifier) {
if (digits.length()>0) {
if (snIndex > 0)
n.append('.');
n.append(digits);
snIndex++;
}
switch (snIndex) {
case 0: // e.g. ""
n.append("0");
break;
case 1: // e.g. "1.beta
n.append(".0");
case 2: // e.g. "1.2.beta
n.append(".0");
}
}
return n.toString();
}
}

View File

@ -0,0 +1,270 @@
/*******************************************************************************
* Copyright (c) 2011 LWJGL Project and others
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html, and under the terms of the
* BSD license, see http://lwjgl.org/license.php for details.
*
* Contributors:
* Jens von Pilgrim - initial implementation
******************************************************************************/
package org.lwjgl.ant;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.Date;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.Vector;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.taskdefs.Expand;
import org.apache.tools.ant.types.PatternSet;
import org.apache.tools.ant.types.selectors.SelectorUtils;
import org.apache.tools.ant.util.FileNameMapper;
import org.apache.tools.ant.util.FileUtils;
/**
* Ant task extracting package names (or generally directory names) into given
* property.
*
* Parameters:
* - just like unzip, except dest can be null and is ignored otherwise
* - property - name of property storing the resulting list
* - pathsep - path separator, default ","
* - dirsep - directory separator, default "."
* - includeemptydirs -- whether to include empty directories, default: false
*
* @author Jens von Pilgrim
* @since 12.09.2007
*/
public class PackageList extends Expand {
/**
* The property to receive the conversion
*/
private String property = null;
/**
* User override on path sep char
*/
private String pathSep = ",";
/**
* User override on directory sep char
*/
private String dirSep = ".";
private boolean includeemptydirs = false;
class IntegerContainer {
int value;
public void inc() {
value++;
}
};
TreeMap<String, IntegerContainer> packagelist = new TreeMap<String, IntegerContainer>();
/**
* {@inheritDoc}
* @see org.apache.tools.ant.taskdefs.Expand#execute()
*/
@Override
public void execute() throws BuildException {
setDest(new File(" no file, files are only listed internaly"));
super.execute();
StringBuffer strb = new StringBuffer();
for (String name : packagelist.keySet()) {
// System.out.println("name: " + name + " (" +packagelist.get(name).value + ")" );
if (includeemptydirs || packagelist.get(name).value > 0) {
if (strb.length() > 0) {
strb.append(pathSep);
}
StringTokenizer stDirectory = new StringTokenizer(name, "/",
true);
while (stDirectory.hasMoreTokens()) {
String token = stDirectory.nextToken();
strb.append("/".equals(token) ? dirSep : token);
}
}
}
if (property != null) {
String value = strb.toString();
getProject().setNewProperty(property, value);
}
}
private Vector<PatternSet> patternsets = new Vector<PatternSet>();
/**
* Add a patternset.
* @param set a pattern set
*/
public void addPatternset(PatternSet set) {
super.addPatternset(set);
patternsets.addElement(set);
}
/**
* {@inheritDoc}
* @see org.apache.tools.ant.taskdefs.Expand#extractFile(org.apache.tools.ant.util.FileUtils, java.io.File, java.io.File, java.io.InputStream, java.lang.String, java.util.Date, boolean, org.apache.tools.ant.util.FileNameMapper)
*/
@Override
protected void extractFile(FileUtils i_fileUtils, File i_srcF, File i_dir,
InputStream i_compressedInputStream, String i_entryName,
Date i_entryDate, boolean i_isDirectory, FileNameMapper i_mapper)
throws IOException {
if (!matchPatterns(i_entryName)) {
//Do not process this file
return;
}
String strDir = getDir(i_isDirectory, i_entryName);
if (strDir != null && !"META-INF".equals(strDir)) {
if (!packagelist.containsKey(strDir)) {
packagelist.put(strDir, new IntegerContainer());
}
if (!i_isDirectory) {
packagelist.get(strDir).inc();
}
}
}
/**
* @param i_entryName
*/
private boolean matchPatterns(String i_entryName) {
if (patternsets != null && patternsets.size() > 0) {
boolean included = false;
String name = i_entryName.replace('/', File.separatorChar).replace(
'\\', File.separatorChar);
Set<String> includePatterns = new HashSet<String>();
Set<String> excludePatterns = new HashSet<String>();
for (int v = 0, size = patternsets.size(); v < size; v++) {
PatternSet p = (PatternSet) patternsets.elementAt(v);
String[] incls = p.getIncludePatterns(getProject());
if (incls == null || incls.length == 0) {
// no include pattern implicitly means includes="**"
incls = new String[] { "**" };
}
for (int w = 0; w < incls.length; w++) {
String pattern = incls[w].replace('/', File.separatorChar)
.replace('\\', File.separatorChar);
if (pattern.endsWith(File.separator)) {
pattern += "**";
}
includePatterns.add(pattern);
}
String[] excls = p.getExcludePatterns(getProject());
if (excls != null) {
for (int w = 0; w < excls.length; w++) {
String pattern = excls[w].replace('/',
File.separatorChar).replace('\\',
File.separatorChar);
if (pattern.endsWith(File.separator)) {
pattern += "**";
}
excludePatterns.add(pattern);
}
}
}
for (Iterator<String> iter = includePatterns.iterator(); !included
&& iter.hasNext();) {
String pattern = iter.next();
included = SelectorUtils.matchPath(pattern, name);
}
for (Iterator<String> iter = excludePatterns.iterator(); included
&& iter.hasNext();) {
String pattern = iter.next();
included = !SelectorUtils.matchPath(pattern, name);
}
return included;
}
return true;
}
/**
* @param i_isDirectory
* @param i_entryName
* @return
*/
private String getDir(boolean i_isDirectory, String i_entryName) {
if (i_entryName == null)
return null;
int iIndex = i_entryName.lastIndexOf('/');
if (iIndex >= 0) {
return i_entryName.substring(0, iIndex);
}
if (i_isDirectory) {
return i_entryName;
}
return null;
}
/**
* Set the name of the property into which the converted path will be placed.
* @param p the property name.
*/
public void setProperty(String p) {
property = p;
}
/**
* Set the default path separator string; defaults to current JVM
* {@link java.io.File#pathSeparator File.pathSeparator}.
* @param sep path separator string.
*/
public void setPathSep(String sep) {
pathSep = sep;
}
/**
* Set the default directory separator string;
* defaults to current JVM {@link java.io.File#separator File.separator}.
* @param sep directory separator string.
*/
public void setDirSep(String sep) {
dirSep = sep;
}
/**
* Simple getter for attribute includeemptydirs.
* @return the includeemptydirs
*/
public boolean isIncludeemptydirs() {
return includeemptydirs;
}
/**
* Simple setter for attribute includeemptydirs.
* @param i_includeemptydirs the includeemptydirs to set
*/
public void setIncludeemptydirs(boolean i_includeemptydirs) {
includeemptydirs = i_includeemptydirs;
}
}

View File

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- ======================================================================
Nov 15, 2010 9:45:57 PM
project
description
jpilgrim
====================================================================== -->
<project name="project" default="default">
<description>
description
</description>
<taskdef name="normalizeVersion" classname="de.jevopi.ant.NormalizeVersion" >
<classpath>
<pathelement location="../../build/classes"/>
</classpath>
</taskdef>
<!-- =================================
target: default
================================= -->
<target name="default" depends="depends" description="description">
<normalizeVersion property="norm" version="1.2" />
<echo>${norm}</echo>
</target>
<!-- - - - - - - - - - - - - - - - - -
target: depends
- - - - - - - - - - - - - - - - - -->
<target name="depends">
</target>
</project>

View File

@ -0,0 +1,71 @@
/*******************************************************************************
* Copyright (c) 2008 Jens von Pilgrim and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Project: de.jevopi.anttasks
* File: NormalizeVersionTest.java
* Date: Nov 14, 2010
*******************************************************************************/
package org.lwjgl.ant;
import org.junit.Assert;
import org.apache.tools.ant.BuildException;
import org.junit.Test;
/**
* NormalizeVersionTest
* There should really be more documentation here.
*
* @author Jens von Pilgrim
* @version $Revision$
* @since Nov 14, 2010
*/
public class NormalizeVersionTest {
@Test
public void testNormalizer() {
NormalizeVersion t = new NormalizeVersion();
t.setProperty("normalized");
t.setVersion("1");
Assert.assertEquals("1.0.0", t.doExecute());
t.setVersion("1.2");
Assert.assertEquals("1.2.0", t.doExecute());
t.setVersion("1.2.3");
Assert.assertEquals("1.2.3", t.doExecute());
t.setVersion("1.2.3.beta");
Assert.assertEquals("1.2.3.beta", t.doExecute());
t.setVersion("1.2.beta");
Assert.assertEquals("1.2.0.beta", t.doExecute());
}
@Test(expected= BuildException.class) public void tooManyDots() {
NormalizeVersion t = new NormalizeVersion();
t.setProperty("normalized");
t.setVersion("1.2.3.4.5");
t.doExecute();
}
@Test(expected= BuildException.class) public void qualifierWithNumber() {
NormalizeVersion t = new NormalizeVersion();
t.setProperty("normalized");
t.setVersion("1.2beta");
t.doExecute();
}
}

Binary file not shown.

View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.lwjgl.doc</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
</natures>
</projectDescription>

View File

@ -0,0 +1,6 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: LWJGL Documentation
Bundle-SymbolicName: org.lwjgl.doc; singleton:=true
Bundle-Version: 2
Bundle-Vendor: Lightweight Java Game Library Project

View File

@ -0,0 +1,55 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html>
<head>
<title>About</title>
<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
</head>
<body lang="EN-US">
<img src="lwjgl_logo.png" align="right"/>
<h2>About This Content</h2>
<p>The <a href="http://lwjgl.org">Lightweight Java Game Library (LWJGL)</a> is a solution aimed
directly at professional and amateur Java programmers alike to enable <a
href="projects.php">commercial quality games</a> to be written in Java.
LWJGL provides developers access to high performance crossplatform
libraries such as OpenGL (<a href="http://www.opengl.org/"
target="_blank">Open Graphics Library</a>) and OpenAL (<a
href="http://www.openal.org" target="_blank">Open Audio Library</a>)
allowing for state of the art 3D games and 3D sound. Additionally LWJGL
provides access to controllers such as Gamepads, Steering wheel and
Joysticks. All in a simple and straight forward API.</p>
<p>LWJGL is not meant to make writing games particularly easy; it is
primarily an enabling technology which allows developers to get at
resources that are simply otherwise unavailable or poorly implemented on
the existing <a href="http://java.sun.com" target="_blank">Java
platform</a>. We anticipate that the LWJGL will, through evolution and
extension, become the foundation for more complete game libraries and
"game engines" as they have popularly become known, and hide some of the
new evils we have had to expose in the APIs.</p>
<p>LWJGL is available under a <a href="http://lwjgl.org/license.php">BSD
license</a>, which means it's open source and freely available at no charge.</p>
<p>Please visit us on the Freenode IRC Network: <a
href="irc://irc.freenode.net/lwjgl" target="_blank">#LWJGL</a>. Do idle
if there is no one to answer any of your questions, we are on different
timezones.</p>
<h2>Plug-Ins</h2>
<p>The following plug-ins are provided:
<dl>
<dt>org.lwjgl</dt>
<dd>Platform independent jars and native libraries for Windows, Linux and Mac OS X</dd>
<dt>org.lwjgl.doc</dt>
<dd>Documentation (JavaDoc)</dd>
<dt>org.lwjgl.source</dt>
<dd>Source files</dd>
<dt>org.lwjgl.tools</dt>
<dd>Developer tools</dd>
<dt>org.lwjgl.info</dt>
<dd>LWJGL test and info view</dd>
</dl>
</p>
</body>
</html>

View File

@ -0,0 +1,4 @@
bin.includes = plugin.xml,\
META-INF/,\
html/,\
*.xml

Binary file not shown.

After

Width:  |  Height:  |  Size: 84 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 88 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

View File

@ -0,0 +1,66 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>LWJGL Eclipse Plugins</title>
</head>
<body>
<div style="background-image:url(fig/mesh.png); height:220px; max-width: 878px"><img src="fig/logo.png" align="left" /></div>
<h2>Table of Contents</h2>
<p>
Plugin documentation
<ul>
<li><a href="plugins.html">Overview and Core Plugins</a></li>
<li><a href="tools.html">LWJGL plugin for Java developers</a></li>
<li><a href="views.html">LWJGL Eclipse views</a></li>
</ul>
</p>
<p>
API
<ul>
<li><a href="javadoc/index.html">API Reference</a></li>
</ul>
</p>
<p>
External resources
<ul>
<li><a href="http://lwjgl.org/">LWJGL Website (extern)</a></li>
<li><a href="http://wiki.lwjgl.org/">LWJGL Wiki (extern)</a></li>
<li><a href="http://lwjgl.org/forum/">LWJGL Forum (extern)</a></li>
</ul>
</p>
<h2>About LWJGL</h2>
<p>The <a href="http://lwjgl.org">Lightweight Java Game Library (LWJGL)</a> is a solution aimed
directly at professional and amateur Java programmers alike to enable <a
href="http://lwjgl.org/projects.php">commercial quality games</a> to be written in Java.
LWJGL provides developers access to high performance crossplatform
libraries such as OpenGL (<a href="http://www.opengl.org/"
target="_blank">Open Graphics Library</a>) and OpenAL (<a
href="http://www.openal.org" target="_blank">Open Audio Library</a>)
allowing for state of the art 3D games and 3D sound. Additionally LWJGL
provides access to controllers such as Gamepads, Steering wheel and
Joysticks. All in a simple and straight forward API.</p>
<p>LWJGL is not meant to make writing games particularly easy; it is
primarily an enabling technology which allows developers to get at
resources that are simply otherwise unavailable or poorly implemented on
the existing <a href="http://java.sun.com" target="_blank">Java
platform</a>. We anticipate that the LWJGL will, through evolution and
extension, become the foundation for more complete game libraries and
"game engines" as they have popularly become known, and hide some of the
new evils we have had to expose in the APIs.</p>
<p>LWJGL is available under a <a href="http://lwjgl.org/license.php">BSD
license</a>, which means it's open source and freely available at no charge.</p>
<p>Please visit us on the Freenode IRC Network: <a
href="irc://irc.freenode.net/lwjgl" target="_blank">#LWJGL</a>. Do idle
if there is no one to answer any of your questions, we are on different
timezones.</p>
</body>
</html>

View File

@ -0,0 +1,60 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>LWJGL Eclipse Plugins</title>
</head>
<body>
<img src="fig/lwjgl_logo.png" align="right" />
<h1>Overview</h1>
<p>The following plug-ins are provided:
<dl>
<dt>org.lwjgl</dt>
<dd>Platform independent jars and native libraries for Windows, Linux, Solaris and Mac OS X</dd>
<dt>org.lwjgl.doc</dt>
<dd>Documentation, containing API documentation (Javadoc) and additional material such as this document your currently reading.</dd>
<dt>org.lwjgl.source</dt>
<dd>Source files of LWJGL Java components</dd>
<dt>org.lwjgl.info</dt>
<dd>Two Eclipse views, one for testing LWJGL and one printing out OpenGL specific information</dd>
<dt>org.lwjgl.tools</dt>
<dd>Plugin for Java developers, providing a LWJGL library for the Java Build Path settings</dd>
</dl>
</p>
All plugins are briefly described in the following.
<h2>LWJGL library: org.lwjgl</h2>
The most important plugin, which actually is the only one needed by non-developers, is org.lwjgl.
It makes the LWJGL library available as an Eclipse plugin. That is if you write an Eclipse plugin using LWJGL,
simply add this plugin to the list of required plugins. It does not only provide the necessary jar files,
but it also configures the library path in order to automatically load the appropriate native library wihtin
the Eclipse workbench.
<h2>LWJGL documentation and sources</h2>
<p>Both, documentation and sources, are only required for developers. Both, Javadoc and sources, are attached to
the LWJGL library in order to allow you easy access to these information. That is, you can simply open an LWJGL class,
and the source code will be opened. JavaDoc is available via tool-tip and with Shift-F2. You do not have to configure
anything in order to access the documentation and the source code.
The tools plugin makes JavaDoc and source code available for non-plugin projects as well.</p>
<p>
Note that only the Java source code is provided, if you want to have a look at the native code, please download
the LWJGL sources from the LWJGL website.
</p>
<h2>LWJGL for Java developers</h2>
<p>The org.lwjgl.tools plugin provides an already configured library to be added
to a projects build path. It does not only provide the JARs and native libraries,
relieving developers from configuring extra VM arguments in the run configuration,
but it also configures Javadoc and source code to be available in Java projects just as in
plugin projects.</p>
Read more about how to set up the library <a href="tools.html">here</a>.
<h2>Information and test view</h2>
<p>In order to test whether your installation is correct and in order to
retrieve additional information on your system, two views are provided. The test view
draws a spinning torso, while the information view simply prints out available
versions and features of your graphics card and OpenGL driver.</p>
Read more about how to open the views <a href="views.html">here</a>.
</body>
</html>

View File

@ -0,0 +1,72 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>LWJGL Tools</title>
</head>
<body>
<h1>LWJGL Tools</h1>
<p>The org.lwjgl.tools plugin provides an already configured library to be added
to a projects build path. It does not only provide the JARs and native libraries,
relieving developers from configuring extra VM arguments in the run configuration,
but it also configures Javadoc and source code to be available in Java projects just as in
plugin projects.
</p>
<p>You will also need the org.lwjgl plugin. JavaDoc and source code are
retrieved from the org.lwjgl.doc and org.lwjgl.source plugins.</p>
<h2>Configure the LWJGL library</h2>
You can configure the LWJGL library for a plain Java project by opening the
projects properties. Select "Java Build Path" and "Libraries", such as shown in
Figure 1. Note: Click on the images here to show a larger version.
<div style="text-align:center">
<a href="fig/addLib_1.png">
<img src="fig/addLib_1.png" style="height:200px; display:block; margin:0px auto 10px; text-align:center;" border="0" alt="
"id="Project properties" /></a>
<span style="font-weight:bold;font-size:small">Fig. 1: Project properties</span>
</div>
Select "Add Library..." on the right hand side. This will open a new dialog window as shown in Figure 2.
<div style="text-align:center">
<a href="fig/addLib_2.png">
<img src="fig/addLib_2.png" style="height:200px; display:block; margin:0px auto 10px; text-align:center;" border="0" alt="
"id="Add library" /></a>
<span style="font-weight:bold;font-size:small">Fig. 2: Add library</span>
</div>
Select "LWJGL Library". You can simply press "Finish". However if you want to have some information about
the paths of the added library, simply select "Next". In the latter case, the next wizard page will show
you the path settings automatically configured by the tool plugin as shown in Figure 3.
<div style="text-align:center">
<a href="fig/addLib_3.png">
<img src="fig/addLib_3.png" style="height:200px; display:block; margin:0px auto 10px; text-align:center;" border="0" alt="
"id="Library info" /></a>
<span style="font-weight:bold;font-size:small">Fig. 3: Library info</span>
</div>
You have no successfully configured the LWJGL library, as shown in Figure 4. Press "OK" to finish the set up.
<div style="text-align:center">
<a href="fig/addLib_4.png">
<img src="fig/addLib_4.png" style="height:200px; display:block; margin:0px auto 10px; text-align:center;" border="0" alt="
"id="Configured library" /></a>
<span style="font-weight:bold;font-size:small">Fig. 4: Configured library</span>
</div>
<p>
You can now use the LWJGL library in your Java project, and you can simply start
the project by selecting "Run As / Java Application..." in the context menu of a class containing a main method.
That is, you do not have to configure some VM arguments in the run configuration anymore, which will hopefully make development
much easier.
</p>
<p>Note: At this moment, no further tools, e.g., for exporting an LWJGL application, exists.
Feel free to write missing functions and contact us in order to add new functionalty.</p>
</body>
</html>

View File

@ -0,0 +1,72 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>LWJGL Eclipse Views</title>
</head>
<body>
<h1>LWJGL Eclipse Views</h1>
<p><p>In order to test whether your installation is correct and in order to
retrieve additional information on your system, two views are provided. The test view
draws a spinning torso, while the information view simply prints out available
versions and features of your graphics card and OpenGL driver.</p>
</p>
<h2>Open the views</h2>
You can open the views by selecting them from "Windows / Show View / Other..." as shown in
Figure 1. Note: Click on the images here to show a larger version.
<div style="text-align:center">
<a href="fig/openView_1.png">
<img src="fig/openView_1.png" style="height:200px; display:block; margin:0px auto 10px; text-align:center;" border="0" alt="
"id="Show View Others" /></a>
<span style="font-weight:bold;font-size:small">Fig. 1: Show View / Others...</span>
</div>
Under "Other", you will find two LWJGL views: "LWJGL Information View" and "LWJGL Test View" (see Figure 2).
<div style="text-align:center">
<a href="fig/openView_2.png">
<img src="fig/openView_2.png" style="height:200px; display:block; margin:0px auto 10px; text-align:center;" border="0" alt="
"id="LWJGL views" /></a>
<span style="font-weight:bold;font-size:small">Fig. 2: LWJGL views</span>
</div>
Select "LWJGL Information View" in order to open a simple text view, as shown in Figure 3.
<div style="text-align:center">
<a href="fig/openView_Info.png">
<img src="fig/openView_Info.png" style="height:200px; display:block; margin:0px auto 10px; text-align:center;" border="0" alt="
"id="LWJGL Information View" /></a>
<span style="font-weight:bold;font-size:small">Fig. 3: LWJGL Information View</span>
</div>
<p>
This view shows the version numbers of the LWJGL feature, i.e. the LWJGL plugins, and the LWJGL library. For bug reports, it is usually very
useful to provide additional information about your OpenGL configuration. This view provides you with a lot of necessary information. Note that
not all information can be retrieved on all systems. Features not supported by your graphics card or OpenGL driver are omitted, you see only the
available features and capabilities.
</p>
<p>In order to test whether LWJGL and OpenGL works on your system, open the test view. The view should look similar to Figure 4.
<div style="text-align:center">
<a href="fig/openView_Test.png">
<img src="fig/openView_Test.png" style="height:200px; display:block; margin:0px auto 10px; text-align:center;" border="0" alt="
"id="LWJGL Test View" /></a>
<span style="font-weight:bold;font-size:small">Fig. 4: LWJGL Test View</span>
</div>
The OpenGL code of this torso actually stems from an Eclipse SWT snippet:
<a href="http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet195.java?view=markup&content-type=text%2Fvnd.viewcvs-markup&revision=HEAD">snippet 195</a>.
<p>
You should see a spinning torso and the current frames per second (fps) in the status bar. If you do not even see this torso,
something has gone seriously wrong when installing the plugins. Note that other OpenGL based applications might cause problems, even if
you can see this test view: The test view does not use any extended OpenGL features, such as framebuffer objects. If an application
requires an additional feature which is not supported by your system (see Information View to retrieve the supported features), it
won't run. Sometimes it helps to update the drive of your graphics card!
</p>
</body>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
<extension
point="org.eclipse.help.toc">
<toc
file="toc.xml"
primary="true">
</toc>
</extension>
<extension point="org.eclipse.pde.core.javadoc">
<javadoc path="doc.zip!/javadoc/" archive="true">
<plugin id="org.lwjgl"/>
</javadoc>
</extension>
</plugin>

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<?NLS TYPE="org.eclipse.help.toc"?>
<toc label="LWJGL Documentation">
<topic href="html/overview.html" label="Overview">
</topic>
<topic href="javadoc/index.html" label="API Reference">
</topic>
<topic href="html/plugins.html" label="LWJGL Plugin Documentation">
<topic href="html/tools.html" label="Tools for Java developers">
</topic>
<topic href="html/views.html" label="LWJGL Eclipse Views">
</topic>
</topic>
</toc>

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.lwjgl.feature.sdk</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.pde.FeatureBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.FeatureNature</nature>
</natures>
</projectDescription>

View File

@ -0,0 +1 @@
bin.includes = feature.xml

View File

@ -0,0 +1,95 @@
<?xml version="1.0" encoding="UTF-8"?>
<feature
id="org.lwjgl.sdk"
label="Lightweight Java Game Library (LWJGL)"
version="2"
provider-name="Lightweight Java Game Library Project"
image="lwjgl_logo.png">
<description url="http://lwjgl.org">
This feature provides easy access to the
Lightweight Java Game Library (LWJGL)
for Eclipse plugin developers. It includes
- source code
- javadoc
- info plugin
- library tool
</description>
<copyright url="http://lwjgl.org/credits.php">
Copyright (c) 2002-2011 Lightweight Java Game Library Project
All rights reserved.
LWJGL is available under a BSD license, which means it&apos;s open
source and freely available at no charge.
Eclipse feature and plugins, plugin specific code made available under
a BSD license and Eclipse Public License (EPL).
</copyright>
<license url="http://lwjgl.org/license.php">
Copyright (c) 2002-2011 Lightweight Java Game Library 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 &apos;Light Weight Java Game Library&apos; 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
&quot;AS IS&quot; 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.
</license>
<url>
<update label="LWJGL Update Site" url="http://lwjgl.org/update"/>
<discovery label="Home of the Lightweight Java Game Library" url="http://lwjgl.org/index.php"/>
</url>
<requires>
<import feature="org.lwjgl" version="2"/>
</requires>
<plugin
id="org.lwjgl.doc"
download-size="2800"
install-size="2800"
version="2"/>
<plugin
id="org.lwjgl.source"
download-size="1200"
install-size="1200"
version="2"/>
<plugin
id="org.lwjgl.info"
download-size="50"
install-size="50"
version="2"/>
<plugin
id="org.lwjgl.tools"
download-size="16"
install-size="16"
version="2"/>
</feature>

View File

@ -0,0 +1,95 @@
<?xml version="1.0" encoding="UTF-8"?>
<feature
id="org.lwjgl.sdk"
label="Lightweight Java Game Library (LWJGL) SDK"
version="@VERSION@"
provider-name="Lightweight Java Game Library Project"
image="lwjgl_logo.png">
<description url="http://lwjgl.org">
This feature provides easy access to the
Lightweight Java Game Library (LWJGL) SDK
for Eclipse plugin developers. It includes
- source code
- javadoc
- info plugin (Test and Info View)
- library tool (Library configuration for plain Java development)
</description>
<copyright url="http://lwjgl.org/credits.php">
Copyright (c) 2002-2011 Lightweight Java Game Library Project
All rights reserved.
LWJGL is available under a BSD license, which means it&apos;s open
source and freely available at no charge.
Eclipse feature and plugins, plugin specific code made available under a
BSD license and Eclipse Public License (EPL).
</copyright>
<license url="http://lwjgl.org/license.php">
Copyright (c) 2002-2011 Lightweight Java Game Library 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 &apos;Light Weight Java Game Library&apos; 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
&quot;AS IS&quot; 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.
</license>
<url>
<update label="LWJGL Update Site" url="http://lwjgl.org/update" />
<discovery label="Home of the Lightweight Java Game Library" url="http://lwjgl.org/index.php"/>
</url>
<requires>
<import feature="org.lwjgl" version="@VERSION@"/>
</requires>
<plugin
id="org.lwjgl.doc"
download-size="2800"
install-size="2800"
version="@VERSION@"/>
<plugin
id="org.lwjgl.source"
download-size="1200"
install-size="1200"
version="@VERSION@"/>
<plugin
id="org.lwjgl.info"
download-size="50"
install-size="50"
version="@VERSION@"/>
<plugin
id="org.lwjgl.tools"
download-size="16"
install-size="16"
version="@VERSION@"/>
</feature>

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.lwjgl.feature</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.pde.FeatureBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.FeatureNature</nature>
</natures>
</projectDescription>

View File

@ -0,0 +1,2 @@
bin.includes = feature.xml,\
lwjgl_logo.png

View File

@ -0,0 +1,93 @@
<?xml version="1.0" encoding="UTF-8"?>
<feature
id="org.lwjgl"
label="Lightweight Java Game Library Project (LWJGL)"
version="2"
provider-name="Lightweight Java Game Library Project"
image="lwjgl_logo.png">
<description url="http://lwjgl.org">
This feature provides easy access to the
Lightweight Java Game Library (LWJGL)
for Eclipse plugin developers. It includes
- java and native libraries (Windows, Mac OS X, Linux, Solaris)
- source code
- javadoc
- info plugin
- library tool
</description>
<copyright url="http://lwjgl.org/credits.php">
Copyright (c) 2002-2010 Lightweight Java Game Library Project
All rights reserved.
LWJGL is available under a BSD license, which means it&apos;s open
source and freely available at no charge.
Eclipse feature and plugins created by Jens von Pilgrim (developer@jevopi.de),
plugin specific code made available under a BSD license and
Eclipse Public License (EPL).
</copyright>
<license url="http://lwjgl.org/license.php">
Copyright (c) 2002-2010 Lightweight Java Game Library 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 &apos;Light Weight Java Game Library&apos; 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
&quot;AS IS&quot; 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.
</license>
<url>
<update label="LWJGL Update Site" url="http://lwjgl.org/update"/>
<discovery label="Home of the Lightweight Java Game Library" url="http://lwjgl.org/index.php"/>
</url>
<plugin
id="org.lwjgl"
download-size="3700"
install-size="3700"
version="2"/>
<plugin
id="org.lwjgl.doc"
download-size="2800"
install-size="2800"
version="2"/>
<plugin
id="org.lwjgl.source"
download-size="1200"
install-size="1200"
version="2"/>
<plugin
id="org.lwjgl.info"
download-size="50"
install-size="50"
version="2"/>
</feature>

View File

@ -0,0 +1,72 @@
<?xml version="1.0" encoding="UTF-8"?>
<feature
id="org.lwjgl"
label="Lightweight Java Game Library (LWJGL)"
version="@VERSION@"
provider-name="Lightweight Java Game Library Project"
image="lwjgl_logo.png">
<description url="http://lwjgl.org">
This feature provides easy access to the
Lightweight Java Game Library (LWJGL)
for Eclipse plugin developers. It includes
- java and native libraries (Windows, Mac OS X, Linux, Solaris)
For source, javadoc and more tools install SDK.
</description>
<copyright url="http://lwjgl.org/credits.php">
Copyright (c) 2002-2010 Lightweight Java Game Library Project
All rights reserved.
LWJGL is available under a BSD license, which means it&apos;s open
source and freely available at no charge.
Eclipse feature and plugins created by Jens von Pilgrim (developer@jevopi.de),
plugin specific code made available under a BSD license and
Eclipse Public License (EPL).
</copyright>
<license url="http://lwjgl.org/license.php">
Copyright (c) 2002-2010 Lightweight Java Game Library 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 &apos;Light Weight Java Game Library&apos; 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
&quot;AS IS&quot; 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.
</license>
<url>
<update label="LWJGL Update Site" url="http://lwjgl.org/update" />
<discovery label="Home of the Lightweight Java Game Library" url="http://lwjgl.org/index.php"/>
</url>
<plugin
id="org.lwjgl"
download-size="3700"
install-size="3700"
version="@VERSION@"/>
</feature>

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src/java"/>
<classpathentry kind="output" path="build/classes"/>
</classpath>

View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.lwjgl.info</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View File

@ -0,0 +1,12 @@
#Thu Sep 13 13:53:08 CEST 2007
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.5

View File

@ -0,0 +1,16 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: LWJGL TestView
Bundle-Vendor: Lightweight Java Game Library Project
Bundle-SymbolicName: org.lwjgl.info;singleton:=true
Bundle-Version: 2.0.0
Bundle-Localization: plugin
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.ui.views,
org.eclipse.core.resources
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Import-Package: org.lwjgl,
org.lwjgl.opengl,
org.lwjgl.util,
org.lwjgl.util.glu

View File

@ -0,0 +1,60 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html>
<head>
<title>About</title>
<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
</head>
<body lang="EN-US">
<img src="lwjgl_logo.png" align="right"/>
<h2>About This Content</h2>
<p>The <a href="http://lwjgl.org">Lightweight Java Game Library (LWJGL)</a> is a solution aimed
directly at professional and amateur Java programmers alike to enable <a
href="projects.php">commercial quality games</a> to be written in Java.
LWJGL provides developers access to high performance crossplatform
libraries such as OpenGL (<a href="http://www.opengl.org/"
target="_blank">Open Graphics Library</a>) and OpenAL (<a
href="http://www.openal.org" target="_blank">Open Audio Library</a>)
allowing for state of the art 3D games and 3D sound. Additionally LWJGL
provides access to controllers such as Gamepads, Steering wheel and
Joysticks. All in a simple and straight forward API.</p>
<p>LWJGL is not meant to make writing games particularly easy; it is
primarily an enabling technology which allows developers to get at
resources that are simply otherwise unavailable or poorly implemented on
the existing <a href="http://java.sun.com" target="_blank">Java
platform</a>. We anticipate that the LWJGL will, through evolution and
extension, become the foundation for more complete game libraries and
"game engines" as they have popularly become known, and hide some of the
new evils we have had to expose in the APIs.</p>
<p>LWJGL is available under a <a href="http://lwjgl.org/license.php">BSD
license</a>, which means it's open source and freely available at no charge.</p>
<p>Please visit us on the Freenode IRC Network: <a
href="irc://irc.freenode.net/lwjgl" target="_blank">#LWJGL</a>. Do idle
if there is no one to answer any of your questions, we are on different
timezones.</p>
<h3>Plugin assembly</h3>
<p>The plugins were assembled by Jens von Pilgrim (developer@jevopi.de). All files related to this assembly, such as manifest files or plugin descriptors, are copyright under the Eclipse Public License (EPL) and the BSD license</p>
<h3>Third party code</h3>
<h4>IBM</h4>
<p>The LWJGL Textview contains code copyright under the Eclipse Public License (EPL):<br/>
<pre>
Copyright (c) 2000, 2005 IBM Corporation and others.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
</pre>
The source of this code can be found at:
<a href="http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet195.java?view=markup&content-type=text%2Fvnd.viewcvs-markup&revision=HEAD">http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet195.java?view=markup&content-type=text%2Fvnd.viewcvs-markup&revision=HEAD</a>
</p>
<h4>SGI</h4>
<p>
LWJGL contains code copyright by SGI. This code is copyright under the SGI FreeB v1.1, see <a href="http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/</a>. Note that this license can be updated to version 2.0.
</p>
</body>
</html>

View File

@ -0,0 +1,9 @@
source.. = src/java/
output.. = build/classes/
bin.includes = META-INF/,\
.,\
icons/,\
lwjgl_logo.png,\
plugin.xml,\
about.html
src.includes = src/

Binary file not shown.

After

Width:  |  Height:  |  Size: 574 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.2"?>
<plugin>
<extension point="org.eclipse.ui.views" >
<view
class="org.lwjgl.info.LWJGLTestView"
icon="icons/lwjgl_logo_16.gif"
id="org.lwjgl.info.LWJGLTestView"
name="LWJGL Test View"/>
</extension>
<extension point="org.eclipse.ui.views" >
<view
class="org.lwjgl.info.LWJGLInfoView"
icon="icons/lwjgl_logo_16.gif"
id="org.lwjgl.info.LWJGLInfoView"
name="LWJGL Information View"/>
</extension>
</plugin>

View File

@ -0,0 +1,186 @@
/*******************************************************************************
* Copyright (c) 2011 LWJGL Project and others
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html, and under the terms of the
* BSD license, see http://lwjgl.org/license.php for details.
*
* Contributors:
* Kristian Duske - FPS Status Line Item
*******************************************************************************/
package org.lwjgl.info;
import java.util.logging.Logger;
import org.eclipse.jface.action.ContributionItem;
import org.eclipse.jface.action.StatusLineLayoutData;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CLabel;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
/**
* Displays FPS information in the Eclipse status bar.
*
* @author Kristian Duske
* @version $Revision$
* @since 22.05.2008
* @see $HeadURL$
*/
public class FpsStatusLineItem extends ContributionItem {
private static final int CHAR_WIDTH = 8;
private static final int INDENT = 3;
@SuppressWarnings("unused")
private static final Logger log = Logger.getLogger(FpsStatusLineItem.class
.getName());
private static final int NUM_FRAMES = 500;
private static final long TIMEOUT = 300;
private int m_fixedHeight = -1;
private int m_fixedWidth = -1;
private long[] m_frames = new long[NUM_FRAMES];
private int m_index = 0;
private int m_count = -1;
private double avg;
private long m_lastFrame = -1;
private CLabel m_label;
/**
*
*/
public FpsStatusLineItem() {
for (int i = 0; i < m_frames.length; i++)
m_frames[i] = 0;
avg = 0;
}
/**
* @param i_id
*/
public FpsStatusLineItem(String i_id) {
super(i_id);
}
/**
* {@inheritDoc}
*
* @see org.eclipse.jface.action.ContributionItem#fill(org.eclipse.swt.widgets.Composite)
*/
@Override
public void fill(Composite i_parent) {
Label sep = new Label(i_parent, SWT.SEPARATOR);
m_label = new CLabel(i_parent, SWT.SHADOW_NONE);
StatusLineLayoutData data = new StatusLineLayoutData();
data.widthHint = getWidthHint(i_parent);
m_label.setLayoutData(data);
data = new StatusLineLayoutData();
data.heightHint = getHeightHint(i_parent);
sep.setLayoutData(data);
updateCounter();
}
private int getHeightHint(Composite control) {
if (m_fixedHeight < 0) {
GC gc = new GC(control);
gc.setFont(control.getFont());
m_fixedHeight = gc.getFontMetrics().getHeight();
gc.dispose();
}
return m_fixedHeight;
}
private int getWidthHint(Composite control) {
if (m_fixedWidth < 0) {
GC gc = new GC(control);
gc.setFont(control.getFont());
m_fixedWidth = gc.getFontMetrics().getAverageCharWidth()
* CHAR_WIDTH;
m_fixedWidth += INDENT * 2;
gc.dispose();
}
return m_fixedWidth;
}
/**
* {@inheritDoc}
*
* @see de.feu.draw3d.RenderListener#renderPassFinished()
*/
public void renderPassFinished() {
long time = System.currentTimeMillis();
if (m_lastFrame == -1) {
m_lastFrame = time;
return;
}
long frameTime = time - m_lastFrame;
m_lastFrame = time;
if (frameTime <= TIMEOUT) {
if (m_count < NUM_FRAMES)
m_count++;
avg -= m_frames[m_index];
m_frames[m_index] = frameTime;
avg += m_frames[m_index];
m_index++;
if (m_index >= NUM_FRAMES) {
m_index = 0;
}
}
updateCounter();
}
/**
* {@inheritDoc}
*
* @see de.feu.draw3d.RenderListener#renderPassStarted()
*/
public void renderPassStarted() {
// nothing to do
}
private synchronized void updateCounter() {
long fps = 0;
if (m_count > 0)
fps = (long) (1000.0 / (avg / ((double) m_count)));
// System.out.println("i:"+m_index+", c="+m_count+", avg: " + avg);
if (m_label != null && !m_label.isDisposed()) {
Display display = m_label.getDisplay();
m_label.setForeground(display
.getSystemColor(SWT.COLOR_WIDGET_FOREGROUND));
m_label.setText(fps + " FPS");
}
}
}

View File

@ -0,0 +1,609 @@
/*******************************************************************************
* Copyright (c) 2011 LWJGL Project and others
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html, and under the terms of the
* BSD license, see http://lwjgl.org/license.php for details.
*
* Contributors:
* Jens von Pilgrim - initial implementation
******************************************************************************/
package org.lwjgl.info;
import java.util.Map;
import java.util.Set;
import java.util.TreeMap;
import java.util.TreeSet;
import org.eclipse.core.runtime.IBundleGroup;
import org.eclipse.core.runtime.IBundleGroupProvider;
import org.eclipse.core.runtime.Platform;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.part.ViewPart;
import org.lwjgl.LWJGLException;
import org.lwjgl.LWJGLUtil;
import org.lwjgl.Sys;
import org.lwjgl.opengl.ContextCapabilities;
import org.lwjgl.opengl.Display;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GLContext;
import org.lwjgl.util.glu.GLU;
import org.lwjgl.util.glu.Registry;
/**
* LWJGLInfoView
* There should really be more documentation here.
*
* @author Jens von Pilgrim
* @version $Revision$
* @since Nov 23, 2010
*/
public class LWJGLInfoView extends ViewPart {
static final String NL = System.getProperty("line.separator", "\n");
static final int TAB = 16;
/**
* {@inheritDoc}
* @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
*/
@Override
public void createPartControl(Composite i_parent) {
Text info = new Text(i_parent, SWT.READ_ONLY | SWT.LEFT | SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL );
String infoString = gatherInformation();
info.setText(infoString);
}
static String getFeatureVersion(String myFeatureId) {
IBundleGroupProvider[] providers = Platform.getBundleGroupProviders();
if (providers != null) {
for (int i = 0; i < providers.length; ++i) {
IBundleGroup[] bundleGroups = providers[i].getBundleGroups();
for (IBundleGroup bg : bundleGroups) {
if (bg.getIdentifier().equals(myFeatureId)) {
return bg.getVersion();
}
}
}
}
return "Feature not found";
}
/**
* @return
*/
public static String gatherInformation() {
StringBuffer strb = new StringBuffer();
try {
Display.setFullscreen(false);
Display.create();
} catch (LWJGLException ex) {
warnNL(strb, "Error initializing OpenGL display: " + ex.getMessage());
}
try {
infoNL(strb, "LWJGL feature version", getFeatureVersion("org.lwjgl"));
} catch (Exception ex) {
warnNL(strb, "Error retrieving feature version: " + ex.getMessage());
}
infoNL(strb, "LWJGL version", Sys.getVersion() + (Sys.is64Bit() ? " (64bit)" : ""));
infoNL(strb, "Java", System.getProperty("java.version"), System
.getProperty("java.vendor"));
infoNL(strb, "Platform", LWJGLUtil.getPlatformName());
infoNL(strb, "Graphics card", Display.getAdapter());
infoNL(strb, "Driver version", Display.getVersion());
infoNL(strb, "OpenGL driver version", GL11.glGetString(GL11.GL_VERSION));
infoNL(strb, "GLU version", Registry.gluGetString(GLU.GLU_VERSION));
infoNL(strb, "GLU extensions", Registry.gluGetString(GLU.GLU_EXTENSIONS));
ContextCapabilities caps = GLContext.getCapabilities();
openGLVersions(strb, caps);
strb.append(NL).append("Capabilities").append(NL);
TreeMap<String, Boolean> capInfos = new TreeMap<String, Boolean>();
gatherCapabilities(caps, capInfos);
infoGroupedCaps(strb, capInfos);
Display.destroy();
return strb.toString();
}
static void openGLVersions(StringBuffer strb, ContextCapabilities caps) {
StringBuffer versions = new StringBuffer();
if (caps.OpenGL11) versions.append(", 1.1");
if (caps.OpenGL12) versions.append(", 1.2");
if (caps.OpenGL13) versions.append(", 1.3");
if (caps.OpenGL14) versions.append(", 1.4");
if (caps.OpenGL15) versions.append(", 1.5");
if (caps.OpenGL20) versions.append(", 2.0");
if (caps.OpenGL21) versions.append(", 2.1");
if (caps.OpenGL30) versions.append(", 3.0");
if (caps.OpenGL31) versions.append(", 3.1");
if (caps.OpenGL32) versions.append(", 3.2");
if (caps.OpenGL33) versions.append(", 3.3");
if (caps.OpenGL40) versions.append(", 4.0");
if (caps.OpenGL41) versions.append(", 4.1");
if (strb.length()>2) versions.delete(0, 2);
infoNL(strb, "Supported OpenGL versions", versions.toString());
}
/**
* @param i_strb
* @param i_capInfos
*/
static void infoGroupedCaps(StringBuffer strb,
TreeMap<String, Boolean> capInfos) {
String currentGroup = "*NOGROUP*";
Set<String> groupInfosSupported = new TreeSet<String>();
Set<String> groupInfosNA = new TreeSet<String>();
for (String key : capInfos.keySet()) {
if (!key.startsWith(currentGroup)) {
printGroup(strb, currentGroup, groupInfosSupported,
groupInfosNA);
currentGroup = key.substring(0, key.indexOf(' '));
}
if (capInfos.get(key).booleanValue()) {
groupInfosSupported.add(key);
} else {
groupInfosNA.add(key);
}
}
printGroup(strb, currentGroup, groupInfosSupported, groupInfosNA);
}
/**
* @param i_currentGroup
* @param i_groupInfosSupported
* @param i_groupInfosNA
*/
private static void printGroup(StringBuffer strb, String currentGroup,
Set<String> groupInfosSupported, Set<String> groupInfosNA) {
String title = currentGroup + " extensions";
if (!(groupInfosSupported.isEmpty() && groupInfosNA.isEmpty())) {
if (groupInfosSupported.isEmpty()) {
infoNL(strb, title, "n.a.");
} else {
strb.append(title).append(": ");
for (int i = 0; i < TAB - title.length(); i++) {
strb.append(' ');
}
int c = 1;
for (String s : groupInfosSupported) {
if (c > 1)
strb.append(',');
if (c % 4 == 0) {
strb.append(NL).append(" ");
} else if (c > 1) {
strb.append(' ');
}
strb.append(s.substring(currentGroup.length() + 1));
c++;
}
strb.append(NL);
}
}
groupInfosNA.clear();
groupInfosSupported.clear();
}
/**
* @param caps
* @param capInfos
*/
private static void gatherCapabilities(ContextCapabilities caps,
Map<String, Boolean> capInfos) {
capInfos.put("AMD conservative depth", caps.GL_AMD_conservative_depth);
capInfos.put("AMD debug output", caps.GL_AMD_debug_output);
capInfos.put("AMD draw buffers blend", caps.GL_AMD_draw_buffers_blend);
capInfos.put("AMD name gen delete", caps.GL_AMD_name_gen_delete);
capInfos
.put("AMD performance monitor", caps.GL_AMD_performance_monitor);
capInfos.put("AMD seamless cubemap per texture",
caps.GL_AMD_seamless_cubemap_per_texture);
capInfos.put("AMD shader stencil export",
caps.GL_AMD_shader_stencil_export);
capInfos.put("AMD texture texture4", caps.GL_AMD_texture_texture4);
capInfos.put("AMD transform feedback3 lines triangles",
caps.GL_AMD_transform_feedback3_lines_triangles);
capInfos.put("AMD vertex shader tessellator",
caps.GL_AMD_vertex_shader_tessellator);
capInfos
.put("APPLE aux depth stencil", caps.GL_APPLE_aux_depth_stencil);
capInfos.put("APPLE client storage", caps.GL_APPLE_client_storage);
capInfos.put("APPLE element array", caps.GL_APPLE_element_array);
capInfos.put("APPLE fence", caps.GL_APPLE_fence);
capInfos.put("APPLE float pixels", caps.GL_APPLE_float_pixels);
capInfos.put("APPLE flush buffer range",
caps.GL_APPLE_flush_buffer_range);
capInfos.put("APPLE object purgeable", caps.GL_APPLE_object_purgeable);
capInfos.put("APPLE packed pixels", caps.GL_APPLE_packed_pixels);
capInfos.put("APPLE rgb 422", caps.GL_APPLE_rgb_422);
capInfos.put("APPLE row bytes", caps.GL_APPLE_row_bytes);
capInfos.put("APPLE texture range", caps.GL_APPLE_texture_range);
capInfos.put("APPLE vertex array object",
caps.GL_APPLE_vertex_array_object);
capInfos.put("APPLE vertex array range",
caps.GL_APPLE_vertex_array_range);
capInfos.put("APPLE vertex program evaluators",
caps.GL_APPLE_vertex_program_evaluators);
capInfos.put("APPLE ycbcr 422", caps.GL_APPLE_ycbcr_422);
capInfos.put("ARB ES2 compatibility", caps.GL_ARB_ES2_compatibility);
capInfos
.put("ARB blend func extended", caps.GL_ARB_blend_func_extended);
capInfos.put("ARB cl event", caps.GL_ARB_cl_event);
capInfos.put("ARB color buffer float", caps.GL_ARB_color_buffer_float);
capInfos.put("ARB compatibility", caps.GL_ARB_compatibility);
capInfos.put("ARB copy buffer", caps.GL_ARB_copy_buffer);
capInfos.put("ARB debug output", caps.GL_ARB_debug_output);
capInfos.put("ARB depth buffer float", caps.GL_ARB_depth_buffer_float);
capInfos.put("ARB depth clamp", caps.GL_ARB_depth_clamp);
capInfos.put("ARB depth texture", caps.GL_ARB_depth_texture);
capInfos.put("ARB draw buffers", caps.GL_ARB_draw_buffers);
capInfos.put("ARB draw buffers blend", caps.GL_ARB_draw_buffers_blend);
capInfos.put("ARB draw elements base vertex",
caps.GL_ARB_draw_elements_base_vertex);
capInfos.put("ARB draw indirect", caps.GL_ARB_draw_indirect);
capInfos.put("ARB draw instanced", caps.GL_ARB_draw_instanced);
capInfos.put("ARB explicit attrib location",
caps.GL_ARB_explicit_attrib_location);
capInfos.put("ARB fragment coord conventions",
caps.GL_ARB_fragment_coord_conventions);
capInfos.put("ARB fragment program", caps.GL_ARB_fragment_program);
capInfos.put("ARB fragment program shadow",
caps.GL_ARB_fragment_program_shadow);
capInfos.put("ARB fragment shader", caps.GL_ARB_fragment_shader);
capInfos.put("ARB framebuffer object", caps.GL_ARB_framebuffer_object);
capInfos.put("ARB framebuffer sRGB", caps.GL_ARB_framebuffer_sRGB);
capInfos.put("ARB geometry shader4", caps.GL_ARB_geometry_shader4);
capInfos.put("ARB get program binary", caps.GL_ARB_get_program_binary);
capInfos.put("ARB gpu shader5", caps.GL_ARB_gpu_shader5);
capInfos.put("ARB gpu shader fp64", caps.GL_ARB_gpu_shader_fp64);
capInfos.put("ARB half float pixel", caps.GL_ARB_half_float_pixel);
capInfos.put("ARB half float vertex", caps.GL_ARB_half_float_vertex);
capInfos.put("ARB imaging", caps.GL_ARB_imaging);
capInfos.put("ARB instanced arrays", caps.GL_ARB_instanced_arrays);
capInfos.put("ARB map buffer range", caps.GL_ARB_map_buffer_range);
capInfos.put("ARB matrix palette", caps.GL_ARB_matrix_palette);
capInfos.put("ARB multisample", caps.GL_ARB_multisample);
capInfos.put("ARB multitexture", caps.GL_ARB_multitexture);
capInfos.put("ARB occlusion query", caps.GL_ARB_occlusion_query);
capInfos.put("ARB occlusion query2", caps.GL_ARB_occlusion_query2);
capInfos
.put("ARB pixel buffer object", caps.GL_ARB_pixel_buffer_object);
capInfos.put("ARB point parameters", caps.GL_ARB_point_parameters);
capInfos.put("ARB point sprite", caps.GL_ARB_point_sprite);
capInfos.put("ARB provoking vertex", caps.GL_ARB_provoking_vertex);
capInfos.put("ARB robustness", caps.GL_ARB_robustness);
capInfos.put("ARB sample shading", caps.GL_ARB_sample_shading);
capInfos.put("ARB sampler objects", caps.GL_ARB_sampler_objects);
capInfos.put("ARB seamless cube map", caps.GL_ARB_seamless_cube_map);
capInfos.put("ARB separate shader objects",
caps.GL_ARB_separate_shader_objects);
capInfos
.put("ARB shader bit encoding", caps.GL_ARB_shader_bit_encoding);
capInfos.put("ARB shader objects", caps.GL_ARB_shader_objects);
capInfos.put("ARB shader precision", caps.GL_ARB_shader_precision);
capInfos.put("ARB shader stencil export",
caps.GL_ARB_shader_stencil_export);
capInfos.put("ARB shader subroutine", caps.GL_ARB_shader_subroutine);
capInfos.put("ARB shader texture lod", caps.GL_ARB_shader_texture_lod);
capInfos.put("ARB shading language 100",
caps.GL_ARB_shading_language_100);
capInfos.put("ARB shading language include",
caps.GL_ARB_shading_language_include);
capInfos.put("ARB shadow", caps.GL_ARB_shadow);
capInfos.put("ARB shadow ambient", caps.GL_ARB_shadow_ambient);
capInfos.put("ARB sync", caps.GL_ARB_sync);
capInfos
.put("ARB tessellation shader", caps.GL_ARB_tessellation_shader);
capInfos.put("ARB texture border clamp",
caps.GL_ARB_texture_border_clamp);
capInfos.put("ARB texture buffer object",
caps.GL_ARB_texture_buffer_object);
capInfos.put("ARB texture buffer object rgb32",
caps.GL_ARB_texture_buffer_object_rgb32);
capInfos
.put("ARB texture compression", caps.GL_ARB_texture_compression);
capInfos.put("ARB texture compression bptc",
caps.GL_ARB_texture_compression_bptc);
capInfos.put("ARB texture compression rgtc",
caps.GL_ARB_texture_compression_rgtc);
capInfos.put("ARB texture cube map", caps.GL_ARB_texture_cube_map);
capInfos.put("ARB texture cube map array",
caps.GL_ARB_texture_cube_map_array);
capInfos.put("ARB texture env add", caps.GL_ARB_texture_env_add);
capInfos
.put("ARB texture env combine", caps.GL_ARB_texture_env_combine);
capInfos.put("ARB texture env crossbar",
caps.GL_ARB_texture_env_crossbar);
capInfos.put("ARB texture env dot3", caps.GL_ARB_texture_env_dot3);
capInfos.put("ARB texture float", caps.GL_ARB_texture_float);
capInfos.put("ARB texture gather", caps.GL_ARB_texture_gather);
capInfos.put("ARB texture mirrored repeat",
caps.GL_ARB_texture_mirrored_repeat);
capInfos
.put("ARB texture multisample", caps.GL_ARB_texture_multisample);
capInfos.put("ARB texture non power of two",
caps.GL_ARB_texture_non_power_of_two);
capInfos.put("ARB texture query lod", caps.GL_ARB_texture_query_lod);
capInfos.put("ARB texture rectangle", caps.GL_ARB_texture_rectangle);
capInfos.put("ARB texture rg", caps.GL_ARB_texture_rg);
capInfos.put("ARB texture rgb10 a2ui", caps.GL_ARB_texture_rgb10_a2ui);
capInfos.put("ARB texture swizzle", caps.GL_ARB_texture_swizzle);
capInfos.put("ARB timer query", caps.GL_ARB_timer_query);
capInfos
.put("ARB transform feedback2", caps.GL_ARB_transform_feedback2);
capInfos
.put("ARB transform feedback3", caps.GL_ARB_transform_feedback3);
capInfos.put("ARB transpose matrix", caps.GL_ARB_transpose_matrix);
capInfos.put("ARB uniform buffer object",
caps.GL_ARB_uniform_buffer_object);
capInfos.put("ARB vertex array bgra", caps.GL_ARB_vertex_array_bgra);
capInfos
.put("ARB vertex array object", caps.GL_ARB_vertex_array_object);
capInfos
.put("ARB vertex attrib 64bit", caps.GL_ARB_vertex_attrib_64bit);
capInfos.put("ARB vertex blend", caps.GL_ARB_vertex_blend);
capInfos.put("ARB vertex buffer object",
caps.GL_ARB_vertex_buffer_object);
capInfos.put("ARB vertex program", caps.GL_ARB_vertex_program);
capInfos.put("ARB vertex shader", caps.GL_ARB_vertex_shader);
capInfos.put("ARB vertex type 2 10 10 10 rev",
caps.GL_ARB_vertex_type_2_10_10_10_rev);
capInfos.put("ARB viewport array", caps.GL_ARB_viewport_array);
capInfos.put("ARB window pos", caps.GL_ARB_window_pos);
capInfos.put("ATI draw buffers", caps.GL_ATI_draw_buffers);
capInfos.put("ATI element array", caps.GL_ATI_element_array);
capInfos.put("ATI envmap bumpmap", caps.GL_ATI_envmap_bumpmap);
capInfos.put("ATI fragment shader", caps.GL_ATI_fragment_shader);
capInfos.put("ATI map object buffer", caps.GL_ATI_map_object_buffer);
capInfos.put("ATI meminfo", caps.GL_ATI_meminfo);
capInfos.put("ATI pn triangles", caps.GL_ATI_pn_triangles);
capInfos.put("ATI separate stencil", caps.GL_ATI_separate_stencil);
capInfos.put("ATI shader texture lod", caps.GL_ATI_shader_texture_lod);
capInfos.put("ATI text fragment shader",
caps.GL_ATI_text_fragment_shader);
capInfos.put("ATI texture compression 3dc",
caps.GL_ATI_texture_compression_3dc);
capInfos.put("ATI texture env combine3",
caps.GL_ATI_texture_env_combine3);
capInfos.put("ATI texture float", caps.GL_ATI_texture_float);
capInfos
.put("ATI texture mirror once", caps.GL_ATI_texture_mirror_once);
capInfos
.put("ATI vertex array object", caps.GL_ATI_vertex_array_object);
capInfos.put("ATI vertex attrib array object",
caps.GL_ATI_vertex_attrib_array_object);
capInfos.put("ATI vertex streams", caps.GL_ATI_vertex_streams);
capInfos.put("EXT abgr", caps.GL_EXT_abgr);
capInfos.put("EXT bgra", caps.GL_EXT_bgra);
capInfos.put("EXT bindable uniform", caps.GL_EXT_bindable_uniform);
capInfos.put("EXT blend color", caps.GL_EXT_blend_color);
capInfos.put("EXT blend equation separate",
caps.GL_EXT_blend_equation_separate);
capInfos
.put("EXT blend func separate", caps.GL_EXT_blend_func_separate);
capInfos.put("EXT blend minmax", caps.GL_EXT_blend_minmax);
capInfos.put("EXT blend subtract", caps.GL_EXT_blend_subtract);
capInfos.put("EXT Cg shader", caps.GL_EXT_Cg_shader);
capInfos.put("EXT compiled vertex array",
caps.GL_EXT_compiled_vertex_array);
capInfos.put("EXT depth bounds test", caps.GL_EXT_depth_bounds_test);
capInfos
.put("EXT direct state access", caps.GL_EXT_direct_state_access);
capInfos.put("EXT draw buffers2", caps.GL_EXT_draw_buffers2);
capInfos.put("EXT draw instanced", caps.GL_EXT_draw_instanced);
capInfos
.put("EXT draw range elements", caps.GL_EXT_draw_range_elements);
capInfos.put("EXT fog coord", caps.GL_EXT_fog_coord);
capInfos.put("EXT framebuffer blit", caps.GL_EXT_framebuffer_blit);
capInfos.put("EXT framebuffer multisample",
caps.GL_EXT_framebuffer_multisample);
capInfos.put("EXT framebuffer object", caps.GL_EXT_framebuffer_object);
capInfos.put("EXT framebuffer sRGB", caps.GL_EXT_framebuffer_sRGB);
capInfos.put("EXT geometry shader4", caps.GL_EXT_geometry_shader4);
capInfos.put("EXT gpu program parameters",
caps.GL_EXT_gpu_program_parameters);
capInfos.put("EXT gpu shader4", caps.GL_EXT_gpu_shader4);
capInfos.put("EXT multi draw arrays", caps.GL_EXT_multi_draw_arrays);
capInfos.put("EXT packed depth stencil",
caps.GL_EXT_packed_depth_stencil);
capInfos.put("EXT packed float", caps.GL_EXT_packed_float);
capInfos.put("EXT packed pixels", caps.GL_EXT_packed_pixels);
capInfos.put("EXT paletted texture", caps.GL_EXT_paletted_texture);
capInfos
.put("EXT pixel buffer object", caps.GL_EXT_pixel_buffer_object);
capInfos.put("EXT point parameters", caps.GL_EXT_point_parameters);
capInfos.put("EXT provoking vertex", caps.GL_EXT_provoking_vertex);
capInfos.put("EXT rescale normal", caps.GL_EXT_rescale_normal);
capInfos.put("EXT secondary color", caps.GL_EXT_secondary_color);
capInfos.put("EXT separate shader objects",
caps.GL_EXT_separate_shader_objects);
capInfos.put("EXT separate specular color",
caps.GL_EXT_separate_specular_color);
capInfos.put("EXT shader image load store",
caps.GL_EXT_shader_image_load_store);
capInfos.put("EXT shadow funcs", caps.GL_EXT_shadow_funcs);
capInfos.put("EXT shared texture palette",
caps.GL_EXT_shared_texture_palette);
capInfos.put("EXT stencil clear tag", caps.GL_EXT_stencil_clear_tag);
capInfos.put("EXT stencil two side", caps.GL_EXT_stencil_two_side);
capInfos.put("EXT stencil wrap", caps.GL_EXT_stencil_wrap);
capInfos.put("EXT texture 3d", caps.GL_EXT_texture_3d);
capInfos.put("EXT texture array", caps.GL_EXT_texture_array);
capInfos.put("EXT texture buffer object",
caps.GL_EXT_texture_buffer_object);
capInfos.put("EXT texture compression latc",
caps.GL_EXT_texture_compression_latc);
capInfos.put("EXT texture compression rgtc",
caps.GL_EXT_texture_compression_rgtc);
capInfos.put("EXT texture compression s3tc",
caps.GL_EXT_texture_compression_s3tc);
capInfos
.put("EXT texture env combine", caps.GL_EXT_texture_env_combine);
capInfos.put("EXT texture env dot3", caps.GL_EXT_texture_env_dot3);
capInfos.put("EXT texture filter anisotropic",
caps.GL_EXT_texture_filter_anisotropic);
capInfos.put("EXT texture integer", caps.GL_EXT_texture_integer);
capInfos.put("EXT texture lod bias", caps.GL_EXT_texture_lod_bias);
capInfos.put("EXT texture mirror clamp",
caps.GL_EXT_texture_mirror_clamp);
capInfos.put("EXT texture rectangle", caps.GL_EXT_texture_rectangle);
capInfos.put("EXT texture sRGB", caps.GL_EXT_texture_sRGB);
capInfos.put("EXT texture shared exponent",
caps.GL_EXT_texture_shared_exponent);
capInfos.put("EXT texture snorm", caps.GL_EXT_texture_snorm);
capInfos.put("EXT texture swizzle", caps.GL_EXT_texture_swizzle);
capInfos.put("EXT timer query", caps.GL_EXT_timer_query);
capInfos.put("EXT transform feedback", caps.GL_EXT_transform_feedback);
capInfos.put("EXT vertex array bgra", caps.GL_EXT_vertex_array_bgra);
capInfos
.put("EXT vertex attrib 64bit", caps.GL_EXT_vertex_attrib_64bit);
capInfos.put("EXT vertex shader", caps.GL_EXT_vertex_shader);
capInfos.put("EXT vertex weighting", caps.GL_EXT_vertex_weighting);
capInfos.put("GREMEDY string marker", caps.GL_GREMEDY_string_marker);
capInfos.put("HP occlusion test", caps.GL_HP_occlusion_test);
capInfos.put("IBM rasterpos clip", caps.GL_IBM_rasterpos_clip);
capInfos.put("NVX gpu memory info", caps.GL_NVX_gpu_memory_info);
capInfos.put("NV blend square", caps.GL_NV_blend_square);
capInfos.put("NV conditional render", caps.GL_NV_conditional_render);
capInfos.put("NV copy depth to color", caps.GL_NV_copy_depth_to_color);
capInfos.put("NV copy image", caps.GL_NV_copy_image);
capInfos.put("NV depth buffer float", caps.GL_NV_depth_buffer_float);
capInfos.put("NV depth clamp", caps.GL_NV_depth_clamp);
capInfos.put("NV evaluators", caps.GL_NV_evaluators);
capInfos
.put("NV explicit multisample", caps.GL_NV_explicit_multisample);
capInfos.put("NV fence", caps.GL_NV_fence);
capInfos.put("NV float buffer", caps.GL_NV_float_buffer);
capInfos.put("NV fog distance", caps.GL_NV_fog_distance);
capInfos.put("NV fragment program", caps.GL_NV_fragment_program);
capInfos.put("NV fragment program2", caps.GL_NV_fragment_program2);
capInfos.put("NV fragment program4", caps.GL_NV_fragment_program4);
capInfos.put("NV fragment program option",
caps.GL_NV_fragment_program_option);
capInfos.put("NV framebuffer multisample coverage",
caps.GL_NV_framebuffer_multisample_coverage);
capInfos.put("NV geometry program4", caps.GL_NV_geometry_program4);
capInfos.put("NV geometry shader4", caps.GL_NV_geometry_shader4);
capInfos.put("NV gpu program4", caps.GL_NV_gpu_program4);
capInfos.put("NV gpu program5", caps.GL_NV_gpu_program5);
capInfos.put("NV gpu shader5", caps.GL_NV_gpu_shader5);
capInfos.put("NV half float", caps.GL_NV_half_float);
capInfos.put("NV light max exponent", caps.GL_NV_light_max_exponent);
capInfos
.put("NV multisample coverage", caps.GL_NV_multisample_coverage);
capInfos.put("NV multisample filter hint",
caps.GL_NV_multisample_filter_hint);
capInfos.put("NV occlusion query", caps.GL_NV_occlusion_query);
capInfos
.put("NV packed depth stencil", caps.GL_NV_packed_depth_stencil);
capInfos.put("NV parameter buffer object",
caps.GL_NV_parameter_buffer_object);
capInfos.put("NV parameter buffer object2",
caps.GL_NV_parameter_buffer_object2);
capInfos.put("NV pixel data range", caps.GL_NV_pixel_data_range);
capInfos.put("NV point sprite", caps.GL_NV_point_sprite);
capInfos.put("NV primitive restart", caps.GL_NV_primitive_restart);
capInfos.put("NV register combiners", caps.GL_NV_register_combiners);
capInfos.put("NV register combiners2", caps.GL_NV_register_combiners2);
capInfos.put("NV shader buffer load", caps.GL_NV_shader_buffer_load);
capInfos.put("NV shader buffer store", caps.GL_NV_shader_buffer_store);
capInfos.put("NV tessellation program5",
caps.GL_NV_tessellation_program5);
capInfos.put("NV texgen reflection", caps.GL_NV_texgen_reflection);
capInfos.put("NV texture barrier", caps.GL_NV_texture_barrier);
capInfos.put("NV texture compression vtc",
caps.GL_NV_texture_compression_vtc);
capInfos
.put("NV texture env combine4", caps.GL_NV_texture_env_combine4);
capInfos.put("NV texture expand normal",
caps.GL_NV_texture_expand_normal);
capInfos.put("NV texture rectangle", caps.GL_NV_texture_rectangle);
capInfos.put("NV texture shader", caps.GL_NV_texture_shader);
capInfos.put("NV texture shader2", caps.GL_NV_texture_shader2);
capInfos.put("NV texture shader3", caps.GL_NV_texture_shader3);
capInfos.put("NV transform feedback", caps.GL_NV_transform_feedback);
capInfos.put("NV transform feedback2", caps.GL_NV_transform_feedback2);
capInfos.put("NV vertex array range", caps.GL_NV_vertex_array_range);
capInfos.put("NV vertex array range2", caps.GL_NV_vertex_array_range2);
capInfos.put("NV vertex attrib integer 64bit",
caps.GL_NV_vertex_attrib_integer_64bit);
capInfos.put("NV vertex buffer unified memory",
caps.GL_NV_vertex_buffer_unified_memory);
capInfos.put("NV vertex program", caps.GL_NV_vertex_program);
capInfos.put("NV vertex program1 1", caps.GL_NV_vertex_program1_1);
capInfos.put("NV vertex program2", caps.GL_NV_vertex_program2);
capInfos.put("NV vertex program2 option",
caps.GL_NV_vertex_program2_option);
capInfos.put("NV vertex program3", caps.GL_NV_vertex_program3);
capInfos.put("NV vertex program4", caps.GL_NV_vertex_program4);
capInfos.put("SGIS generate mipmap", caps.GL_SGIS_generate_mipmap);
capInfos.put("SGIS texture lod", caps.GL_SGIS_texture_lod);
capInfos.put("SUN slice accum", caps.GL_SUN_slice_accum);
}
/**
* @param io_strb
* @param title
* @param available
*/
static void availableNL(StringBuffer io_strb, String title, boolean flag) {
infoNL(io_strb, title, flag ? "supported" : "not available");
}
static void warnNL(StringBuffer io_strb, String msg) {
io_strb.append(msg).append(NL);
}
static void infoNL(StringBuffer io_strb, String title, String... msg) {
io_strb.append(title).append(":");
for (int i = 0; i < TAB - title.length(); i++) {
io_strb.append(' ');
}
for (String s : msg) {
io_strb.append(' ');
if (s != null)
io_strb.append(s);
else
io_strb.append("n.a.");
}
io_strb.append(NL);
}
public static void main(String[] args) {
String s = gatherInformation();
System.out.println(s);
}
/**
* {@inheritDoc}
* @see org.eclipse.ui.part.WorkbenchPart#setFocus()
*/
@Override
public void setFocus() {
// TODO implement method LWJGLInfoView.setFocus
}
}

View File

@ -0,0 +1,203 @@
/*******************************************************************************
* Copyright (c) 2011 LWJGL Project and others
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html, and under the terms of the
* BSD license, see http://lwjgl.org/license.php for details.
*
* Contributors:
* Jens von Pilgrim - initial implementation
******************************************************************************/
package org.lwjgl.info;
import org.eclipse.core.runtime.IBundleGroup;
import org.eclipse.core.runtime.IBundleGroupProvider;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.action.IStatusLineManager;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.opengl.GLCanvas;
import org.eclipse.swt.opengl.GLData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Event;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.ui.part.ViewPart;
import org.lwjgl.LWJGLException;
import org.lwjgl.opengl.GL11;
import org.lwjgl.opengl.GLContext;
import org.lwjgl.util.glu.GLU;
/**
* Simple view for testing whether LWJGL is installed correctly on your
* system.
* The example is based on
* <a href="http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet195.java?view=markup&content-type=text%2Fvnd.viewcvs-markup&revision=HEAD">snippet 195</a>.
*
* @author Jens von Pilgrim
* @version $Revision$
* @since 16.07.2007
* @headurl $HeadURL$
*/
public class LWJGLTestView extends ViewPart {
GLCanvas canvas;
FpsStatusLineItem fpsstatuslineitem;
static String getFeatureVersion(String myFeatureId) {
IBundleGroupProvider[] providers = Platform.getBundleGroupProviders();
if (providers != null) {
for (int i = 0; i < providers.length; ++i) {
IBundleGroup[] bundleGroups = providers[i].getBundleGroups();
for (IBundleGroup bg : bundleGroups) {
if (bg.getIdentifier().equals(myFeatureId)) {
return bg.getVersion();
}
}
}
}
return "Feature not found";
}
/**
* {@inheritDoc}
* @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
*/
@Override
public void createPartControl(Composite parent) {
String strVersion = getFeatureVersion("org.lwjgl");
this.setPartName("org.lwjgl " + strVersion);
IStatusLineManager statusLine = this.getViewSite().getActionBars()
.getStatusLineManager();
fpsstatuslineitem = new FpsStatusLineItem();
statusLine.add(fpsstatuslineitem);
GLData data = new GLData();
data.doubleBuffer = true;
canvas = new GLCanvas(parent, SWT.NONE, data);
canvas.setCurrent();
try {
GLContext.useContext(canvas);
} catch (LWJGLException e) {
e.printStackTrace();
}
canvas.addListener(SWT.Resize, new Listener() {
public void handleEvent(Event event) {
Rectangle bounds = canvas.getBounds();
float fAspect = (float) bounds.width / (float) bounds.height;
canvas.setCurrent();
try {
GLContext.useContext(canvas);
} catch (LWJGLException e) {
e.printStackTrace();
}
GL11.glViewport(0, 0, bounds.width, bounds.height);
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glLoadIdentity();
GLU.gluPerspective(45.0f, fAspect, 0.5f, 400.0f);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glLoadIdentity();
}
});
GL11.glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
GL11.glColor3f(1.0f, 0.0f, 0.0f);
GL11.glHint(GL11.GL_PERSPECTIVE_CORRECTION_HINT, GL11.GL_NICEST);
GL11.glClearDepth(1.0);
GL11.glLineWidth(2);
GL11.glEnable(GL11.GL_DEPTH_TEST);
Display.getCurrent().asyncExec(initRunnable());
}
/**
* {@inheritDoc}
* @see org.eclipse.ui.part.WorkbenchPart#setFocus()
*/
@Override
public void setFocus() {
canvas.setFocus();
}
static void drawTorus(float r, float R, int nsides, int rings) {
float ringDelta = 2.0f * (float) Math.PI / rings;
float sideDelta = 2.0f * (float) Math.PI / nsides;
float theta = 0.0f, cosTheta = 1.0f, sinTheta = 0.0f;
for (int i = rings - 1; i >= 0; i--) {
float theta1 = theta + ringDelta;
float cosTheta1 = (float) Math.cos(theta1);
float sinTheta1 = (float) Math.sin(theta1);
GL11.glBegin(GL11.GL_QUAD_STRIP);
float phi = 0.0f;
for (int j = nsides; j >= 0; j--) {
phi += sideDelta;
float cosPhi = (float) Math.cos(phi);
float sinPhi = (float) Math.sin(phi);
float dist = R + r * cosPhi;
GL11
.glNormal3f(cosTheta1 * cosPhi, -sinTheta1 * cosPhi,
sinPhi);
GL11
.glVertex3f(cosTheta1 * dist, -sinTheta1 * dist, r
* sinPhi);
GL11.glNormal3f(cosTheta * cosPhi, -sinTheta * cosPhi, sinPhi);
GL11.glVertex3f(cosTheta * dist, -sinTheta * dist, r * sinPhi);
}
GL11.glEnd();
theta = theta1;
cosTheta = cosTheta1;
sinTheta = sinTheta1;
}
}
Runnable initRunnable() {
return new Runnable() {
int rot = 0;
public void run() {
if (!canvas.isDisposed() && canvas.isVisible()) {
fpsstatuslineitem.renderPassStarted();
canvas.setCurrent();
try {
GLContext.useContext(canvas);
} catch (LWJGLException e) {
e.printStackTrace();
}
GL11.glClear(GL11.GL_COLOR_BUFFER_BIT
| GL11.GL_DEPTH_BUFFER_BIT);
GL11.glClearColor(.2f, .7f, .2f, 1.0f);
GL11.glLoadIdentity();
GL11.glTranslatef(0.0f, 0.0f, -10.0f);
float frot = rot;
GL11
.glRotatef(0.15f * rot, 2.0f * frot, 10.0f * frot,
1.0f);
GL11.glRotatef(0.3f * rot, 3.0f * frot, 1.0f * frot, 1.0f);
rot++;
GL11.glPolygonMode(GL11.GL_FRONT_AND_BACK, GL11.GL_LINE);
GL11.glColor3f(0.9f, 0.9f, 0.9f);
drawTorus(1, 1.9f + ((float) Math.sin((0.004f * frot))),
15, 15);
canvas.swapBuffers();
fpsstatuslineitem.renderPassFinished();
Display.getCurrent().asyncExec(this);
}
}
};
}
}

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.lwjgl.source</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
</buildSpec>
<natures>
</natures>
</projectDescription>

View File

@ -0,0 +1,7 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: LWJGL Sources
Bundle-Vendor: Lightweight Java Game Library Project
Bundle-Version: 2
Bundle-SymbolicName: org.lwjgl.source;singleton:=true
Bundle-Localization: plugin

View File

@ -0,0 +1,55 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html>
<head>
<title>About</title>
<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
</head>
<body lang="EN-US">
<img src="lwjgl_logo.png" align="right"/>
<h2>About This Content</h2>
<p>The <a href="http://lwjgl.org">Lightweight Java Game Library (LWJGL)</a> is a solution aimed
directly at professional and amateur Java programmers alike to enable <a
href="projects.php">commercial quality games</a> to be written in Java.
LWJGL provides developers access to high performance crossplatform
libraries such as OpenGL (<a href="http://www.opengl.org/"
target="_blank">Open Graphics Library</a>) and OpenAL (<a
href="http://www.openal.org" target="_blank">Open Audio Library</a>)
allowing for state of the art 3D games and 3D sound. Additionally LWJGL
provides access to controllers such as Gamepads, Steering wheel and
Joysticks. All in a simple and straight forward API.</p>
<p>LWJGL is not meant to make writing games particularly easy; it is
primarily an enabling technology which allows developers to get at
resources that are simply otherwise unavailable or poorly implemented on
the existing <a href="http://java.sun.com" target="_blank">Java
platform</a>. We anticipate that the LWJGL will, through evolution and
extension, become the foundation for more complete game libraries and
"game engines" as they have popularly become known, and hide some of the
new evils we have had to expose in the APIs.</p>
<p>LWJGL is available under a <a href="http://lwjgl.org/license.php">BSD
license</a>, which means it's open source and freely available at no charge.</p>
<p>Please visit us on the Freenode IRC Network: <a
href="irc://irc.freenode.net/lwjgl" target="_blank">#LWJGL</a>. Do idle
if there is no one to answer any of your questions, we are on different
timezones.</p>
<h2>Plug-Ins</h2>
<p>The following plug-ins are provided:
<dl>
<dt>org.lwjgl</dt>
<dd>Platform independent jars and native libraries for Windows, Linux and Mac OS X</dd>
<dt>org.lwjgl.doc</dt>
<dd>Documentation (JavaDoc)</dd>
<dt>org.lwjgl.source</dt>
<dd>Source files</dd>
<dt>org.lwjgl.tools</dt>
<dd>Developer tools</dd>
<dt>org.lwjgl.info</dt>
<dd>LWJGL test and info view</dd>
</dl>
</p>
</body>
</html>

View File

@ -0,0 +1,10 @@
bin.includes = META-INF/,\
about.html,\
lwjgl_logo.png,\
plugin.xml,\
src/
src.includes = src/,\
lwjgl_logo.png,\
about.html,\
plugin.xml,\
META-INF/

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.2"?>
<plugin>
<extension
point="org.eclipse.pde.core.source">
<location path="src" />
</extension>
</plugin>

View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src/java"/>
<classpathentry kind="output" path="build/classes"/>
</classpath>

View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.lwjgl.tools</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View File

@ -0,0 +1,12 @@
#Tue Nov 23 14:40:51 CET 2010
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.5

View File

@ -0,0 +1,16 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: LWJGL Tools Plug-in
Bundle-SymbolicName: org.lwjgl.tools;singleton:=true
Bundle-Version: 1.0.0
Bundle-Activator: org.lwjgl.tools.Activator
Bundle-Vendor: Lightweight Java Game Library Project
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
org.eclipse.core.resources;bundle-version="3.4.0",
org.eclipse.jdt.core;bundle-version="3.4.0",
org.eclipse.jdt.ui;bundle-version="3.4.0",
org.eclipse.jdt.launching;bundle-version="3.4.0",
org.lwjgl;bundle-version="2.0.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5

View File

@ -0,0 +1,33 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
<title>About</title>
</head>
<body lang="EN-US">
<h2>About This Content</h2>
<p>November, 2010</p>
<h3>License</h3>
<p>The LWJGL team makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
indicated below, the Content is provided to you under the terms and conditions of the
Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
<p>If you did not receive this Content directly from lwjgl.org, the Content is
being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
apply to your use of any object code in the Content. Check the Redistributor's license that was
provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
indicated below, the terms and conditions of the EPL still apply to any source code in the Content
and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p>
<h4>Third party code</h4>
<p>This plug-in contains code from the plugin org.eclipse.jdt.junit, this code
is provided by the Eclipse Foundation under the terms
of the Eclipse Public License Version 1.0.</p>
</body>
</html>

View File

@ -0,0 +1,6 @@
source.. = src/java/
output.. = build/classes/
bin.includes = META-INF/,\
.,\
plugin.xml,\
about.html

View File

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.2"?>
<plugin>
<extension
point="org.eclipse.jdt.core.classpathContainerInitializer">
<classpathContainerInitializer
class="org.lwjgl.tools.LWJGLClasspathContainerInitializer"
id="org.lwjgl.LWJGL_CONTAINER">
</classpathContainerInitializer>
</extension>
<extension
point="org.eclipse.jdt.ui.classpathContainerPage">
<classpathContainerPage
class="org.lwjgl.tools.LWJGLClasspathContainerPage"
id="org.lwjgl.LWJGL_CONTAINER"
name="LWJGL Library">
</classpathContainerPage>
</extension>
</plugin>

View File

@ -0,0 +1,64 @@
/*******************************************************************************
* Copyright (c) 2011 LWJGL Project and others
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html, and under the terms of the
* BSD license, see http://lwjgl.org/license.php for details.
*
* Contributors:
* Jens von Pilgrim - initial implementation
******************************************************************************/
package org.lwjgl.tools;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
/**
* The activator class controls the plug-in life cycle
*
* @author Jens von Pilgrim (developer@jevopi.de)
* @since Mar 30, 2011
*/
public class Activator extends AbstractUIPlugin {
// The plug-in ID
public static final String PLUGIN_ID = "org.lwjgl.tools";
// The shared instance
private static Activator plugin;
/**
* The constructor
*/
public Activator() {
}
/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
*/
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
}
/*
* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
*/
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
}
/**
* Returns the shared instance
*
* @return the shared instance
*/
public static Activator getDefault() {
return plugin;
}
}

View File

@ -0,0 +1,269 @@
/*******************************************************************************
* Copyright (c) 2011 LWJGL Project and others
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html, and under the terms of the
* BSD license, see http://lwjgl.org/license.php for details.
*
* Contributors:
* Jens von Pilgrim - initial implementation
******************************************************************************/
package org.lwjgl.tools;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import java.util.logging.Logger;
import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jdt.core.IAccessRule;
import org.eclipse.jdt.core.IClasspathAttribute;
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.launching.JavaRuntime;
import org.lwjgl.LibraryPathUtil;
import org.lwjgl.OSNotSupportedException;
import org.osgi.framework.Bundle;
import org.osgi.framework.Constants;
/**
* This class resolves the actual LWJGL library path, that is the location
* of the jars in the org.lwjgl plugin.
*
* Following the "monkey sees, monkey does"-rule, this code was copied and
* modified from the plugin org.eclipse.jdt.junit . This code is published
* under the EPL and (c) by IBM and others.
*
* @see org.eclipse.jdt.internal.ui.wizards.buildpaths.BuildPathSupport
* @see org.eclipse.jdt.internal.junit.buildpath.BuildPathSupport
*/
public class BuildPathSupport {
/**
* Logger for this class
*/
private static final Logger log = Logger.getLogger(BuildPathSupport.class.getName());
public static class LWJGLPluginDescription {
private final String strBundleId;
private Bundle bundle = null;
public LWJGLPluginDescription(String bundleId) {
strBundleId = bundleId;
}
public Bundle getBundle() {
if (bundle == null)
bundle = Platform.getBundle(strBundleId);
return bundle;
}
public String getBundleId() {
return strBundleId;
}
}
public static final LWJGLPluginDescription LWJGL_PLUGIN = new LWJGLPluginDescription(
"org.lwjgl"); //$NON-NLS-1$
public static final LWJGLPluginDescription LWJGL_SRC_PLUGIN = new LWJGLPluginDescription(
"org.lwjgl.source"); //$NON-NLS-1$
public static final LWJGLPluginDescription LWJGL_DOC_PLUGIN = new LWJGLPluginDescription(
"org.lwjgl.doc"); //$NON-NLS-1$
public static final String[] JAR_FILES = { "lwjgl.jar", "lwjgl_util.jar",
"lwjgl_util_applet.jar", "jinput.jar" };
public static final String[] SRC_FILES = { "lwjglsrc.zip",
"lwjgl_utilsrc.zip", "lwjgl_util_applet.zip", null };
public static final String[] DOC_FILES = { "doc.zip", "doc.zip", "doc.zip",
"doc.zip" };
public static String[] NATIVEPATH = new String[] { "windows", "macosx",
"linux", "solaris" };
public static IPath getBundleLocation(LWJGLPluginDescription pluginDesc) {
Bundle bundle = pluginDesc.getBundle();
if (bundle == null)
return null;
URL local = null;
try {
local = FileLocator.toFileURL(bundle.getEntry("/")); //$NON-NLS-1$
} catch (IOException e) {
return null;
}
String fullPath = new File(local.getPath()).getAbsolutePath();
return Path.fromOSString(fullPath);
}
/**
*
* /Devel/Applications/Eclipse3.4/plugins/org.lwjgl.source_2.0.1/src/org.lwjgl_2.0.1/lwjglsrc.zip
* /Devel/Applications/Eclipse3.4/plugins/org.lwjgl.source_2.0.1/src/org.lwjgl_2.0.1/lwjgl_utilsrc.zip
* /Devel/Applications/Eclipse3.4/plugins/org.lwjgl.source_2.0.1/src/org.lwjgl_2.0.1/lwjgl_util_applet.zip
*
*
* @param pluginDesc
* @return
*/
public static IPath getSourceLocation(String filename) {
if (filename==null)
return null;
Bundle bundleSrc = LWJGL_SRC_PLUGIN.getBundle();
if (bundleSrc == null)
return null;
String version = (String) bundleSrc.getHeaders().get(
Constants.BUNDLE_VERSION);
if (version == null) {
return null;
}
String bundlePath = getURL(bundleSrc);
if (bundlePath == null) {
return null;
}
File bundleLoc = new File(bundlePath);
if (bundleLoc.isDirectory()) {
String fullPath = bundleLoc.getAbsolutePath() + File.separator
+ "src" + File.separator + LWJGL_PLUGIN.getBundleId() + '_'
+ version + File.separator + filename;
return Path.fromOSString(fullPath);
} else if (bundleLoc.isFile()) {
return Path.fromOSString(bundleLoc.getAbsolutePath());
}
return null;
}
/**
* jar:file:/Devel/Applications/Eclipse3.4/plugins/org.lwjgl.doc_2.0.1/doc.zip!/javadoc
*
* @param pluginDesc
* @param filename
* @return
*/
public static String getJavadocLocation(String filename) {
if (filename==null)
return null;
Bundle bundleDoc = LWJGL_DOC_PLUGIN.getBundle();
if (bundleDoc == null)
return null;
String version = (String) bundleDoc.getHeaders().get(
Constants.BUNDLE_VERSION);
if (version == null) {
return null;
}
String bundlePath = getURL(bundleDoc);
if (bundlePath == null) {
return null;
}
File bundleLoc = new File(bundlePath);
if (bundleLoc.isDirectory()) {
String fullPath = "jar:file:" + bundleLoc.getAbsolutePath()
+ File.separator + filename + "!"
+ File.separator + "javadoc" + File.separator;
return fullPath;
} else if (bundleLoc.isFile()) {
return bundleLoc.getAbsolutePath();
}
return null;
}
public static String getNativeLocation() {
String basePath;
try {
basePath = LibraryPathUtil.getRelativeLWJGLLibraryPath();
} catch (OSNotSupportedException ex) {
log.warning(ex.toString()); //$NON-NLS-1$
return null;
}
Bundle bundle = LWJGL_PLUGIN.getBundle();
if (bundle == null)
return null;
String bundlePath = getURL(bundle);
if (bundlePath == null) {
return null;
}
File bundleLoc = new File(bundlePath);
if (bundleLoc.isDirectory()) {
String fullPath = bundleLoc.getAbsolutePath()
+ File.separator + basePath;
return fullPath;
} else if (bundleLoc.isFile()) {
return null;
}
return null;
}
private static String getURL(Bundle bundle) {
try {
URL fileURL = FileLocator.toFileURL(bundle.getEntry("/")); //$NON-NLS-1$
if (fileURL != null) {
return fileURL.getFile();
}
return null;
} catch (IOException e) {
return null;
}
}
public static IClasspathEntry getLWJGLClasspathEntry() {
return JavaCore
.newContainerEntry(LWJGLClasspathContainerInitializer.LWJGL_LIBRARY_PATH);
}
public static IClasspathEntry[] getLWJGLLibraryEntries() {
IPath bundleBase = getBundleLocation(LWJGL_PLUGIN);
if (bundleBase != null) {
IClasspathEntry[] entries = new IClasspathEntry[JAR_FILES.length];
for (int i = 0; i < JAR_FILES.length; i++) {
IPath jarLocation = bundleBase.append(JAR_FILES[i]); //$NON-NLS-1$
IPath srcLocation = getSourceLocation(SRC_FILES[i]);
String nativeLocation = getNativeLocation();
String javadocLocation = getJavadocLocation(DOC_FILES[i]);
IAccessRule[] accessRules = {};
IClasspathAttribute[] attributes = { //
JavaCore
.newClasspathAttribute(
IClasspathAttribute.JAVADOC_LOCATION_ATTRIBUTE_NAME,
javadocLocation),
JavaCore.newClasspathAttribute(
JavaRuntime.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY,
nativeLocation) };
// return JavaCore.newClasspathAttribute(JavaRuntime.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY, dialog.getNativeLibraryPath());
entries[i] = JavaCore.newLibraryEntry(jarLocation, srcLocation,
null, accessRules, attributes, false);
}
return entries;
}
return null;
}
}

View File

@ -0,0 +1,233 @@
/*******************************************************************************
* Copyright (c) 2011 LWJGL Project and others
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html, and under the terms of the
* BSD license, see http://lwjgl.org/license.php for details.
*
* Contributors:
* Jens von Pilgrim - initial implementation
******************************************************************************/
package org.lwjgl.tools;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.jdt.core.ClasspathContainerInitializer;
import org.eclipse.jdt.core.IClasspathAttribute;
import org.eclipse.jdt.core.IClasspathContainer;
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.IJavaModel;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.launching.JavaRuntime;
/**
* LWJGLClasspathContainerInitializer sets up LWJGL library path.
*
* Parts of this code were copied and modified from
* {@link org.eclipse.jdt.internal.junit.buildpath.JUnitContainerInitializer},
* which is licensed under the EPL as well.
*
* @author Jens von Pilgrim
* @version $Revision$
* @since Dec 5, 2008
*/
public class LWJGLClasspathContainerInitializer extends
ClasspathContainerInitializer {
public static String LWJGL_LIBRARY_ID = "org.lwjgl.LWJGL_CONTAINER";
public static IPath LWJGL_LIBRARY_PATH = new Path(LWJGL_LIBRARY_ID);
private static final IStatus NOT_SUPPORTED = new Status(IStatus.ERROR,
Activator.PLUGIN_ID,
ClasspathContainerInitializer.ATTRIBUTE_NOT_SUPPORTED,
new String(), null);
private static class LWJGLClasspathContainer implements IClasspathContainer {
private final IClasspathEntry[] fEntries;
private final IPath fPath;
public LWJGLClasspathContainer(IPath path, IClasspathEntry[] entries) {
fPath = path;
fEntries = entries;
}
public IClasspathEntry[] getClasspathEntries() {
return fEntries;
}
public String getDescription() {
return "LWJGL Libraries";
}
public int getKind() {
return IClasspathContainer.K_APPLICATION;
}
public IPath getPath() {
return fPath;
}
}
public LWJGLClasspathContainerInitializer() {
}
/**
* {@inheritDoc}
* @see org.eclipse.jdt.core.ClasspathContainerInitializer#initialize(org.eclipse.core.runtime.IPath, org.eclipse.jdt.core.IJavaProject)
*/
public void initialize(IPath containerPath, IJavaProject project)
throws CoreException {
if (isValidLWJGLContainerPath(containerPath)) {
LWJGLClasspathContainer container = getNewContainer(containerPath);
JavaCore.setClasspathContainer(containerPath,
new IJavaProject[] { project },
new IClasspathContainer[] { container }, null);
}
}
private static boolean isValidLWJGLContainerPath(IPath path) {
return path != null && path.segmentCount() > 0
&& LWJGL_LIBRARY_ID.equals(path.segment(0));
}
private static LWJGLClasspathContainer getNewContainer(IPath containerPath) {
IClasspathEntry[] entries = null;
// String version = containerPath.segment(1);
entries = BuildPathSupport.getLWJGLLibraryEntries();
if (entries == null)
entries = new IClasspathEntry[] {};
return new LWJGLClasspathContainer(containerPath, entries);
}
/**
* {@inheritDoc}
* @see org.eclipse.jdt.core.ClasspathContainerInitializer#canUpdateClasspathContainer(org.eclipse.core.runtime.IPath, org.eclipse.jdt.core.IJavaProject)
*/
public boolean canUpdateClasspathContainer(IPath containerPath,
IJavaProject project) {
return true;
}
/**
* {@inheritDoc}
* @see org.eclipse.jdt.core.ClasspathContainerInitializer#getAccessRulesStatus(org.eclipse.core.runtime.IPath, org.eclipse.jdt.core.IJavaProject)
*/
public IStatus getAccessRulesStatus(IPath containerPath,
IJavaProject project) {
return NOT_SUPPORTED;
}
/**
* {@inheritDoc}
* @see org.eclipse.jdt.core.ClasspathContainerInitializer#getSourceAttachmentStatus(org.eclipse.core.runtime.IPath, org.eclipse.jdt.core.IJavaProject)
*/
public IStatus getSourceAttachmentStatus(IPath containerPath,
IJavaProject project) {
return Status.OK_STATUS;
}
/**
* {@inheritDoc}
* @see org.eclipse.jdt.core.ClasspathContainerInitializer#getAttributeStatus(org.eclipse.core.runtime.IPath, org.eclipse.jdt.core.IJavaProject, java.lang.String)
*/
public IStatus getAttributeStatus(IPath containerPath,
IJavaProject project, String attributeKey) {
if (attributeKey
.equals(IClasspathAttribute.JAVADOC_LOCATION_ATTRIBUTE_NAME)) {
return Status.OK_STATUS;
}
if (attributeKey.equals(JavaRuntime.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY)) {
return Status.OK_STATUS;
}
return NOT_SUPPORTED;
}
/**
* {@inheritDoc}
* @see org.eclipse.jdt.core.ClasspathContainerInitializer#requestClasspathContainerUpdate(org.eclipse.core.runtime.IPath, org.eclipse.jdt.core.IJavaProject, org.eclipse.jdt.core.IClasspathContainer)
*/
public void requestClasspathContainerUpdate(IPath containerPath,
IJavaProject project, IClasspathContainer containerSuggestion)
throws CoreException {
IClasspathEntry[] entries = containerSuggestion.getClasspathEntries();
if (entries.length == 1 && isValidLWJGLContainerPath(containerPath)) {
// String version = containerPath.segment(1);
// only modifiable entry in Javadoc location
IClasspathAttribute[] extraAttributes = entries[0]
.getExtraAttributes();
for (int i = 0; i < extraAttributes.length; i++) {
IClasspathAttribute attrib = extraAttributes[i];
if (attrib.getName().equals(
IClasspathAttribute.JAVADOC_LOCATION_ATTRIBUTE_NAME)) {
break;
}
}
rebindClasspathEntries(project.getJavaModel(), containerPath);
}
}
private static void rebindClasspathEntries(IJavaModel model,
IPath containerPath) throws JavaModelException {
List<IJavaProject> affectedProjects = new ArrayList<IJavaProject>();
IJavaProject[] projects = model.getJavaProjects();
for (int i = 0; i < projects.length; i++) {
IJavaProject project = projects[i];
IClasspathEntry[] entries = project.getRawClasspath();
for (int k = 0; k < entries.length; k++) {
IClasspathEntry curr = entries[k];
if (curr.getEntryKind() == IClasspathEntry.CPE_CONTAINER
&& containerPath.equals(curr.getPath())) {
affectedProjects.add(project);
}
}
}
if (!affectedProjects.isEmpty()) {
IJavaProject[] affected = (IJavaProject[]) affectedProjects
.toArray(new IJavaProject[affectedProjects.size()]);
IClasspathContainer[] containers = new IClasspathContainer[affected.length];
for (int i = 0; i < containers.length; i++) {
containers[i] = getNewContainer(containerPath);
}
JavaCore.setClasspathContainer(containerPath, affected, containers,
null);
}
}
/**
* {@inheritDoc}
* @see org.eclipse.jdt.core.ClasspathContainerInitializer#getDescription(org.eclipse.core.runtime.IPath, org.eclipse.jdt.core.IJavaProject)
*/
public String getDescription(IPath containerPath, IJavaProject project) {
return "LWJGL library settings, including required java libraries "
+ "(jars) and native libraries.";
}
/**
* {@inheritDoc}
* @see org.eclipse.jdt.core.ClasspathContainerInitializer#getComparisonID(org.eclipse.core.runtime.IPath, org.eclipse.jdt.core.IJavaProject)
*/
public Object getComparisonID(IPath containerPath, IJavaProject project) {
return containerPath;
}
}

View File

@ -0,0 +1,279 @@
/*******************************************************************************
* Copyright (c) 2011 LWJGL Project and others
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html, and under the terms of the
* BSD license, see http://lwjgl.org/license.php for details.
*
* Contributors:
* Jens von Pilgrim - initial implementation
******************************************************************************/
package org.lwjgl.tools;
import java.io.StringWriter;
import java.util.Set;
import java.util.TreeSet;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.jdt.core.IClasspathAttribute;
import org.eclipse.jdt.core.IClasspathContainer;
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.internal.ui.JavaPluginImages;
import org.eclipse.jdt.internal.ui.viewsupport.BasicElementLabels;
import org.eclipse.jdt.launching.JavaRuntime;
import org.eclipse.jdt.ui.JavaElementLabels;
import org.eclipse.jdt.ui.wizards.IClasspathContainerPage;
import org.eclipse.jdt.ui.wizards.IClasspathContainerPageExtension;
import org.eclipse.jdt.ui.wizards.NewElementWizardPage;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
/**
* LWJGLClasspathContainerPage
* There should really be more documentation here.
*
* @author Jens von Pilgrim
* @since Dec 5, 2008
*/
public class LWJGLClasspathContainerPage extends NewElementWizardPage implements
IClasspathContainerPage, IClasspathContainerPageExtension {
private IClasspathEntry containerEntryResult;
private Label labelResolvedPath;
private Label labelResolvedSourcePath;
private Label labelResolvedDocPath;
private Label labelNativePath;
public LWJGLClasspathContainerPage() {
super("LWJGLContainterPage"); //$NON-NLS-1$
setTitle("LWJGL Library");
setDescription("Adds LWJGL Java Libraries to build path");
setImageDescriptor(JavaPluginImages.DESC_WIZBAN_ADD_LIBRARY);
containerEntryResult = JavaCore
.newContainerEntry(LWJGLClasspathContainerInitializer.LWJGL_LIBRARY_PATH);
}
public static IJavaProject getPlaceholderProject() {
String name = "####internal"; //$NON-NLS-1$
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
while (true) {
IProject project = root.getProject(name);
if (!project.exists()) {
return JavaCore.create(project);
}
name += '1';
}
}
public boolean finish() {
try {
IJavaProject[] javaProjects = new IJavaProject[] { getPlaceholderProject() };
IClasspathContainer[] containers = { null };
JavaCore.setClasspathContainer(containerEntryResult.getPath(),
javaProjects, containers, null);
} catch (JavaModelException e) {
perform(e, getShell(), e.getMessage());
return false;
}
return true;
}
public IClasspathEntry getSelection() {
return containerEntryResult;
}
public void setSelection(IClasspathEntry containerEntry) {
containerEntryResult = containerEntry;
}
public void createControl(Composite parent) {
Composite composite = new Composite(parent, SWT.NONE);
composite.setFont(parent.getFont());
composite.setLayout(new GridLayout(2, false));
createLabel(composite, "Path");
labelResolvedPath = createPathLabel(composite);
createLabel(composite, "Source Path");
labelResolvedSourcePath = createPathLabel(composite);
createLabel(composite, "JavaDoc Path");
labelResolvedDocPath = createPathLabel(composite);
createLabel(composite, "Native Path");
labelNativePath = createPathLabel(composite);
update();
setControl(composite);
}
private void createLabel(Composite parent, String strLabel) {
Label label = new Label(parent, SWT.NONE);
label.setFont(parent.getFont());
label.setText(strLabel);
label.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, false, false, 1, 1));
}
private Label createPathLabel(Composite parent) {
Label label = new Label(parent, SWT.WRAP);
label.setFont(parent.getFont());
label.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, true,
true, 1, 1));
return label;
}
protected void update() {
IStatus status = null;
IClasspathEntry[] libEntries = BuildPathSupport
.getLWJGLLibraryEntries();
IPath containerPath = LWJGLClasspathContainerInitializer.LWJGL_LIBRARY_PATH;
containerEntryResult = JavaCore.newContainerEntry(containerPath);
if (libEntries == null) {
status = new Status(ERROR, Activator.PLUGIN_ID,
"No LWJGL library found");
} else
if (labelResolvedPath != null && !labelResolvedPath.isDisposed()) {
// implies all other labels to be created and not yet disposed
if (libEntries != null) {
Set<String> setLines = new TreeSet<String>();
IPath path;
for (IClasspathEntry entry : libEntries) {
path = entry.getPath();
if (path != null) {
setLines.add(getPathLabel(path));
}
}
setLabel(labelResolvedPath, setLines);
setLines.clear();
for (IClasspathEntry entry : libEntries) {
path = entry.getSourceAttachmentPath();
if (path != null) {
setLines.add(getPathLabel(path));
}
}
setLabel(labelResolvedSourcePath, setLines);
setLines.clear();
for (IClasspathEntry entry : libEntries) {
if (entry.getExtraAttributes() != null) {
for (IClasspathAttribute attr : entry
.getExtraAttributes()) {
if (IClasspathAttribute.JAVADOC_LOCATION_ATTRIBUTE_NAME
.equals(attr.getName())) {
setLines.add(attr.getValue());
break;
}
if (JavaRuntime.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY.equals(attr.getName())) {
}
}
}
}
setLabel(labelResolvedDocPath, setLines);
setLines.clear();
for (IClasspathEntry entry : libEntries) {
if (entry.getExtraAttributes() != null) {
for (IClasspathAttribute attr : entry
.getExtraAttributes()) {
if (JavaRuntime.CLASSPATH_ATTR_LIBRARY_PATH_ENTRY.equals(attr.getName())) {
setLines.add(attr.getValue());
}
}
}
}
setLabel(labelNativePath, setLines);
} else {
labelResolvedPath.setText("not found");
labelResolvedSourcePath.setText("not found");
labelResolvedDocPath.setText("not found");
}
}
if (status != null)
updateStatus(status);
}
/**
* @param i_labelResolvedDocPath
* @param i_setDocPaths
*/
private void setLabel(Label label, Set<String> lines) {
StringBuffer strb = new StringBuffer();
for (String str : lines) {
if (strb.length() > 0) {
strb.append("\n");
}
strb.append(str);
}
label.setText(strb.toString());
}
private String getPathLabel(IPath path) {
StringBuffer buf = new StringBuffer(BasicElementLabels
.getResourceName(path.lastSegment()));
buf.append(JavaElementLabels.CONCAT_STRING);
buf.append(BasicElementLabels.getPathLabel(path.removeLastSegments(1),
true));
return buf.toString();
}
/* (non-Javadoc)
* @see org.eclipse.jdt.ui.wizards.IClasspathContainerPageExtension#initialize(org.eclipse.jdt.core.IJavaProject, org.eclipse.jdt.core.IClasspathEntry[])
*/
public void initialize(IJavaProject project,
IClasspathEntry[] currentEntries) {
}
protected void perform(CoreException e, Shell shell, String message) {
IStatus status = e.getStatus();
if (status != null) {
ErrorDialog.openError(shell, "LWJGL Library", message, status);
} else {
StringWriter msg = new StringWriter();
if (message != null) {
msg.write(message);
msg.write("\n\n"); //$NON-NLS-1$
}
if (message == null || message.length() == 0)
msg.write("Unknown error adding LWJGL library");
else
msg.write(message);
MessageDialog.openError(shell, "LWJGL Library", msg.toString());
}
}
}

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.lwjgl.updatesite</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.pde.UpdateSiteBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.UpdateSiteNature</nature>
</natures>
</projectDescription>

View File

@ -0,0 +1,60 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<html>
<head>
<title>About</title>
<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
</head>
<body lang="EN-US">
<img src="lwjgl_logo.png" align="right"/>
<h2>About This Content</h2>
<p>The <a href="http://lwjgl.org">Lightweight Java Game Library (LWJGL)</a> is a solution aimed
directly at professional and amateur Java programmers alike to enable <a
href="projects.php">commercial quality games</a> to be written in Java.
LWJGL provides developers access to high performance crossplatform
libraries such as OpenGL (<a href="http://www.opengl.org/"
target="_blank">Open Graphics Library</a>) and OpenAL (<a
href="http://www.openal.org" target="_blank">Open Audio Library</a>)
allowing for state of the art 3D games and 3D sound. Additionally LWJGL
provides access to controllers such as Gamepads, Steering wheel and
Joysticks. All in a simple and straight forward API.</p>
<p>LWJGL is not meant to make writing games particularly easy; it is
primarily an enabling technology which allows developers to get at
resources that are simply otherwise unavailable or poorly implemented on
the existing <a href="http://java.sun.com" target="_blank">Java
platform</a>. We anticipate that the LWJGL will, through evolution and
extension, become the foundation for more complete game libraries and
"game engines" as they have popularly become known, and hide some of the
new evils we have had to expose in the APIs.</p>
<p>LWJGL is available under a <a href="http://lwjgl.org/license.php">BSD
license</a>, which means it's open source and freely available at no charge.</p>
<p>Please visit us on the Freenode IRC Network: <a
href="irc://irc.freenode.net/lwjgl" target="_blank">#LWJGL</a>. Do idle
if there is no one to answer any of your questions, we are on different
timezones.</p>
<h3>Plugin assembly</h3>
<p>The plugins were assembled by Jens von Pilgrim (developer@jevopi.de). All files related to this assembly, such as manifest files or plugin descriptors, are copyright under the Eclipse Public License (EPL) and the BSD license</p>
<h3>Third party code</h3>
<h4>IBM</h4>
<p>The LWJGL Textview contains code copyright under the Eclipse Public License (EPL):<br/>
<pre>
Copyright (c) 2000, 2005 IBM Corporation and others.
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
<a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>
</pre>
The source of this code can be found at:
<a href="http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet195.java?view=markup&content-type=text%2Fvnd.viewcvs-markup&revision=HEAD">http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet195.java?view=markup&content-type=text%2Fvnd.viewcvs-markup&revision=HEAD</a>
</p>
<h4>SGI</h4>
<p>
LWJGL contains code copyright by SGI. This code is copyright under the SGI FreeB v1.1, see <a href="http://oss.sgi.com/projects/FreeB/">http://oss.sgi.com/projects/FreeB/</a>. Note that this license can be updated to version 2.0.
</p>
</body>
</html>

View File

@ -0,0 +1,60 @@
<html>
<head>
<title>org.lwjgl.updatesite</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<style>@import url("web/site.css");</style>
<script type="text/javascript">
var returnval = 0;
var stylesheet, xmlFile, cache, doc;
function init(){
// NSCP 7.1+ / Mozilla 1.4.1+ / Safari
// Use the standard DOM Level 2 technique, if it is supported
if (document.implementation && document.implementation.createDocument) {
xmlFile = document.implementation.createDocument("", "", null);
stylesheet = document.implementation.createDocument("", "", null);
if (xmlFile.load){
xmlFile.load("site.xml");
stylesheet.load("web/site.xsl");
} else {
alert("Document could not be loaded by browser.");
}
xmlFile.addEventListener("load", transform, false);
stylesheet.addEventListener("load", transform, false);
}
//IE 6.0+ solution
else if (window.ActiveXObject) {
xmlFile = new ActiveXObject("msxml2.DOMDocument.3.0");
xmlFile.async = false;
xmlFile.load("site.xml");
stylesheet = new ActiveXObject("msxml2.FreeThreadedDOMDocument.3.0");
stylesheet.async = false;
stylesheet.load("web/site.xsl");
cache = new ActiveXObject("msxml2.XSLTemplate.3.0");
cache.stylesheet = stylesheet;
transformData();
}
}
// separate transformation function for IE 6.0+
function transformData(){
var processor = cache.createProcessor();
processor.input = xmlFile;
processor.transform();
data.innerHTML = processor.output;
}
// separate transformation function for NSCP 7.1+ and Mozilla 1.4.1+
function transform(){
returnval+=1;
if (returnval==2){
var processor = new XSLTProcessor();
processor.importStylesheet(stylesheet);
doc = processor.transformToDocument(xmlFile);
document.getElementById("data").innerHTML = doc.documentElement.innerHTML;
}
}
</script>
</head>
<body onload="init();">
<!--[insert static HTML here]-->
<div id="data"><!-- this is where the transformed data goes --></div>
</body>
</html>

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<site>
<description url="@UPDATEURL@">
Update site for LWJGL and related features and plugins.
</description>
<feature url="features/org.lwjgl_2.jar" id="org.lwjgl" version="2">
<category name="3dlibs"/>
</feature>
<feature url="features/org.lwjgl.sdk_2.jar" id="org.lwjgl" version="2">
<category name="3dlibs"/>
</feature>
<category-def name="3dlibs" label="3D Libraries">
<description>
Java 3D libraries such as LWJGL.
</description>
</category-def>
</site>

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<site>
<description url="@UPDATEURL@">
Update site for LWJGL and related features and plugins.
</description>
<feature url="features/org.lwjgl_@VERSION@.jar" id="org.lwjgl" version="@VERSION@">
<category name="3dlibs"/>
</feature>
<feature url="features/org.lwjgl.sdk_@VERSION@.jar" id="org.lwjgl.sdk" version="@VERSION@">
<category name="3dlibs"/>
</feature>
<category-def name="3dlibs" label="3D Libraries">
<description>
Java 3D libraries such as LWJGL.
</description>
</category-def>
</site>

View File

@ -0,0 +1,12 @@
<STYLE type="text/css">
td.spacer {padding-bottom: 10px; padding-top: 10px;}
.title { font-family: sans-serif; color: #99AACC;}
.bodyText { font-family: sans-serif; font-size: 9pt; color:#000000; }
.sub-header { font-family: sans-serif; font-style: normal; font-weight: bold; font-size: 9pt; color: white;}
.log-text {font-family: sans-serif; font-style: normal; font-weight: lighter; font-size: 8pt; color:black;}
.big-header { font-family: sans-serif; font-style: normal; font-weight: bold; font-size: 9pt; color: white; border-top:10px solid white;}
.light-row {background:#FFFFFF}
.dark-row {background:#EEEEFF}
.header {background:#99AADD}
#indent {word-wrap : break-word;width :300px;text-indent:10px;}
</STYLE>

View File

@ -0,0 +1,214 @@
<xsl:stylesheet version = '1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform' xmlns:msxsl="urn:schemas-microsoft-com:xslt">
<xsl:output method="html" encoding="UTF-8"/>
<xsl:key name="cat" match="category" use="@name"/>
<xsl:template match="/">
<xsl:for-each select="site">
<html>
<head>
<title>org.lwjgl.updatesite</title>
<style>@import url("web/site.css");</style>
</head>
<body>
<h1 class="title">org.lwjgl.updatesite</h1>
<p class="bodyText"><xsl:value-of select="description"/></p>
<table width="100%" border="0" cellspacing="1" cellpadding="2">
<xsl:for-each select="category-def">
<xsl:sort select="@label" order="ascending" case-order="upper-first"/>
<xsl:sort select="@name" order="ascending" case-order="upper-first"/>
<xsl:if test="count(key('cat',@name)) != 0">
<tr class="header">
<td class="sub-header" width="30%">
<xsl:value-of select="@name"/>
</td>
<td class="sub-header" width="70%">
<xsl:value-of select="@label"/>
</td>
</tr>
<xsl:for-each select="key('cat',@name)">
<xsl:sort select="ancestor::feature//@version" order="ascending"/>
<xsl:sort select="ancestor::feature//@id" order="ascending" case-order="upper-first"/>
<tr>
<xsl:choose>
<xsl:when test="(position() mod 2 = 1)">
<xsl:attribute name="class">dark-row</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="class">light-row</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
<td class="log-text" id="indent">
<xsl:choose>
<xsl:when test="ancestor::feature//@label">
<a href="{ancestor::feature//@url}"><xsl:value-of select="ancestor::feature//@label"/></a>
<br/>
<div id="indent">
(<xsl:value-of select="ancestor::feature//@id"/> - <xsl:value-of select="ancestor::feature//@version"/>)
</div>
</xsl:when>
<xsl:otherwise>
<a href="{ancestor::feature//@url}"><xsl:value-of select="ancestor::feature//@id"/> - <xsl:value-of select="ancestor::feature//@version"/></a>
</xsl:otherwise>
</xsl:choose>
<br />
</td>
<td>
<table>
<xsl:if test="ancestor::feature//@os">
<tr><td class="log-text" id="indent">Operating Systems:</td>
<td class="log-text" id="indent"><xsl:value-of select="ancestor::feature//@os"/></td>
</tr>
</xsl:if>
<xsl:if test="ancestor::feature//@ws">
<tr><td class="log-text" id="indent">Windows Systems:</td>
<td class="log-text" id="indent"><xsl:value-of select="ancestor::feature//@ws"/></td>
</tr>
</xsl:if>
<xsl:if test="ancestor::feature//@nl">
<tr><td class="log-text" id="indent">Languages:</td>
<td class="log-text" id="indent"><xsl:value-of select="ancestor::feature//@nl"/></td>
</tr>
</xsl:if>
<xsl:if test="ancestor::feature//@arch">
<tr><td class="log-text" id="indent">Architecture:</td>
<td class="log-text" id="indent"><xsl:value-of select="ancestor::feature//@arch"/></td>
</tr>
</xsl:if>
</table>
</td>
</tr>
</xsl:for-each>
<tr><td class="spacer"><br/></td><td class="spacer"><br/></td></tr>
</xsl:if>
</xsl:for-each>
<xsl:if test="count(feature) &gt; count(feature/category)">
<tr class="header">
<td class="sub-header" colspan="2">
Uncategorized
</td>
</tr>
</xsl:if>
<xsl:choose>
<xsl:when test="function-available('msxsl:node-set')">
<xsl:variable name="rtf-nodes">
<xsl:for-each select="feature[not(category)]">
<xsl:sort select="@id" order="ascending" case-order="upper-first"/>
<xsl:sort select="@version" order="ascending" />
<xsl:value-of select="."/>
<xsl:copy-of select="." />
</xsl:for-each>
</xsl:variable>
<xsl:variable name="myNodeSet" select="msxsl:node-set($rtf-nodes)/*"/>
<xsl:for-each select="$myNodeSet">
<tr>
<xsl:choose>
<xsl:when test="position() mod 2 = 1">
<xsl:attribute name="class">dark-row</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="class">light-row</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
<td class="log-text" id="indent">
<xsl:choose>
<xsl:when test="@label">
<a href="{@url}"><xsl:value-of select="@label"/></a>
<br />
<div id="indent">
(<xsl:value-of select="@id"/> - <xsl:value-of select="@version"/>)
</div>
</xsl:when>
<xsl:otherwise>
<a href="{@url}"><xsl:value-of select="@id"/> - <xsl:value-of select="@version"/></a>
</xsl:otherwise>
</xsl:choose>
<br /><br />
</td>
<td>
<table>
<xsl:if test="@os">
<tr><td class="log-text" id="indent">Operating Systems:</td>
<td class="log-text" id="indent"><xsl:value-of select="@os"/></td>
</tr>
</xsl:if>
<xsl:if test="@ws">
<tr><td class="log-text" id="indent">Windows Systems:</td>
<td class="log-text" id="indent"><xsl:value-of select="@ws"/></td>
</tr>
</xsl:if>
<xsl:if test="@nl">
<tr><td class="log-text" id="indent">Languages:</td>
<td class="log-text" id="indent"><xsl:value-of select="@nl"/></td>
</tr>
</xsl:if>
<xsl:if test="@arch">
<tr><td class="log-text" id="indent">Architecture:</td>
<td class="log-text" id="indent"><xsl:value-of select="@arch"/></td>
</tr>
</xsl:if>
</table>
</td>
</tr>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:for-each select="feature[not(category)]">
<xsl:sort select="@id" order="ascending" case-order="upper-first"/>
<xsl:sort select="@version" order="ascending" />
<tr>
<xsl:choose>
<xsl:when test="count(preceding-sibling::feature[not(category)]) mod 2 = 1">
<xsl:attribute name="class">dark-row</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="class">light-row</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
<td class="log-text" id="indent">
<xsl:choose>
<xsl:when test="@label">
<a href="{@url}"><xsl:value-of select="@label"/></a>
<br />
<div id="indent">
(<xsl:value-of select="@id"/> - <xsl:value-of select="@version"/>)
</div>
</xsl:when>
<xsl:otherwise>
<a href="{@url}"><xsl:value-of select="@id"/> - <xsl:value-of select="@version"/></a>
</xsl:otherwise>
</xsl:choose>
<br /><br />
</td>
<td>
<table>
<xsl:if test="@os">
<tr><td class="log-text" id="indent">Operating Systems:</td>
<td class="log-text" id="indent"><xsl:value-of select="@os"/></td>
</tr>
</xsl:if>
<xsl:if test="@ws">
<tr><td class="log-text" id="indent">Windows Systems:</td>
<td class="log-text" id="indent"><xsl:value-of select="@ws"/></td>
</tr>
</xsl:if>
<xsl:if test="@nl">
<tr><td class="log-text" id="indent">Languages:</td>
<td class="log-text" id="indent"><xsl:value-of select="@nl"/></td>
</tr>
</xsl:if>
<xsl:if test="@arch">
<tr><td class="log-text" id="indent">Architecture:</td>
<td class="log-text" id="indent"><xsl:value-of select="@arch"/></td>
</tr>
</xsl:if>
</table>
</td>
</tr>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
</table>
</body>
</html>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>

View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src/java"/>
<classpathentry exported="true" kind="lib" path="AppleJavaExtensions.jar"/>
<classpathentry exported="true" kind="lib" path="jinput.jar"/>
<classpathentry exported="true" kind="lib" path="lwjgl.jar"/>
<classpathentry exported="true" kind="lib" path="lwjgl_test.jar"/>
<classpathentry exported="true" kind="lib" path="lwjgl_util.jar"/>
<classpathentry exported="true" kind="lib" path="lwjgl_util_applet.jar"/>
<classpathentry exported="true" kind="lib" path="lzma.jar"/>
<classpathentry kind="output" path="build/classes"/>
</classpath>

View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>org.lwjgl</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

View File

@ -0,0 +1,12 @@
#Tue Nov 23 14:49:20 CET 2010
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
org.eclipse.jdt.core.compiler.compliance=1.5
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.5

Binary file not shown.

View File

@ -0,0 +1,38 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: LWJGL Lightweight Java Game Library
Bundle-SymbolicName: org.lwjgl
Bundle-Version: 2.0.0
Bundle-Vendor: Lightweight Java Game Library Project
Bundle-Activator: org.lwjgl.Activator
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime
Bundle-ActivationPolicy: lazy
Export-Package: LZMA,
com.apple.eawt,
com.apple.eio,
net.java.games.input,
net.java.games.util,
net.java.games.util.plugins,
org.lwjgl,
org.lwjgl.input,
org.lwjgl.openal,
org.lwjgl.opencl,
org.lwjgl.opencl.api,
org.lwjgl.opengl,
org.lwjgl.util,
org.lwjgl.util.applet,
org.lwjgl.util.glu,
org.lwjgl.util.glu.tessellation,
org.lwjgl.util.input,
org.lwjgl.util.jinput,
org.lwjgl.util.vector
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ClassPath: .,
lwjgl.jar,
lwjgl_util.jar,
lwjgl_util_applet.jar,
lwjgl_test.jar,
AppleJavaExtensions.jar,
jinput.jar,
lzma.jar

View File

@ -0,0 +1,11 @@
source.. = src/java/
output.. = build/classes/
bin.includes = META-INF/,\
.,\
lzma.jar,\
jinput.jar,\
lwjgl.jar,\
lwjgl_test.jar,\
lwjgl_util.jar,\
lwjgl_util_applet.jar,\
native/

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,83 @@
/*******************************************************************************
* Copyright (c) 2011 LWJGL Project and others
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html, and under the terms of the
* BSD license, see http://lwjgl.org/license.php for details.
*
* Contributors:
* Jens von Pilgrim - initial implementation
******************************************************************************/
package org.lwjgl;
import org.eclipse.core.runtime.Plugin;
import org.eclipse.core.runtime.Status;
import org.osgi.framework.BundleContext;
import org.osgi.framework.BundleException;
/**
* The activator class controls the plug-in life cycle.
*
* @author Jens von Pilgrim (developer@jevopi.de)
* @since Mar 30, 2011
*/
public class Activator extends Plugin {
// The plug-in ID
public static final String PLUGIN_ID = "org.lwjgl";
// The shared instance
private static Activator plugin;
/**
* The constructor
*/
public Activator() {
plugin = this;
}
/*
* (non-Javadoc)
* @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
*/
@Override
public void start(BundleContext context) throws Exception {
super.start(context);
try {
String path = LibraryPathUtil.getLWJGLLibraryPath(context);
Status status = new Status(Status.INFO, PLUGIN_ID, Status.INFO,
"Set org.lwjgl.librarypath to " + path, null);
getLog().log(status);
} catch (Throwable ex) {
Status status = new Status(Status.ERROR, PLUGIN_ID, Status.ERROR,
"Error setting native LWJGL libraries path: " + ex.toString(), ex);
getLog().log(status);
throw new BundleException(status.getMessage(), ex);
}
}
/*
* (non-Javadoc)
* @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
*/
@Override
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
}
/**
* Returns the shared instance
*
* @return the shared instance
*/
public static Activator getDefault() {
return plugin;
}
}

View File

@ -0,0 +1,92 @@
/*******************************************************************************
* Copyright (c) 2011 LWJGL Project and others
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html, and under the terms of the
* BSD license, see http://lwjgl.org/license.php for details.
*
* Contributors:
* Jens von Pilgrim - initial implementation
******************************************************************************/
package org.lwjgl;
import java.io.File;
import java.io.IOException;
import java.net.URL;
import org.eclipse.core.runtime.FileLocator;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
/**
* Helper class for retrieving plugin relative path of native LWJGL
* libraries and setting the path in the system properties.
*
* @author Jens von Pilgrim
* @since Jan 30, 2011
*/
public class LibraryPathUtil {
public static final String LWJGL_SYSTEM_PROPERTY = "org.lwjgl.librarypath";
public static String[] NATIVEPATH = new String[] { "windows", "macosx",
"linux", "solaris" };
/**
* Returns plugin relative path to native libraries according to
* current operating system.
*
* @return
* @throws OSNotSupportedException
*/
public static String getRelativeLWJGLLibraryPath()
throws OSNotSupportedException {
int iOS = -1;
String osname = System.getProperty("os.name").toLowerCase();
String osarch = System.getProperty("os.arch").toLowerCase();
// applied patch by Carlo Salinari: ignore osarch on windows
// see http://lwjgl.org/forum/index.php/topic,3726.0.html
if (osname.startsWith("windows")) {
iOS = 0;
} else if (osname.startsWith("mac")) {
iOS = 1;
} else if (osname.startsWith("linux")) {
iOS = 2;
} else if (osname.startsWith("solaris")) {
iOS = 3;
}
if (iOS >= 0 && iOS < NATIVEPATH.length) {
String base = "native" + File.separator + NATIVEPATH[iOS];
return base;
} else {
throw new OSNotSupportedException(osname, osarch);
}
}
/**
* Returns absolute path of native LWJGL libraries according to
* current operating system, this path is also set as
* system property.
*
* @param context
* @return
* @throws OSNotSupportedException
* @throws IOException
*/
public static String getLWJGLLibraryPath(BundleContext context)
throws OSNotSupportedException, IOException {
String base = getRelativeLWJGLLibraryPath();
Bundle fragment = context.getBundle();
URL url = FileLocator.resolve(fragment.getEntry(base));
File fileDir = new File(url.getPath());
String path = fileDir.getPath();
System.setProperty(LWJGL_SYSTEM_PROPERTY, path);
return path;
}
}

View File

@ -0,0 +1,53 @@
/*******************************************************************************
* Copyright (c) 2011 LWJGL Project and others
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html, and under the terms of the
* BSD license, see http://lwjgl.org/license.php for details.
*
* Contributors:
* Jens von Pilgrim - initial implementation
******************************************************************************/
package org.lwjgl;
/**
* Exception thrown by library loader if operating system is not supported.
*
* @author Jens von Pilgrim (developer@jevopi.de)
* @since Jan 30, 2011
*/
public class OSNotSupportedException extends Exception {
String strOSName;
String strOSArch;
/**
* @param i_strOSName
* @param i_strOSArch
*/
public OSNotSupportedException(String i_strOSName, String i_strOSArch) {
super();
strOSName = i_strOSName;
strOSArch = i_strOSArch;
}
/**
* {@inheritDoc}
* @see java.lang.Throwable#getMessage()
*/
@Override
public String getMessage() {
return strOSName + " (" + strOSArch + ") not supported by LWJGL.";
}
/**
* {@inheritDoc}
* @see java.lang.Throwable#toString()
*/
@Override
public String toString() {
return getMessage();
}
}