Hi there. This is weird. I’m trying to get picking working using the GL_SELECT rendermode. When I’m in fullscreen mode, each pick takes like 1 full second to process. When I’m in windowed mode it works fine, with no noticable slowdown!
I’m working on a Voodoo 3 Velocity 100 (8 Mb), but why in the world would windowed picking be faster than fullscreen?
if (mouse.rbutton)
{
glSelectBuffer (32, selectBuf);
glRenderMode(GL_SELECT);
glInitNames();
glPushName(0);
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
gluPickMatrix((GLdouble)mouse.x,(GLdouble)screenHeight-((GLdouble)mouse.y),1.0,1.0,viewport);
double z=cam.range;
double v=z/1.33333333333333333;
glOrtho(-z,z,-v,v,1,100);
glMatrixMode(GL_MODELVIEW);
map.drawTerrain2(0,0,0);
glMatrixMode(GL_PROJECTION);
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
hits = glRenderMode(GL_RENDER);
}
First I init the selection buffer. Then I set up my view volume to an area right around the cursor. drawTerrain2 is the same func I use to render my heightmapped tiles, but when picking I only draw the column of tiles the mouse cursor is on. Finally I get my old projection back and find the number of hits.
Again, when I’m windowed I can hold the right mouse button down and drag it around the screen and the selected tile gets highlighted fine, in realtime.
When I do this in fullscreen each pick takes 1 second! My fps actually drops to 1 or less!
Help!
Thanks in advance for any suggestions.
Care,
Chris
Florida, USA
RTS Engine in Development http://www.knology.net/~heaven/rts.htm