glut picking clashes with drawing - Printable Version
+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Graphics & Audio Programming (/forum-9.html)
+--- Thread: glut picking clashes with drawing (/thread-2802.html)
glut picking clashes with drawing - wyrmmage - Jan 23, 2008 10:51 PM
I'm using GLUT for my windowing code, and I've created a picking function using gluPickMatrix that works pretty well, most of the time. My problem is that if the user waves their mouse over the screen before it displays, the mouseMove function gets called, which then calls my picking function. This works fine, but then the screen gets drawn once or more times, and then when mouseMove (and therefore the picking function) gets called after that, the program dies. I've tracked the problem down to something within the picking function, but I'm thinking that there's probably something inherently wrong with the code I've written.
Here is the picking function:
Here is my drawing code for glut:
I can post more code if needed.
glut picking clashes with drawing - OneSadCookie - Jan 23, 2008 11:43 PM
"dies" is not helpful. What exactly happens?
Don't call glFlush, it's just a performance penalty for no benefit.
You might like glutGet(GLUT_ELAPSED_TIME) for cross-platform timing, too.
glut picking clashes with drawing - wyrmmage - Jan 24, 2008 06:39 PM
hmmm....looks like it doesn't happen on the Mac, just Windows
By 'dies' I mean it just crashes. I've tried to debug it, but the debugger is being incredibly unhelpful and giving me the error message: 'SIGSEGV, Segmentation fault. 0x693f730c in atioglxx!atiPPHSN () from C:\Windows\system32\atioglxx.dll
I'm no Windows wizard, but I'm guessing that its dying in opengl somewhere? Lost as to to where I should go from here, though
Anyway, sorry about the post since it's not really Mac related. I think I'll leave it alone for now and try to fix it eventually.