How do I assign mouse input to the proper window with multiple GLX windows?
March 22, 2007 9:19 PM Subscribe
How do I assign mouse input to the proper window with multiple GLX windows?
Hello,
I am programming an application that can render to several possible types of windows (GLUT, MFC, etc.) depending on platform. It is configured so that multiple windows can be displayed simultaneously.
I am having some trouble adding GLX window support under Linux. I can set up multiple windows and display different content on each: that works just fine. But if someone clicks on a window, I don't know how to assign the click to the proper window (though I can register its location in x, y coords). I'm having a hard time finding documentation (or a tutorial) that helps with this issue. Does anyone know where I can find some good information online?
For now, all of the windows are on the same display.
Also, it is important that this be done with GLX windows, so please do not suggest that I just use GLUT and be done with it.
Thank you.
Hello,
I am programming an application that can render to several possible types of windows (GLUT, MFC, etc.) depending on platform. It is configured so that multiple windows can be displayed simultaneously.
I am having some trouble adding GLX window support under Linux. I can set up multiple windows and display different content on each: that works just fine. But if someone clicks on a window, I don't know how to assign the click to the proper window (though I can register its location in x, y coords). I'm having a hard time finding documentation (or a tutorial) that helps with this issue. Does anyone know where I can find some good information online?
For now, all of the windows are on the same display.
Also, it is important that this be done with GLX windows, so please do not suggest that I just use GLUT and be done with it.
Thank you.
Response by poster: I should have specified that--despite my handle--this is all being implemented in C++.
posted by Java_Man at 5:05 AM on March 23, 2007
posted by Java_Man at 5:05 AM on March 23, 2007
Best answer: There's a field called 'window' in most X event structures, such as XButtonEvent and XMotionEvent. Use it.
posted by jepler at 7:58 AM on March 23, 2007
posted by jepler at 7:58 AM on March 23, 2007
This thread is closed to new comments.
posted by paulsc at 11:06 PM on March 22, 2007