Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (491)
Games in Android Showcase (112)
games submitted by our members
Games in WIP (556)
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
Hi,

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.

Thanks!
Corey
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):
      https://jogl.dev.java.net/issues/show_bug.cgi?id=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...

Thanks,
Corey


   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);
   
      resetProjection(drawable);

      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
      gl.glMatrixMode(GL.GL_PROJECTION);

      // Reset The Projection Matrix
      gl.glLoadIdentity();

      // Calculate The Aspect Ratio Of The Window
      System.out.println("Viewport: " + (int)width + ", " + (int)height);
      gl.glViewport(0,0,(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
      gl.glMatrixMode(GL.GL_MODELVIEW);
      gl.glLoadIdentity();

      // Reset the Camera
      myCamera.restorePerspective();
      myCamera.setCamera(this);
   }
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
Hi,

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?

Thanks,
Corey

import java.awt.*;
import java.awt.event.*;
import javax.media.opengl.*;
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);
      frame.setVisible(true);
   }

   public static void main(String[] args) {
      final DialogTest dialogTest = new DialogTest();
      SwingUtilities.invokeLater(new Runnable() {
         public void run() {
            dialogTest.init();
         }
      });
   }
}
Pages: [1]
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Nickropheliac (15 views)
2014-08-31 22:59:12

TehJavaDev (23 views)
2014-08-28 18:26:30

CopyableCougar4 (29 views)
2014-08-22 19:31:30

atombrot (41 views)
2014-08-19 09:29:53

Tekkerue (39 views)
2014-08-16 06:45:27

Tekkerue (35 views)
2014-08-16 06:22:17

Tekkerue (25 views)
2014-08-16 06:20:21

Tekkerue (36 views)
2014-08-16 06:12:11

Rayexar (72 views)
2014-08-11 02:49:23

BurntPizza (49 views)
2014-08-09 21:09:32
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org 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‑gaming.org
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!