summaryrefslogtreecommitdiffstats
path: root/src/com/jogamp/opencl/demos/fractal
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-05-27 10:41:33 +0200
committerSven Gothel <[email protected]>2014-05-27 10:41:33 +0200
commit9e954259d99d642dab1aae5763ce8e34c855706c (patch)
tree48f68e1d98d72103ef507ed205753c6290f8c2bf /src/com/jogamp/opencl/demos/fractal
parentdc751bd15979b641e05ea6d47a3f980fa0c23955 (diff)
Adapt to JOGL HiDPI (Bug 741) changes up-to commit bcda2dad1a6569ffd4eba07b231d50fdafc60b7fv2.2.4v2.2.3v2.2.2v2.2.1v2.2.0b22x
Diffstat (limited to 'src/com/jogamp/opencl/demos/fractal')
-rw-r--r--src/com/jogamp/opencl/demos/fractal/MultiDeviceFractal.java18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/com/jogamp/opencl/demos/fractal/MultiDeviceFractal.java b/src/com/jogamp/opencl/demos/fractal/MultiDeviceFractal.java
index 0cbb340..51c40ec 100644
--- a/src/com/jogamp/opencl/demos/fractal/MultiDeviceFractal.java
+++ b/src/com/jogamp/opencl/demos/fractal/MultiDeviceFractal.java
@@ -71,7 +71,7 @@ public class MultiDeviceFractal implements GLEventListener {
// max per pixel iterations to compute the fractal
private static final int MAX_ITERATIONS = 500;
- private GLCanvas canvas;
+ private final GLCanvas canvas;
private CLGLContext clContext;
private CLCommandQueue[] queues;
@@ -113,7 +113,7 @@ public class MultiDeviceFractal implements GLEventListener {
public void windowClosing(WindowEvent e) {
MultiDeviceFractal.this.release(e.getWindow());
}
- });
+ });
canvas.setPreferredSize(new Dimension(width, height));
frame.add(canvas);
frame.pack();
@@ -139,7 +139,7 @@ public class MultiDeviceFractal implements GLEventListener {
gl.glDisable(GL_DEPTH_TEST);
gl.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
- initView(gl, drawable.getWidth(), drawable.getHeight());
+ initView(gl, drawable.getSurfaceWidth(), drawable.getSurfaceHeight());
initPBO(gl);
drawable.getGL().glFinish();
@@ -219,7 +219,7 @@ public class MultiDeviceFractal implements GLEventListener {
}
private void initColorMap(IntBuffer colorMap, int stepSize, Color... colors) {
-
+
for (int n = 0; n < colors.length - 1; n++) {
Color color = colors[n];
@@ -453,7 +453,7 @@ public class MultiDeviceFractal implements GLEventListener {
setKernelConstants();
initView(drawable.getGL().getGL2(), width, height);
-
+
}
private void initSceneInteraction() {
@@ -464,7 +464,7 @@ public class MultiDeviceFractal implements GLEventListener {
@Override
public void mouseDragged(MouseEvent e) {
-
+
double offsetX = (lastpos.x - e.getX()) * (maxX - minX) / width;
double offsetY = (lastpos.y - e.getY()) * (maxY - minY) / height;
@@ -484,7 +484,7 @@ public class MultiDeviceFractal implements GLEventListener {
public void mouseMoved(MouseEvent e) {
lastpos = e.getPoint();
}
-
+
@Override
public void mouseWheelMoved(MouseWheelEvent e) {
float rotation = e.getWheelRotation() / 25.0f;
@@ -548,9 +548,9 @@ public class MultiDeviceFractal implements GLEventListener {
}
public static void main(String args[]) {
-
+
GLProfile.initSingleton();
-
+
SwingUtilities.invokeLater(new Runnable() {
@Override public void run() {
new MultiDeviceFractal(512, 512);