summaryrefslogtreecommitdiffstats
path: root/src/demos/gears/Gears.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-06-06 19:56:03 +0200
committerSven Gothel <[email protected]>2014-06-06 19:56:03 +0200
commit548fee0b3d65605ff5cbcbe750564eda1bc611d7 (patch)
tree5057236c8578ebdd17b16893cb4e82b56edbf23e /src/demos/gears/Gears.java
parent6ee1f0641fbefbb309217401708e61d0c7f248e9 (diff)
Adapt to JOGL commit ebe980ad6ac40148bc84913d1ba1f7adf6200490 (Bug 741 HiDPI)
AWTMouseAdapter and AWTMouseAdapter ctor have been changed ..
Diffstat (limited to 'src/demos/gears/Gears.java')
-rw-r--r--src/demos/gears/Gears.java15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/demos/gears/Gears.java b/src/demos/gears/Gears.java
index b477ffc..51c118d 100644
--- a/src/demos/gears/Gears.java
+++ b/src/demos/gears/Gears.java
@@ -32,7 +32,6 @@ private final float view_rotz = 0.0f;
private float angle = 0.0f;
private final int swapInterval;
- private boolean mouseRButtonDown = false;
private int prevMouseX, prevMouseY;
public static void main(String[] args) {
@@ -178,8 +177,8 @@ public void init(GLAutoDrawable drawable) {
window.addKeyListener(gearsKeys);
} else if (GLProfile.isAWTAvailable() && drawable instanceof java.awt.Component) {
java.awt.Component comp = (java.awt.Component) drawable;
- new AWTMouseAdapter(gearsMouse).addTo(comp);
- new AWTKeyAdapter(gearsKeys).addTo(comp);
+ new AWTMouseAdapter(gearsMouse, drawable).addTo(comp);
+ new AWTKeyAdapter(gearsKeys, drawable).addTo(comp);
}
}
@@ -398,22 +397,16 @@ public void display(GLAutoDrawable drawable) {
public void mousePressed(MouseEvent e) {
prevMouseX = e.getX();
prevMouseY = e.getY();
- if ((e.getModifiers() & e.BUTTON3_MASK) != 0) {
- mouseRButtonDown = true;
- }
}
@Override
public void mouseReleased(MouseEvent e) {
- if ((e.getModifiers() & e.BUTTON3_MASK) != 0) {
- mouseRButtonDown = false;
- }
}
@Override
public void mouseDragged(MouseEvent e) {
- int x = e.getX();
- int y = e.getY();
+ final int x = e.getX();
+ final int y = e.getY();
int width=0, height=0;
Object source = e.getSource();
if(source instanceof Window) {