aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/mbien
diff options
context:
space:
mode:
authorMichael Bien <[email protected]>2010-03-27 03:05:12 +0100
committerMichael Bien <[email protected]>2010-03-27 03:05:12 +0100
commit446e292511a2315702ba608a082ac3a66154c1a8 (patch)
tree396920dcd8aa04cd023cddf632d95ddf86194321 /src/com/mbien
parent2c230d8e774653c68905b5817c935c405ba1b548 (diff)
refactoring due to gluegen changes.
- renamed com.sun.gluegen.runtime -> com.jogamp.gluegen.runtime.
Diffstat (limited to 'src/com/mbien')
-rw-r--r--src/com/mbien/opencl/demos/fractal/MultiDeviceFractal.java33
-rw-r--r--src/com/mbien/opencl/demos/julia3d/structs/Camera.java2
-rw-r--r--src/com/mbien/opencl/demos/julia3d/structs/Camera32.java2
-rw-r--r--src/com/mbien/opencl/demos/julia3d/structs/Camera64.java2
-rw-r--r--src/com/mbien/opencl/demos/julia3d/structs/RenderingConfig.java2
-rw-r--r--src/com/mbien/opencl/demos/julia3d/structs/RenderingConfig32.java2
-rw-r--r--src/com/mbien/opencl/demos/julia3d/structs/RenderingConfig64.java2
-rw-r--r--src/com/mbien/opencl/demos/julia3d/structs/Vec.java2
-rw-r--r--src/com/mbien/opencl/demos/julia3d/structs/Vec32.java2
-rw-r--r--src/com/mbien/opencl/demos/julia3d/structs/Vec64.java2
10 files changed, 29 insertions, 22 deletions
diff --git a/src/com/mbien/opencl/demos/fractal/MultiDeviceFractal.java b/src/com/mbien/opencl/demos/fractal/MultiDeviceFractal.java
index 5c89ad8..6732a79 100644
--- a/src/com/mbien/opencl/demos/fractal/MultiDeviceFractal.java
+++ b/src/com/mbien/opencl/demos/fractal/MultiDeviceFractal.java
@@ -9,6 +9,7 @@ import com.mbien.opencl.CLException;
import com.mbien.opencl.gl.CLGLBuffer;
import com.mbien.opencl.gl.CLGLContext;
import com.mbien.opencl.CLKernel;
+import com.mbien.opencl.CLPlatform;
import com.mbien.opencl.CLProgram;
import com.mbien.opencl.CLProgram.CompilerOptions;
import com.sun.opengl.util.awt.TextRenderer;
@@ -37,7 +38,7 @@ import javax.media.opengl.awt.GLCanvas;
import javax.swing.JFrame;
import javax.swing.SwingUtilities;
-import static com.sun.gluegen.runtime.BufferFactory.*;
+import static com.jogamp.gluegen.runtime.BufferFactory.*;
import static javax.media.opengl.GL2.*;
import static com.mbien.opencl.CLMemory.Mem.*;
import static com.mbien.opencl.CLEvent.ProfilingCommand.*;
@@ -115,28 +116,34 @@ public class MultiDeviceFractal implements GLEventListener {
public void init(GLAutoDrawable drawable) {
- // enable GL error checking using the composable pipeline
- drawable.setGL(new DebugGL2(drawable.getGL().getGL2()));
+ if(clContext == null) {
+ // enable GL error checking using the composable pipeline
+ drawable.setGL(new DebugGL2(drawable.getGL().getGL2()));
- drawable.getGL().glFinish();
- initCL(drawable.getContext());
+ drawable.getGL().glFinish();
+ initCL(drawable.getContext());
- GL2 gl = drawable.getGL().getGL2();
+ GL2 gl = drawable.getGL().getGL2();
- gl.setSwapInterval(0);
- gl.glDisable(GL_DEPTH_TEST);
- gl.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
+ gl.setSwapInterval(0);
+ gl.glDisable(GL_DEPTH_TEST);
+ gl.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
- initView(gl, drawable.getWidth(), drawable.getHeight());
+ initView(gl, drawable.getWidth(), drawable.getHeight());
- initPBO(gl);
- setKernelConstants();
+ initPBO(gl);
+ drawable.getGL().glFinish();
+
+ setKernelConstants();
+ }
}
private void initCL(GLContext glCtx){
try {
// create context managing all available GPUs
- clContext = CLGLContext.create(glCtx, GPU);
+// clContext = CLGLContext.create(glCtx, GPU);
+ clContext = CLGLContext.create(glCtx, CLPlatform.getDefault().listCLDevices()[0]);
+
CLDevice[] devices = clContext.getDevices();
diff --git a/src/com/mbien/opencl/demos/julia3d/structs/Camera.java b/src/com/mbien/opencl/demos/julia3d/structs/Camera.java
index d6d647b..2263a2c 100644
--- a/src/com/mbien/opencl/demos/julia3d/structs/Camera.java
+++ b/src/com/mbien/opencl/demos/julia3d/structs/Camera.java
@@ -5,7 +5,7 @@ package com.mbien.opencl.demos.julia3d.structs;
import java.nio.*;
-import com.sun.gluegen.runtime.*;
+import com.jogamp.gluegen.runtime.*;
public abstract class Camera {
diff --git a/src/com/mbien/opencl/demos/julia3d/structs/Camera32.java b/src/com/mbien/opencl/demos/julia3d/structs/Camera32.java
index 2d09540..85dea51 100644
--- a/src/com/mbien/opencl/demos/julia3d/structs/Camera32.java
+++ b/src/com/mbien/opencl/demos/julia3d/structs/Camera32.java
@@ -5,7 +5,7 @@ package com.mbien.opencl.demos.julia3d.structs;
import java.nio.*;
-import com.sun.gluegen.runtime.*;
+import com.jogamp.gluegen.runtime.*;
class Camera32 extends Camera {
diff --git a/src/com/mbien/opencl/demos/julia3d/structs/Camera64.java b/src/com/mbien/opencl/demos/julia3d/structs/Camera64.java
index fe5a729..afe4acd 100644
--- a/src/com/mbien/opencl/demos/julia3d/structs/Camera64.java
+++ b/src/com/mbien/opencl/demos/julia3d/structs/Camera64.java
@@ -5,7 +5,7 @@ package com.mbien.opencl.demos.julia3d.structs;
import java.nio.*;
-import com.sun.gluegen.runtime.*;
+import com.jogamp.gluegen.runtime.*;
class Camera64 extends Camera {
diff --git a/src/com/mbien/opencl/demos/julia3d/structs/RenderingConfig.java b/src/com/mbien/opencl/demos/julia3d/structs/RenderingConfig.java
index a5b0531..d488dce 100644
--- a/src/com/mbien/opencl/demos/julia3d/structs/RenderingConfig.java
+++ b/src/com/mbien/opencl/demos/julia3d/structs/RenderingConfig.java
@@ -5,7 +5,7 @@ package com.mbien.opencl.demos.julia3d.structs;
import java.nio.*;
-import com.sun.gluegen.runtime.*;
+import com.jogamp.gluegen.runtime.*;
public abstract class RenderingConfig {
diff --git a/src/com/mbien/opencl/demos/julia3d/structs/RenderingConfig32.java b/src/com/mbien/opencl/demos/julia3d/structs/RenderingConfig32.java
index ec32613..3898d60 100644
--- a/src/com/mbien/opencl/demos/julia3d/structs/RenderingConfig32.java
+++ b/src/com/mbien/opencl/demos/julia3d/structs/RenderingConfig32.java
@@ -5,7 +5,7 @@ package com.mbien.opencl.demos.julia3d.structs;
import java.nio.*;
-import com.sun.gluegen.runtime.*;
+import com.jogamp.gluegen.runtime.*;
class RenderingConfig32 extends RenderingConfig {
diff --git a/src/com/mbien/opencl/demos/julia3d/structs/RenderingConfig64.java b/src/com/mbien/opencl/demos/julia3d/structs/RenderingConfig64.java
index 452fbd3..e3a0267 100644
--- a/src/com/mbien/opencl/demos/julia3d/structs/RenderingConfig64.java
+++ b/src/com/mbien/opencl/demos/julia3d/structs/RenderingConfig64.java
@@ -5,7 +5,7 @@ package com.mbien.opencl.demos.julia3d.structs;
import java.nio.*;
-import com.sun.gluegen.runtime.*;
+import com.jogamp.gluegen.runtime.*;
class RenderingConfig64 extends RenderingConfig {
diff --git a/src/com/mbien/opencl/demos/julia3d/structs/Vec.java b/src/com/mbien/opencl/demos/julia3d/structs/Vec.java
index 9e4cf44..be2efc7 100644
--- a/src/com/mbien/opencl/demos/julia3d/structs/Vec.java
+++ b/src/com/mbien/opencl/demos/julia3d/structs/Vec.java
@@ -5,7 +5,7 @@ package com.mbien.opencl.demos.julia3d.structs;
import java.nio.*;
-import com.sun.gluegen.runtime.*;
+import com.jogamp.gluegen.runtime.*;
public abstract class Vec {
diff --git a/src/com/mbien/opencl/demos/julia3d/structs/Vec32.java b/src/com/mbien/opencl/demos/julia3d/structs/Vec32.java
index 970dd35..3c0ee5d 100644
--- a/src/com/mbien/opencl/demos/julia3d/structs/Vec32.java
+++ b/src/com/mbien/opencl/demos/julia3d/structs/Vec32.java
@@ -5,7 +5,7 @@ package com.mbien.opencl.demos.julia3d.structs;
import java.nio.*;
-import com.sun.gluegen.runtime.*;
+import com.jogamp.gluegen.runtime.*;
class Vec32 extends Vec {
diff --git a/src/com/mbien/opencl/demos/julia3d/structs/Vec64.java b/src/com/mbien/opencl/demos/julia3d/structs/Vec64.java
index a52148e..5952021 100644
--- a/src/com/mbien/opencl/demos/julia3d/structs/Vec64.java
+++ b/src/com/mbien/opencl/demos/julia3d/structs/Vec64.java
@@ -5,7 +5,7 @@ package com.mbien.opencl.demos.julia3d.structs;
import java.nio.*;
-import com.sun.gluegen.runtime.*;
+import com.jogamp.gluegen.runtime.*;
class Vec64 extends Vec {