Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (707)
Games in Android Showcase (207)
games submitted by our members
Games in WIP (781)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Java Game APIs & Engines / JInput / 2D scrolling with PowerBook/MacBook trackpad or Mighty Mouse? on: 2006-05-27 19:48:37

I would like to support two-dimensional scrolling with the Mighty Mouse trackball and the PowerBook scrolling trackpad, but I cannot figure out how to do it.

I tried to use AWT event handlers, but Apple's JRE only posts MouseWheelEvents for the vertical scroll component, and the listener is completely idle when only the horizontal component is non-zero.

(It'd be great if I could also provide cross-platform support for those PC mice that support horizontal scrolling action as well by rocking the mouse wheel right or left, but I can do without that for now.)

When i ran the controller test, I noticed that the "Apple Optical Mouse" has a Z axis that is controlled by horizontal movement on the trackball, but there is no axis to detect vertical motion (i.e. typical mouse wheel events).  For the internal keyboard/trackpad, JInput could detect X and Y finger movement, but there was nothing to indicate whether the user had one finger down (mouse movement) vs. two fingers down (scrolling).

If there's a way to make this work using JInput, I'd really appreciate your help.

2  Java Game APIs & Engines / JOGL Development / Resize GLCanvas freezes 15" PowerBook on: 2006-01-25 04:26:10
Hi, I am encountering a bug wherby resizing a GLCanvas in a JFrame results in my 15" PowerBook with ATI Radeon 9700 to freeze completely.  I can't command-tab to a different app, I can't access the dashboard, expose, or the dock, and my application does not respond to input from the mouse or keyboard.  Sometimes the mouse pointer moves for a short time, but eventually that freezes too.  Ultimately, I have to do a hard reboot.

I am running MacOS X 10.4.4 with Java 1.5 Release 4 Preview and JSR 231 beta 2.  Reverting back to JOGL 1.1.1 I do not experience the problem.

I have been unsuccessful at producing a small test program that causes a crash, and every demo I've tried works fine too.  I know that's not particularly helpful, but there was one old issue that seemed very similar (Issue 67):
but I can't figure out why switching from JOGL 1.1.1 to JSR 231 would suddenly cause me to experience a similar issue, and I thought perhaps someone might have an idea for me to try.

Here's a copy of the reshape method, which gets called every time a resize occurs; however, I can't reliably break inside the method, which leads me to believe the error is caused on another thread, but I have no idea how or where yet.  I know it's not enough to run or test, but if you see something suspicious in it that could lead to problems, please let me know as well...


   public void reshape(GLAutoDrawable drawable, int x, int y, int width, int height)
      gl = drawable.getGL();
      //glu = drawable.getGLU();
      gl.glViewport(x, y, width, height);

      mapView.setPosition(15, height - 125);
      updateNow = true;

   /** In case window changes shape */
   void resetProjection(GLAutoDrawable drawable)
      if(width<0||height<0) return;
      gl = drawable.getGL();
      //glu = drawable.getGLU();
      // Select The Projection Matrix

      // Reset The Projection Matrix

      // Calculate The Aspect Ratio Of The Window
      System.out.println("Viewport: " + (int)width + ", " + (int)height);
      System.out.println("Perspective: " + (float)width / (float)height + ", " + depth);
      glu.gluPerspective(30.0f, (float)width / (float)height, 0.1f, depth);
      // Select The Modelview Matrix

      // Reset the Camera
3  Java Game APIs & Engines / JOGL Development / Re: Modal JDialogs disappear in presence of GLCanvas on: 2006-01-19 22:53:48
Ken, upgrading from Release 3 to Release 4 preview fixed my bug.  Sorry I didn't notice that bug report first.  Thanks for your help!
4  Java Game APIs & Engines / JOGL Development / Modal JDialogs disappear in presence of GLCanvas on: 2006-01-19 19:59:39

I am working on a multi-frame application that includes the use of a GLCanvas inside a JFrame.  When a modal JDialog is made visible, it renders until the user moves the mouse or presses a key, at which point it vanishes.  The only way to get it back is pressing Command-tilde until it reappears.

I am running MacOS X 10.4.4 and Java 1.5 Release 3.  I think it used to work with Release 1 and 2, but I have not yet had an opportunity to test it.  The problem exists for both JOGL 1.1.1 (and earlier) as well as the latest beta release of JSR 231.  The problem does not exist on Windows XP or Linux.

I developed a small test program that demonstrates the bug.  When the GLCanvas "gl" is in the JFrame, the dialog invoked by the JButton disappears.  It does not matter whether the dialog's parent is the frame itself, the hidden "null" JFrame, or some other Window.  Swap in the GLJPanel gl2, and the dialog problem does not occur.

Anyone aware of this problem, whether it's a bug in JOGL, and if there are any workarounds?


import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class DialogTest {
   public void init() {
      GLCanvas gl = new GLCanvas();
      GLJPanel gl2 = new GLJPanel();
      final JFrame frame = new JFrame("Test");
      frame.setLayout(new BorderLayout());
      frame.add(gl, BorderLayout.CENTER); // SWITCH BETWEEN GL & GL2 TO SEE EFFECT.
      JButton button = new JButton("Dialog");
      frame.add(button, BorderLayout.SOUTH);
      button.addActionListener(new ActionListener() {
         public void actionPerformed(ActionEvent e) {
            new JDialog(frame, true).setVisible(true);
      frame.setBounds(100, 100, 500, 500);

   public static void main(String[] args) {
      final DialogTest dialogTest = new DialogTest();
      SwingUtilities.invokeLater(new Runnable() {
         public void run() {
Pages: [1]
Galdo (333 views)
2017-01-12 13:44:09

Archive (490 views)
2017-01-02 05:31:41

0AndrewShepherd0 (952 views)
2016-12-16 03:58:39

0AndrewShepherd0 (891 views)
2016-12-15 21:50:57

Lunch (1023 views)
2016-12-06 16:01:40

ral0r2 (1256 views)
2016-11-23 16:08:26

ClaasJG (1353 views)
2016-11-10 17:36:32

CoffeeChemist (1364 views)
2016-11-05 00:46:53

jay4842 (1448 views)
2016-11-01 19:04:52

theagentd (1231 views)
2016-10-24 17:51:53
List of Learning Resources
by elect
2016-09-09 09:47:55

List of Learning Resources
by elect
2016-09-08 09:47:20

List of Learning Resources
by elect
2016-09-08 09:46:51

List of Learning Resources
by elect
2016-09-08 09:46:27

List of Learning Resources
by elect
2016-09-08 09:45:41

List of Learning Resources
by elect
2016-09-08 08:39:20

List of Learning Resources
by elect
2016-09-08 08:38:19

Rendering resources
by Roquen
2016-08-08 05:55:21 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!