summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Bien <mbien@fh-landshut.de>2010-05-02 14:20:37 +0200
committerMichael Bien <mbien@fh-landshut.de>2010-05-02 14:20:37 +0200
commit0f0b0e643c2bcef81c954a8be2b12fc2e63efb59 (patch)
tree4a291809fadf8864128e1fa1d83e5d3d284b928f
parent37401c35717505b79ab203881b86534bb7098ee8 (diff)
parent37cd0776c665005554b81b5a0e460a68ba5d6720 (diff)
Merge branch 'master' of github.com:mbien/jocl-demos
-rw-r--r--build.xml8
-rw-r--r--nbproject/project.properties184
-rw-r--r--src/com/jogamp/opencl/demos/joglinterop/GLCLInteroperabilityDemo.java5
3 files changed, 105 insertions, 92 deletions
diff --git a/build.xml b/build.xml
index 18de08c..0f08760 100644
--- a/build.xml
+++ b/build.xml
@@ -9,7 +9,15 @@
<!-- in the project's Project Properties dialog box.-->
<project name="jocl-demos" default="default" basedir=".">
<description>Builds, tests, and runs the project jocl-demos.</description>
+
+ <condition property="rootrel.build" value="build">
+ <not>
+ <isset property="rootrel.build"/>
+ </not>
+ </condition>
+
<import file="nbproject/build-impl.xml"/>
+
<!--
There exist several targets which are by default empty and which can be
diff --git a/nbproject/project.properties b/nbproject/project.properties
index c1425c6..68fc9bf 100644
--- a/nbproject/project.properties
+++ b/nbproject/project.properties
@@ -1,91 +1,93 @@
-application.title=JOCL Demos
-application.vendor=jogamp
-build.classes.dir=${build.dir}/classes
-build.classes.excludes=**/*.java,**/*.form
-# This directory is removed when the project is cleaned:
-build.dir=build
-build.generated.dir=${build.dir}/generated
-build.generated.sources.dir=${build.dir}/generated-sources
-# Only compile against the classpath explicitly listed here:
-build.sysclasspath=ignore
-build.test.classes.dir=${build.dir}/test/classes
-build.test.results.dir=${build.dir}/test/results
-# Uncomment to specify the preferred debugger connection transport:
-#debug.transport=dt_socket
-debug.classpath=\
- ${run.classpath}
-debug.test.classpath=\
- ${run.test.classpath}
-# This directory is removed when the project is cleaned:
-dist.dir=dist
-dist.jar=${dist.dir}/jocl-demos.jar
-dist.javadoc.dir=${dist.dir}/javadoc
-endorsed.classpath=
-excludes=
-includes=**
-jar.compress=false
-javac.classpath=\
- ${reference.jocl.jar}:\
- ${file.reference.jogl.all.jar}:\
- ${file.reference.newt.all.jar}:\
- ${file.reference.nativewindow.all.jar}:\
- ${file.reference.gluegen-rt.jar}
-# Space-separated list of extra javac options
-javac.compilerargs=
-javac.deprecation=false
-javac.source=1.5
-javac.target=1.5
-javac.test.classpath=\
- ${javac.classpath}:\
- ${build.classes.dir}:\
- ${libs.junit.classpath}:\
- ${libs.junit_4.classpath}
-javadoc.additionalparam=
-javadoc.author=false
-javadoc.encoding=${source.encoding}
-javadoc.noindex=false
-javadoc.nonavbar=false
-javadoc.notree=false
-javadoc.private=false
-javadoc.splitindex=true
-javadoc.use=true
-javadoc.version=false
-javadoc.windowtitle=
-jaxbwiz.endorsed.dirs="${netbeans.home}/../ide12/modules/ext/jaxb/api"
-main.class=com.jogamp.opencl.demos.hellojocl.HelloJOCL
-manifest.file=manifest.mf
-meta.inf.dir=${src.dir}/META-INF
-no.dependencies=true
-platform.active=default_platform
-
-#default values
-gluegen.root=${basedir}/../gluegen
-jogl.root=${basedir}/../jogl
-jocl.root=${basedir}/../jocl
-
-project.jocl=${jocl.root}
-reference.jocl.jar=${jocl.root}/dist/jocl.jar
-file.reference.gluegen-rt.jar=${gluegen.root}/build/gluegen-rt.jar
-file.reference.jogl.all.jar=${jogl.root}/build/jogl/jogl.all.jar
-file.reference.nativewindow.all.jar=${jogl.root}/build/nativewindow/nativewindow.all.jar
-file.reference.newt.all.jar=${jogl.root}/build/newt/newt.all.jar
-
-run.classpath=\
- ${javac.classpath}:\
- ${build.classes.dir}
-# Space-separated list of JVM arguments used when running the project
-# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
-# or test-sys-prop.name=value to set system properties for unit tests):
-#-verbose:jni
-run.jvmargs=-Djava.library.path="\
- ${jocl.root}/build/natives/jocl:\
- ${jogl.root}/build/jogl/obj:\
- ${jogl.root}/build/nativewindow/obj:\
- ${jogl.root}/build/newt/obj:\
- ${gluegen.root}/build/obj"
-run.test.classpath=\
- ${javac.test.classpath}:\
- ${build.test.classes.dir}
-source.encoding=UTF-8
-src.dir=src
-test.src.dir=test
+
+#default values
+gluegen.root=${basedir}/../gluegen
+jogl.root=${basedir}/../jogl
+jocl.root=${basedir}/../jocl
+rootrel.build=build
+
+application.title=JOCL Demos
+application.vendor=jogamp
+build.classes.excludes=**/*.java,**/*.form
+# This directory is removed when the project is cleaned:
+build.dir=${rootrel.build}
+build.classes.dir=${build.dir}/classes
+build.generated.dir=${build.dir}/generated
+build.generated.sources.dir=${build.dir}/generated-sources
+# Only compile against the classpath explicitly listed here:
+build.sysclasspath=ignore
+build.test.classes.dir=${build.dir}/test/classes
+build.test.results.dir=${build.dir}/test/results
+# Uncomment to specify the preferred debugger connection transport:
+#debug.transport=dt_socket
+debug.classpath=\
+ ${run.classpath}
+debug.test.classpath=\
+ ${run.test.classpath}
+# This directory is removed when the project is cleaned:
+dist.dir=dist
+dist.jar=${dist.dir}/jocl-demos.jar
+dist.javadoc.dir=${dist.dir}/javadoc
+endorsed.classpath=
+excludes=
+includes=**
+jar.compress=false
+javac.classpath=\
+ ${reference.jocl.jar}:\
+ ${file.reference.jogl.all.jar}:\
+ ${file.reference.newt.all.jar}:\
+ ${file.reference.nativewindow.all.jar}:\
+ ${file.reference.gluegen-rt.jar}
+# Space-separated list of extra javac options
+javac.compilerargs=
+javac.deprecation=false
+javac.source=1.5
+javac.target=1.5
+javac.test.classpath=\
+ ${javac.classpath}:\
+ ${build.classes.dir}:\
+ ${libs.junit.classpath}:\
+ ${libs.junit_4.classpath}
+javadoc.additionalparam=
+javadoc.author=false
+javadoc.encoding=${source.encoding}
+javadoc.noindex=false
+javadoc.nonavbar=false
+javadoc.notree=false
+javadoc.private=false
+javadoc.splitindex=true
+javadoc.use=true
+javadoc.version=false
+javadoc.windowtitle=
+jaxbwiz.endorsed.dirs="${netbeans.home}/../ide12/modules/ext/jaxb/api"
+main.class=com.jogamp.opencl.demos.hellojocl.HelloJOCL
+manifest.file=manifest.mf
+meta.inf.dir=${src.dir}/META-INF
+no.dependencies=true
+platform.active=default_platform
+
+project.jocl=${jocl.root}
+reference.jocl.jar=${jocl.root}/dist/jocl.jar
+file.reference.gluegen-rt.jar=${gluegen.root}/${rootrel.build}/gluegen-rt.jar
+file.reference.jogl.all.jar=${jogl.root}/${rootrel.build}/jogl/jogl.all.jar
+file.reference.nativewindow.all.jar=${jogl.root}/${rootrel.build}/nativewindow/nativewindow.all.jar
+file.reference.newt.all.jar=${jogl.root}/${rootrel.build}/newt/newt.all.jar
+
+run.classpath=\
+ ${javac.classpath}:\
+ ${build.classes.dir}
+# Space-separated list of JVM arguments used when running the project
+# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value
+# or test-sys-prop.name=value to set system properties for unit tests):
+#-verbose:jni
+run.jvmargs=-Djava.library.path="\
+ ${jocl.root}/${rootrel.build}/natives/jocl${path.separator}\
+ ${jogl.root}/${rootrel.build}/jogl/obj${path.separator}\
+ ${jogl.root}/${rootrel.build}/nativewindow/obj${path.separator}\
+ ${jogl.root}/${rootrel.build}/newt/obj${path.separator}\
+ ${gluegen.root}/${rootrel.build}/obj"
+run.test.classpath=\
+ ${javac.test.classpath}:\
+ ${build.test.classes.dir}
+source.encoding=UTF-8
+src.dir=src
+test.src.dir=test
diff --git a/src/com/jogamp/opencl/demos/joglinterop/GLCLInteroperabilityDemo.java b/src/com/jogamp/opencl/demos/joglinterop/GLCLInteroperabilityDemo.java
index 24af1fe..3abe1de 100644
--- a/src/com/jogamp/opencl/demos/joglinterop/GLCLInteroperabilityDemo.java
+++ b/src/com/jogamp/opencl/demos/joglinterop/GLCLInteroperabilityDemo.java
@@ -124,6 +124,9 @@ public class GLCLInteroperabilityDemo implements GLEventListener {
break;
}
}
+ if(null==device) {
+ throw new RuntimeException("couldn't find any CL/GL memory sharing devices ..");
+ }
// create OpenCL context before creating any OpenGL objects
// you want to share with OpenCL (AMD driver requirement)
clContext = CLGLContext.create(drawable.getContext(), device);
@@ -274,4 +277,4 @@ public class GLCLInteroperabilityDemo implements GLEventListener {
new GLCLInteroperabilityDemo();
}
-} \ No newline at end of file
+}