aboutsummaryrefslogtreecommitdiffstats
path: root/src/com/jogamp/opencl/demos/julia3d/Renderer.java
diff options
context:
space:
mode:
authorMichael Bien <[email protected]>2011-02-04 01:02:06 +0100
committerMichael Bien <[email protected]>2011-02-04 01:02:06 +0100
commit18d1f903dc7cb436956e4f0c09cfb0ce0278bafa (patch)
treeb6d71dd9c51cf9e5bdd5b7524a6d8df4873c5881 /src/com/jogamp/opencl/demos/julia3d/Renderer.java
parentdbe93d1e40a7bc9fbea7c5be3d59bf84e8a20ecb (diff)
- fixed bug in julia3d demo when epsilon is 0
- better device choice - cleanup
Diffstat (limited to 'src/com/jogamp/opencl/demos/julia3d/Renderer.java')
-rw-r--r--src/com/jogamp/opencl/demos/julia3d/Renderer.java29
1 files changed, 7 insertions, 22 deletions
diff --git a/src/com/jogamp/opencl/demos/julia3d/Renderer.java b/src/com/jogamp/opencl/demos/julia3d/Renderer.java
index 6fe2309..4713b2d 100644
--- a/src/com/jogamp/opencl/demos/julia3d/Renderer.java
+++ b/src/com/jogamp/opencl/demos/julia3d/Renderer.java
@@ -1,13 +1,9 @@
package com.jogamp.opencl.demos.julia3d;
-import com.jogamp.opencl.CLDevice;
import com.jogamp.opencl.demos.julia3d.structs.RenderingConfig;
import com.jogamp.opengl.util.awt.TextRenderer;
-import java.awt.Dimension;
+import java.awt.Canvas;
import java.awt.Font;
-import java.awt.event.WindowAdapter;
-import java.awt.event.WindowEvent;
-import java.awt.event.WindowListener;
import java.nio.FloatBuffer;
import java.util.Timer;
import java.util.TimerTask;
@@ -17,7 +13,6 @@ import javax.media.opengl.GLCapabilities;
import javax.media.opengl.GLEventListener;
import javax.media.opengl.GLProfile;
import javax.media.opengl.awt.GLCanvas;
-import javax.swing.JFrame;
import static com.jogamp.common.nio.Buffers.*;
import static javax.media.opengl.GL2.*;
@@ -42,6 +37,7 @@ public class Renderer implements GLEventListener {
private final Timer timer;
public Renderer(final Julia3d julia3d) {
+
this.julia3d = julia3d;
this.config = julia3d.config;
@@ -55,23 +51,8 @@ public class Renderer implements GLEventListener {
usi = new UserSceneController();
usi.init(this, canvas, config);
- CLDevice device = julia3d.getDevice();
- JFrame frame = new JFrame("Java OpenCL - Julia3D "+device.getType()+" "+device.getName());
- frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
- frame.addWindowListener(new WindowAdapter() {
- @Override
- public void windowClosed(WindowEvent e) {
- julia3d.release();
- System.exit(0);
- }
- });
- canvas.setPreferredSize(new Dimension(config.getWidth(), config.getHeight()));
- frame.add(canvas);
- frame.pack();
-
- textRenderer = new TextRenderer(frame.getFont().deriveFont(Font.BOLD, 14), true, true, null, false);
+ textRenderer = new TextRenderer(new Font("Helvetica", Font.BOLD, 14), true, true, null, false);
- frame.setVisible(true);
}
public void init(GLAutoDrawable drawable) {
@@ -211,5 +192,9 @@ public class Renderer implements GLEventListener {
public void dispose(GLAutoDrawable drawable) {
}
+ public Canvas getCanvas() {
+ return canvas;
+ }
+
}