diff options
-rw-r--r-- | build.xml | 21 | ||||
-rw-r--r-- | nbproject/project.properties | 2 | ||||
-rw-r--r-- | resources/CL/cl.h (renamed from resources/cl.h) | 0 | ||||
-rw-r--r-- | resources/CL/cl_gl.h (renamed from resources/cl_gl.h) | 0 | ||||
-rw-r--r-- | resources/OpenCL.cfg | 1 | ||||
-rw-r--r-- | resources/gltypes.h | 18 | ||||
-rw-r--r-- | resources/opencl.h (renamed from resources/CL/opencl.h) | 3 | ||||
-rw-r--r-- | test/com/mbien/opencl/JOCLTest.java | 9 |
8 files changed, 36 insertions, 18 deletions
@@ -24,16 +24,17 @@ <pathelement location="../gluegen/build/antlr-2.7.7.jar" /> </path> + <taskdef name="gluegen" classname="com.sun.gluegen.ant.GlueGenTask" classpathref="gluegen.classpath" /> + + <!--OpenCL Impl including GL interoperability--> <dirset id="jocl.include.path" dir="${basedir}"> <include name="resources"/> <include name="resources/CL"/> <include name="resources/jvm_stubs"/> </dirset> - <!--OpenCL--> <echo message=" - - - generate JOCL java files - - - "/> - <taskdef name="gluegen" classname="com.sun.gluegen.ant.GlueGenTask" classpathref="gluegen.classpath" /> - <gluegen src="resources/cl.h" + <gluegen src="resources/opencl.h" config="resources/OpenCL.cfg" includeRefid="jocl.include.path" emitter="com.sun.gluegen.JavaEmitter"> @@ -41,16 +42,8 @@ </gluegen> <echo message=" - - - JOCL java files generated - - - "/> - <!-- TODO OpenCL - OpenGL interoperability - <echo message=" - - - generate CL-GL java files - - - "/> - <gluegen src="resources/cl_gl.h" - config="resources/OpenCLGL.cfg" - includeRefid="include.path" - emitter="com.sun.gluegen.JavaEmitter"> - <classpath refid="gluegen.classpath" /> - </gluegen> - <echo message=" - - - CL-GL java files generated - - - "/> - --> + <!-- TODO 1. generate CLGLimpl + 2. split interfaces into CL and CLGL --> </target> @@ -87,6 +80,8 @@ <includepath path="${java.includes.dir}"/> <includepath path="${java.includes.dir.platform}"/> + <includepath path="${basedir}/../jogl/make/stub_includes/opengl/GL3"/> + <includepath path="${basedir}/../jogl/make/stub_includes/opengl"/> <includepath path="${basedir}/resources"/> <includepath path="${basedir}/resources/CL"/> diff --git a/nbproject/project.properties b/nbproject/project.properties index 7fd3fea7..523677b1 100644 --- a/nbproject/project.properties +++ b/nbproject/project.properties @@ -62,7 +62,7 @@ run.classpath=\ # 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): -run.jvmargs= +run.jvmargs=-Djava.library.path="/home/mbien/NetBeansProjects/JOGL/jocl/build/natives/jocl" run.test.classpath=\ ${javac.test.classpath}:\ ${build.test.classes.dir} diff --git a/resources/cl.h b/resources/CL/cl.h index d353f9ad..d353f9ad 100644 --- a/resources/cl.h +++ b/resources/CL/cl.h diff --git a/resources/cl_gl.h b/resources/CL/cl_gl.h index 4eab6d7a..4eab6d7a 100644 --- a/resources/cl_gl.h +++ b/resources/CL/cl_gl.h diff --git a/resources/OpenCL.cfg b/resources/OpenCL.cfg index 6a39180f..9ac199c1 100644 --- a/resources/OpenCL.cfg +++ b/resources/OpenCL.cfg @@ -31,4 +31,5 @@ Opaque long cl_device_id #append to generated c files CustomCCode #include <cl.h> +CustomCCode #include <gl3.h> CustomCCode #include <inttypes.h> diff --git a/resources/gltypes.h b/resources/gltypes.h new file mode 100644 index 00000000..3272b72a --- /dev/null +++ b/resources/gltypes.h @@ -0,0 +1,18 @@ +//we need only the basic gl types for the cl-gl interoperability +//extracted from gl3.h + +typedef unsigned int GLenum; +typedef unsigned char GLboolean; +typedef unsigned int GLbitfield; +typedef signed char GLbyte; +typedef short GLshort; +typedef int GLint; +typedef int GLsizei; +typedef unsigned char GLubyte; +typedef unsigned short GLushort; +typedef unsigned int GLuint; +typedef float GLfloat; +typedef float GLclampf; +typedef double GLdouble; +typedef double GLclampd; +typedef void GLvoid; diff --git a/resources/CL/opencl.h b/resources/opencl.h index 4f621ab6..ab05e15a 100644 --- a/resources/CL/opencl.h +++ b/resources/opencl.h @@ -5,5 +5,6 @@ #ifdef _WIN32 #include <windows.h> #endif -#include <GL/gl.h> +//#include <GL/gl.h> +#include <gltypes.h> #include <CL/cl_gl.h> diff --git a/test/com/mbien/opencl/JOCLTest.java b/test/com/mbien/opencl/JOCLTest.java index 3dce30a3..a3bdee3e 100644 --- a/test/com/mbien/opencl/JOCLTest.java +++ b/test/com/mbien/opencl/JOCLTest.java @@ -24,15 +24,18 @@ public class JOCLTest { } @Test - public void test() { + public void basicTest() { System.out.println(0xFFFFFFFF); System.out.println(0xFFFFFFFE); System.out.println(0xFFFFFFFD); -// System.out.println(CL.CL_DEVICE_TYPE_ALL); + + System.loadLibrary("jocl"); + CLImpl impl = new CLImpl(); long ctx = impl.clCreateContextFromType(null, CL.CL_DEVICE_TYPE_ALL, null); -// impl.clgetp + System.out.println("context handle: "+ctx); + } |