Hello,
Passing from XP to Vista is now quite OK for my JOGL application unless when I am processing picking on my GLJPanel or on my GLCanvas.
When a clik is mage on one of these components, I call this following code to know on which object the click was made :
IntBuffer buffer = BufferUtil.newIntBuffer(512);
int hits; // The Number Of Objects That We Selected
int[] viewport = new int[4];
// This Sets The Array To The Size And Location Of The Screen
// Relative To The Window
gl.glGetIntegerv(GL.GL_VIEWPORT, IntBuffer.wrap(viewport));
gl.glSelectBuffer(512, buffer); // Tell OpenGL To Use Our Array For Selection
// Puts OpenGL In Selection Mode. Nothing Will Be Drawn. Object ID’s and
// Extents Are Stored In The Buffer.
gl.glRenderMode(GL.GL_SELECT);
gl.glInitNames(); // Initializes The Name Stack
gl.glPushName(0); // Push 0 (At Least One Entry) Onto The Stack
gl.glMatrixMode(GL.GL_PROJECTION); // Selects The Projection Matrix
gl.glPushMatrix(); // Push The Projection Matrix
gl.glLoadIdentity(); // Resets The Matrix
// This Creates A Matrix That Will Zoom Up To A Small Portion Of The
// Screen, Where The Mouse Is.
glu.gluPickMatrix((double) mouse_x, (double) (viewport[3] - mouse_y), 2.0f, 10.0f, IntBuffer.wrap(viewport));
// Apply The Perspective Matrix
// glu.gluPerspective(45.0f, (float) viewport[2] / (float)viewport[3],
// 0.1f, 100.0f); // Calculate The Aspect Ratio Of The Window
projectionManager.applyTransformationMatrix(gl, glu, viewport);
gl.glMatrixMode(GL.GL_MODELVIEW); // Select The Modelview Matrix
gl.glCallList(scene);// Render The Targets To The Selection Buffer
gl.glMatrixMode(GL.GL_PROJECTION); // Select The Projection Matrix
gl.glPopMatrix(); // Pop The Projection Matrix
gl.glMatrixMode(GL.GL_MODELVIEW); // Select The Modelview Matrix
int cont[] = new int[1];
gl.glGetIntegerv(GL.GL_NAME_STACK_DEPTH, IntBuffer.wrap(cont));
hits = gl.glRenderMode(GL.GL_RENDER); // Switch To Render Mode,
This is the line gl.glCallList(scene) that takes a very long time to execute under Vista whereas it was very quick under XP. I don’t know if it comes from my new graphic card (ATI Radeon X1300PRO with the latest driver), but I don’t think so, because my display loop is faster with Vista and this new graphic card than with XP.
I can’t understand why gl.glCallList(…) can be so slow when I call the previous code for a selection whereas it can be called more than 350 times per second for the same scene in my display loop??
Thanks for your help.