summaryrefslogtreecommitdiffstats
path: root/maven/jp4da/jp4da-desktop
diff options
context:
space:
mode:
Diffstat (limited to 'maven/jp4da/jp4da-desktop')
-rw-r--r--maven/jp4da/jp4da-desktop/.classpath36
-rw-r--r--maven/jp4da/jp4da-desktop/.project23
-rw-r--r--maven/jp4da/jp4da-desktop/.settings/org.eclipse.core.resources.prefs6
-rw-r--r--maven/jp4da/jp4da-desktop/.settings/org.eclipse.jdt.core.prefs5
-rw-r--r--maven/jp4da/jp4da-desktop/.settings/org.eclipse.m2e.core.prefs4
-rw-r--r--maven/jp4da/jp4da-desktop/pom.xml61
-rw-r--r--maven/jp4da/jp4da-desktop/src/main/java/com/io7m/examples/jp4da/DesktopExample.java56
7 files changed, 191 insertions, 0 deletions
diff --git a/maven/jp4da/jp4da-desktop/.classpath b/maven/jp4da/jp4da-desktop/.classpath
new file mode 100644
index 0000000..534b5e5
--- /dev/null
+++ b/maven/jp4da/jp4da-desktop/.classpath
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/classes" path="src/main/java">
+ <attributes>
+ <attribute name="optional" value="true"/>
+ <attribute name="maven.pomderived" value="true"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
+ <attributes>
+ <attribute name="maven.pomderived" value="true"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/java">
+ <attributes>
+ <attribute name="optional" value="true"/>
+ <attribute name="maven.pomderived" value="true"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
+ <attributes>
+ <attribute name="maven.pomderived" value="true"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6">
+ <attributes>
+ <attribute name="maven.pomderived" value="true"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
+ <attributes>
+ <attribute name="maven.pomderived" value="true"/>
+ </attributes>
+ </classpathentry>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
diff --git a/maven/jp4da/jp4da-desktop/.project b/maven/jp4da/jp4da-desktop/.project
new file mode 100644
index 0000000..3f56db4
--- /dev/null
+++ b/maven/jp4da/jp4da-desktop/.project
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>jp4da-desktop</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.m2e.core.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.m2e.core.maven2Nature</nature>
+ </natures>
+</projectDescription>
diff --git a/maven/jp4da/jp4da-desktop/.settings/org.eclipse.core.resources.prefs b/maven/jp4da/jp4da-desktop/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 0000000..29abf99
--- /dev/null
+++ b/maven/jp4da/jp4da-desktop/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,6 @@
+eclipse.preferences.version=1
+encoding//src/main/java=UTF-8
+encoding//src/main/resources=UTF-8
+encoding//src/test/java=UTF-8
+encoding//src/test/resources=UTF-8
+encoding/<project>=UTF-8
diff --git a/maven/jp4da/jp4da-desktop/.settings/org.eclipse.jdt.core.prefs b/maven/jp4da/jp4da-desktop/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..60105c1
--- /dev/null
+++ b/maven/jp4da/jp4da-desktop/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,5 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/maven/jp4da/jp4da-desktop/.settings/org.eclipse.m2e.core.prefs b/maven/jp4da/jp4da-desktop/.settings/org.eclipse.m2e.core.prefs
new file mode 100644
index 0000000..f897a7f
--- /dev/null
+++ b/maven/jp4da/jp4da-desktop/.settings/org.eclipse.m2e.core.prefs
@@ -0,0 +1,4 @@
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
diff --git a/maven/jp4da/jp4da-desktop/pom.xml b/maven/jp4da/jp4da-desktop/pom.xml
new file mode 100644
index 0000000..ef13263
--- /dev/null
+++ b/maven/jp4da/jp4da-desktop/pom.xml
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project
+ xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>com.io7m.examples.jp4da</groupId>
+ <artifactId>jp4da-desktop</artifactId>
+ <version>1.0.0</version>
+ <name>jp4da-desktop</name>
+ <description>Desktop code</description>
+ <packaging>jar</packaging>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+ </properties>
+
+ <dependencies>
+ <dependency>
+ <groupId>com.io7m.examples.jp4da</groupId>
+ <artifactId>jp4da-core</artifactId>
+ <version>1.0.0</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.jogamp.jogl</groupId>
+ <artifactId>jogl-all</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+
+ <!-- Depend on gluegen-main and jogl-all-main, which implicitly depend on all platform natives -->
+ <dependency>
+ <groupId>org.jogamp.gluegen</groupId>
+ <artifactId>gluegen-rt-main</artifactId>
+ <version>2.0-rc11</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jogamp.jogl</groupId>
+ <artifactId>jogl-all-main</artifactId>
+ <version>2.0-rc11</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <!-- Require JDK >= 1.6 -->
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>2.5.1</version>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
diff --git a/maven/jp4da/jp4da-desktop/src/main/java/com/io7m/examples/jp4da/DesktopExample.java b/maven/jp4da/jp4da-desktop/src/main/java/com/io7m/examples/jp4da/DesktopExample.java
new file mode 100644
index 0000000..d7df081
--- /dev/null
+++ b/maven/jp4da/jp4da-desktop/src/main/java/com/io7m/examples/jp4da/DesktopExample.java
@@ -0,0 +1,56 @@
+package com.io7m.examples.jp4da;
+
+import javax.media.opengl.GLCapabilities;
+import javax.media.opengl.GLEventListener;
+import javax.media.opengl.GLProfile;
+
+import com.jogamp.newt.opengl.GLWindow;
+import com.jogamp.opengl.util.FPSAnimator;
+
+public class DesktopExample implements Runnable
+{
+ public static void main(
+ final String args[])
+ {
+ final DesktopExample de = new DesktopExample(new Example());
+ de.run();
+ }
+
+ private final GLWindow window;
+ private final FPSAnimator animator;
+
+ private DesktopExample(
+ final GLEventListener gle)
+ {
+ final GLProfile pro = GLProfile.get(GLProfile.GL2GL3);
+ final GLCapabilities cap = new GLCapabilities(pro);
+
+ this.window = GLWindow.create(cap);
+ this.window.setSize(640, 480);
+ this.window.setTitle("Test1");
+ this.window.addGLEventListener(gle);
+ this.window.setVisible(true);
+
+ this.animator = new FPSAnimator(60);
+ this.animator.setUpdateFPSFrames(60, System.err);
+ this.animator.add(this.window);
+ this.animator.start();
+ }
+
+ @Override public void run()
+ {
+ try {
+ while (this.animator.isAnimating() && this.window.isVisible()) {
+ Thread.sleep(100);
+ }
+
+ this.animator.stop();
+ this.window.destroy();
+
+ System.err.println("Exiting...");
+ } catch (final InterruptedException e) {
+ e.printStackTrace();
+ System.exit(1);
+ }
+ }
+}