Login  Register

Re: Javafx causes jogl problem in mac

Posted by runiter on Mar 07, 2013; 8:17pm
URL: https://forum.jogamp.org/Javafx-causes-jogl-problem-in-mac-tp4028417p4028546.html

Sven Gothel wrote
Our GLAutoDrawable's (GLAD) GLCanvas, GLJPanel and even GLWindow, etc,
won't realize GL resources w/ zero size.
With the above hint I managed to fix the problem by explicitly setting the size of canvas component.

I actually used to have the following code in SceneManager.java:

canvasComponent.setMinimumSize(new Dimension(500, 0));

I guess I didn't care about height at the time and only wanted to make sure the width meets the minimum. I changed it the following and it now works:

canvasComponent.setMinimumSize(new Dimension(500, 500));

Now it renders the scene without fail. Perhaps there should be an exception thrown in Canvas.init() if the canvas size is zero to hint the developers to explicitly set a size. Or event better add code in Canvas.init() to apply a small minimum size to canvas.

So, next problem is that mouse events are not capture. Does Newt use a different mechanism than regular JoglAwtCanvas for capture mouse events?
Saeid Nourian, Ph.D. Eng. | Graphing Calculator 3D