1

I have a problem with JOGL. I`d like to create two windows. One with a GLCanvas and another one with something else. Every time I call setVisible() of another frame before calling setVisible() of the frame where I added the canvas. When resizing I get only a white window.

GLProfile profile = GLProfile.get(GLProfile.GL2);
GLCapabilities capabilities = new GLCapabilities(profile);
GLCanvas canvas = new GLCanvas(capabilities);
JFrame f2 = new JFrame();
f2.setSize(500, 500);
JFrame f = new JFrame();
f.setSize(500, 500);
canvas.setVisible(true);
f.add(canvas);
f2.setVisible(true);
f.setVisible(true);
f.pack();

If I change

f2.setVisible(true);
f.setVisible(true);

to

f.setVisible(true);
f2.setVisible(true);

everything works and I get my black window even after rescaling it.

Thank you for your help

Kanteran
  • 80
  • 8
  • Which version of JOGL do you use? Don't tell me "I use the latest", indicate precisely which version you use, follow these instructions to fill a bug report: http://jogamp.org/wiki/index.php/Jogl_FAQ#Bugreports_.26_Testing – gouessej Apr 01 '15 at 07:19
  • Oh, I will test it with a new Version I use "2.2.4" at the moment. Thank you for your help. – Kanteran Apr 01 '15 at 10:14
  • The latest version is (currently, April 1st 2015) the version 2.3.1. – gouessej Apr 01 '15 at 10:15
  • Ok, I tested it with 2.3.1 and got the same issue but it was a bit more random. (it fails even sometimes in the second case, first f.setVisible() and then f2.setVisible()) – Kanteran Apr 01 '15 at 10:50
  • Ok. Therefore, you should fill a bug report. – gouessej Apr 01 '15 at 14:15
  • You're welcome. We'll take your report into consideration. I hope that there is only something trivial to modify. – gouessej Apr 03 '15 at 11:40
  • Sorry for my dumb question. Do you use an animator? Please look at my example here: https://gist.github.com/gouessej/3420e2b6f632efdddf98 – gouessej Apr 07 '15 at 08:44
  • In this example I didn't use one but I got the effect with one too. – Kanteran Apr 07 '15 at 15:03
  • Why do you use GL and GL2 in your code? You could use GL2 instead of GL. Or is there a difference between the final values? – Kanteran Apr 07 '15 at 15:09
  • Have you filled a bug report? Using the most general GL interface is a good practice as it allows your code to work on more machines. Imagine that you use GL2 instead of GL2ES2, your code will work only on GL2 whereas it might work on ES2 too. Using GL2 everywhere is a bad practice inspired by some APIs with a debatable design that are rarely used to write some code common to OpenGL and OpenGL ES. – gouessej Apr 08 '15 at 10:19

0 Answers0