diff options
author | Michael Bien <[email protected]> | 2010-02-13 22:16:28 +0100 |
---|---|---|
committer | Michael Bien <[email protected]> | 2010-02-13 22:16:28 +0100 |
commit | f386e227c0cd30bf10b90acccd77d4845dc45783 (patch) | |
tree | 84e7fd80b0b09f60c546e15d6a72bcfe3b682e9f /src/com/mbien/opencl/demos/julia3d/structs | |
parent | 4e34732609bfa569aae8e89fe0304a7e56628256 (diff) |
initial import of David Bucciarelli's Julia3d demo ported to java using OpenCL and JOGL2.
Diffstat (limited to 'src/com/mbien/opencl/demos/julia3d/structs')
9 files changed, 590 insertions, 0 deletions
diff --git a/src/com/mbien/opencl/demos/julia3d/structs/Camera.java b/src/com/mbien/opencl/demos/julia3d/structs/Camera.java new file mode 100644 index 0000000..8b820e1 --- /dev/null +++ b/src/com/mbien/opencl/demos/julia3d/structs/Camera.java @@ -0,0 +1,52 @@ +/* !---- DO NOT EDIT: This file autogenerated by com/sun/gluegen/JavaEmitter.java on Tue Feb 09 18:20:26 CET 2010 ----! */ + + +package com.mbien.opencl.demos.julia3d.structs; + +import java.nio.*; + +import com.sun.gluegen.runtime.*; + + +public abstract class Camera { + + StructAccessor accessor; + + public static int size() { + if (CPU.is32Bit()) { + return Camera32.size(); + } else { + return Camera64.size(); + } + } + + public static Camera create() { + return create(BufferFactory.newDirectByteBuffer(size())); + } + + public static Camera create(java.nio.ByteBuffer buf) { + if (CPU.is32Bit()) { + return new Camera32(buf); + } else { + return new Camera64(buf); + } + } + + Camera(java.nio.ByteBuffer buf) { + accessor = new StructAccessor(buf); + } + + public java.nio.ByteBuffer getBuffer() { + return accessor.getBuffer(); + } + + public abstract Vec getOrig(); + + public abstract Vec getTarget(); + + public abstract Vec getDir(); + + public abstract Vec getX(); + + public abstract Vec getY(); +} diff --git a/src/com/mbien/opencl/demos/julia3d/structs/Camera32.java b/src/com/mbien/opencl/demos/julia3d/structs/Camera32.java new file mode 100644 index 0000000..2d09540 --- /dev/null +++ b/src/com/mbien/opencl/demos/julia3d/structs/Camera32.java @@ -0,0 +1,41 @@ +/* !---- DO NOT EDIT: This file autogenerated by com/sun/gluegen/JavaEmitter.java on Tue Feb 09 18:20:26 CET 2010 ----! */ + + +package com.mbien.opencl.demos.julia3d.structs; + +import java.nio.*; + +import com.sun.gluegen.runtime.*; + + +class Camera32 extends Camera { + + public static int size() { + return 76; + } + + Camera32(java.nio.ByteBuffer buf) { + super(buf); + } + + + public Vec getOrig() { + return Vec.create(accessor.slice(0, 12)); + } + + public Vec getTarget() { + return Vec.create(accessor.slice(16, 12)); + } + + public Vec getDir() { + return Vec.create(accessor.slice(32, 12)); + } + + public Vec getX() { + return Vec.create(accessor.slice(48, 12)); + } + + public Vec getY() { + return Vec.create(accessor.slice(64, 12)); + } +} diff --git a/src/com/mbien/opencl/demos/julia3d/structs/Camera64.java b/src/com/mbien/opencl/demos/julia3d/structs/Camera64.java new file mode 100644 index 0000000..fe5a729 --- /dev/null +++ b/src/com/mbien/opencl/demos/julia3d/structs/Camera64.java @@ -0,0 +1,52 @@ +/* !---- DO NOT EDIT: This file autogenerated by com/sun/gluegen/JavaEmitter.java on Tue Feb 09 18:20:26 CET 2010 ----! */ + + +package com.mbien.opencl.demos.julia3d.structs; + +import java.nio.*; + +import com.sun.gluegen.runtime.*; + + +class Camera64 extends Camera { + + private final Vec orig; + private final Vec target; + private final Vec dir; + private final Vec x; + private final Vec y; + + public static int size() { + return 60; + } + + Camera64(java.nio.ByteBuffer buf) { + super(buf); + orig = Vec.create(accessor.slice(0, 12)); + target = Vec.create(accessor.slice(12, 12)); + dir = Vec.create(accessor.slice(24, 12)); + x = Vec.create(accessor.slice(36, 12)); + y = Vec.create(accessor.slice(48, 12)); + } + + + public Vec getOrig() { + return orig; + } + + public Vec getTarget() { + return target; + } + + public Vec getDir() { + return dir; + } + + public Vec getX() { + return x; + } + + public Vec getY() { + return y; + } +} diff --git a/src/com/mbien/opencl/demos/julia3d/structs/RenderingConfig.java b/src/com/mbien/opencl/demos/julia3d/structs/RenderingConfig.java new file mode 100644 index 0000000..f96210f --- /dev/null +++ b/src/com/mbien/opencl/demos/julia3d/structs/RenderingConfig.java @@ -0,0 +1,80 @@ +/* !---- DO NOT EDIT: This file autogenerated by com/sun/gluegen/JavaEmitter.java on Tue Feb 09 18:20:26 CET 2010 ----! */ + + +package com.mbien.opencl.demos.julia3d.structs; + +import java.nio.*; + +import com.sun.gluegen.runtime.*; + + +public abstract class RenderingConfig { + + StructAccessor accessor; + + public static int size() { + if (CPU.is32Bit()) { + return RenderingConfig32.size(); + } else { + return RenderingConfig64.size(); + } + } + + public static RenderingConfig create() { + return create(BufferFactory.newDirectByteBuffer(size())); + } + + public static RenderingConfig create(java.nio.ByteBuffer buf) { + if (CPU.is32Bit()) { + return new RenderingConfig32(buf); + } else { + return new RenderingConfig64(buf); + } + } + + RenderingConfig(java.nio.ByteBuffer buf) { + accessor = new StructAccessor(buf); + } + + public java.nio.ByteBuffer getBuffer() { + return accessor.getBuffer(); + } + + public abstract RenderingConfig setWidth(int val); + + public abstract int getWidth(); + + public abstract RenderingConfig setHeight(int val); + + public abstract int getHeight(); + + public abstract RenderingConfig setSuperSamplingSize(int val); + + public abstract int getSuperSamplingSize(); + + public abstract RenderingConfig setActvateFastRendering(int val); + + public abstract int getActvateFastRendering(); + + public abstract RenderingConfig setEnableShadow(int val); + + public abstract int getEnableShadow(); + + public abstract RenderingConfig setMaxIterations(int val); + + public abstract int getMaxIterations(); + + public abstract RenderingConfig setEpsilon(float val); + + public abstract float getEpsilon(); + + public abstract RenderingConfig setMu(float[] val); + + public abstract float[] getMu(); + + public abstract RenderingConfig setLight(float[] val); + + public abstract float[] getLight(); + + public abstract Camera getCamera(); +} diff --git a/src/com/mbien/opencl/demos/julia3d/structs/RenderingConfig32.java b/src/com/mbien/opencl/demos/julia3d/structs/RenderingConfig32.java new file mode 100644 index 0000000..ec32613 --- /dev/null +++ b/src/com/mbien/opencl/demos/julia3d/structs/RenderingConfig32.java @@ -0,0 +1,106 @@ +/* !---- DO NOT EDIT: This file autogenerated by com/sun/gluegen/JavaEmitter.java on Tue Feb 09 18:20:26 CET 2010 ----! */ + + +package com.mbien.opencl.demos.julia3d.structs; + +import java.nio.*; + +import com.sun.gluegen.runtime.*; + + +class RenderingConfig32 extends RenderingConfig { + + public static int size() { + return 140; + } + + RenderingConfig32(java.nio.ByteBuffer buf) { + super(buf); + } + + + public RenderingConfig setWidth(int val) { + accessor.setIntAt(0, val); + return this; + } + + public int getWidth() { + return accessor.getIntAt(0); + } + + public RenderingConfig setHeight(int val) { + accessor.setIntAt(1, val); + return this; + } + + public int getHeight() { + return accessor.getIntAt(1); + } + + public RenderingConfig setSuperSamplingSize(int val) { + accessor.setIntAt(2, val); + return this; + } + + public int getSuperSamplingSize() { + return accessor.getIntAt(2); + } + + public RenderingConfig setActvateFastRendering(int val) { + accessor.setIntAt(3, val); + return this; + } + + public int getActvateFastRendering() { + return accessor.getIntAt(3); + } + + public RenderingConfig setEnableShadow(int val) { + accessor.setIntAt(4, val); + return this; + } + + public int getEnableShadow() { + return accessor.getIntAt(4); + } + + public RenderingConfig setMaxIterations(int val) { + accessor.setIntAt(5, val); + return this; + } + + public int getMaxIterations() { + return accessor.getIntAt(5); + } + + public RenderingConfig setEpsilon(float val) { + accessor.setFloatAt(6, val); + return this; + } + + public float getEpsilon() { + return accessor.getFloatAt(6); + } + + public RenderingConfig setMu(float[] val) { + accessor.setFloatsAt(8, val); + return this; + } + + public float[] getMu() { + return accessor.getFloatsAt(8, new float[4]); + } + + public RenderingConfig setLight(float[] val) { + accessor.setFloatsAt(12, val); + return this; + } + + public float[] getLight() { + return accessor.getFloatsAt(12, new float[3]); + } + + public Camera getCamera() { + return Camera.create(accessor.slice(64, 76)); + } +} diff --git a/src/com/mbien/opencl/demos/julia3d/structs/RenderingConfig64.java b/src/com/mbien/opencl/demos/julia3d/structs/RenderingConfig64.java new file mode 100644 index 0000000..452fbd3 --- /dev/null +++ b/src/com/mbien/opencl/demos/julia3d/structs/RenderingConfig64.java @@ -0,0 +1,109 @@ +/* !---- DO NOT EDIT: This file autogenerated by com/sun/gluegen/JavaEmitter.java on Tue Feb 09 18:20:26 CET 2010 ----! */ + + +package com.mbien.opencl.demos.julia3d.structs; + +import java.nio.*; + +import com.sun.gluegen.runtime.*; + + +class RenderingConfig64 extends RenderingConfig { + + private final Camera camera; + + public static int size() { + return 116; + } + + RenderingConfig64(java.nio.ByteBuffer buf) { + super(buf); + camera = Camera.create(accessor.slice(56, 60)); + } + + + public RenderingConfig setWidth(int val) { + accessor.setIntAt(0, val); + return this; + } + + public int getWidth() { + return accessor.getIntAt(0); + } + + public RenderingConfig setHeight(int val) { + accessor.setIntAt(1, val); + return this; + } + + public int getHeight() { + return accessor.getIntAt(1); + } + + public RenderingConfig setSuperSamplingSize(int val) { + accessor.setIntAt(2, val); + return this; + } + + public int getSuperSamplingSize() { + return accessor.getIntAt(2); + } + + public RenderingConfig setActvateFastRendering(int val) { + accessor.setIntAt(3, val); + return this; + } + + public int getActvateFastRendering() { + return accessor.getIntAt(3); + } + + public RenderingConfig setEnableShadow(int val) { + accessor.setIntAt(4, val); + return this; + } + + public int getEnableShadow() { + return accessor.getIntAt(4); + } + + public RenderingConfig setMaxIterations(int val) { + accessor.setIntAt(5, val); + return this; + } + + public int getMaxIterations() { + return accessor.getIntAt(5); + } + + public RenderingConfig setEpsilon(float val) { + accessor.setFloatAt(6, val); + return this; + } + + public float getEpsilon() { + return accessor.getFloatAt(6); + } + + public RenderingConfig setMu(float[] val) { + accessor.setFloatsAt(7, val); + return this; + } + + public float[] getMu() { + return accessor.getFloatsAt(7, new float[4]); + } + + public RenderingConfig setLight(float[] val) { + accessor.setFloatsAt(11, val); + return this; + } + + public float[] getLight() { + return accessor.getFloatsAt(11, new float[3]); + } + + public Camera getCamera() { + return camera; + } +} diff --git a/src/com/mbien/opencl/demos/julia3d/structs/Vec.java b/src/com/mbien/opencl/demos/julia3d/structs/Vec.java new file mode 100644 index 0000000..1344db4 --- /dev/null +++ b/src/com/mbien/opencl/demos/julia3d/structs/Vec.java @@ -0,0 +1,54 @@ +/* !---- DO NOT EDIT: This file autogenerated by com/sun/gluegen/JavaEmitter.java on Tue Feb 09 18:20:26 CET 2010 ----! */ + + +package com.mbien.opencl.demos.julia3d.structs; + +import java.nio.*; + +import com.sun.gluegen.runtime.*; + + +public abstract class Vec { + + StructAccessor accessor; + + public static int size() { + if (CPU.is32Bit()) { + return Vec32.size(); + } else { + return Vec64.size(); + } + } + + public static Vec create() { + return create(BufferFactory.newDirectByteBuffer(size())); + } + + public static Vec create(java.nio.ByteBuffer buf) { + if (CPU.is32Bit()) { + return new Vec32(buf); + } else { + return new Vec64(buf); + } + } + + Vec(java.nio.ByteBuffer buf) { + accessor = new StructAccessor(buf); + } + + public java.nio.ByteBuffer getBuffer() { + return accessor.getBuffer(); + } + + public abstract Vec setX(float val); + + public abstract float getX(); + + public abstract Vec setY(float val); + + public abstract float getY(); + + public abstract Vec setZ(float val); + + public abstract float getZ(); +} diff --git a/src/com/mbien/opencl/demos/julia3d/structs/Vec32.java b/src/com/mbien/opencl/demos/julia3d/structs/Vec32.java new file mode 100644 index 0000000..970dd35 --- /dev/null +++ b/src/com/mbien/opencl/demos/julia3d/structs/Vec32.java @@ -0,0 +1,48 @@ +/* !---- DO NOT EDIT: This file autogenerated by com/sun/gluegen/JavaEmitter.java on Tue Feb 09 18:20:26 CET 2010 ----! */ + + +package com.mbien.opencl.demos.julia3d.structs; + +import java.nio.*; + +import com.sun.gluegen.runtime.*; + + +class Vec32 extends Vec { + + public static int size() { + return 12; + } + + Vec32(java.nio.ByteBuffer buf) { + super(buf); + } + + + public Vec setX(float val) { + accessor.setFloatAt(0, val); + return this; + } + + public float getX() { + return accessor.getFloatAt(0); + } + + public Vec setY(float val) { + accessor.setFloatAt(1, val); + return this; + } + + public float getY() { + return accessor.getFloatAt(1); + } + + public Vec setZ(float val) { + accessor.setFloatAt(2, val); + return this; + } + + public float getZ() { + return accessor.getFloatAt(2); + } +} diff --git a/src/com/mbien/opencl/demos/julia3d/structs/Vec64.java b/src/com/mbien/opencl/demos/julia3d/structs/Vec64.java new file mode 100644 index 0000000..a52148e --- /dev/null +++ b/src/com/mbien/opencl/demos/julia3d/structs/Vec64.java @@ -0,0 +1,48 @@ +/* !---- DO NOT EDIT: This file autogenerated by com/sun/gluegen/JavaEmitter.java on Tue Feb 09 18:20:26 CET 2010 ----! */ + + +package com.mbien.opencl.demos.julia3d.structs; + +import java.nio.*; + +import com.sun.gluegen.runtime.*; + + +class Vec64 extends Vec { + + public static int size() { + return 12; + } + + Vec64(java.nio.ByteBuffer buf) { + super(buf); + } + + + public Vec setX(float val) { + accessor.setFloatAt(0, val); + return this; + } + + public float getX() { + return accessor.getFloatAt(0); + } + + public Vec setY(float val) { + accessor.setFloatAt(1, val); + return this; + } + + public float getY() { + return accessor.getFloatAt(1); + } + + public Vec setZ(float val) { + accessor.setFloatAt(2, val); + return this; + } + + public float getZ() { + return accessor.getFloatAt(2); + } +} |