aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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
+}