add osx-disable-event-loop

This commit is contained in:
David Rose 2007-10-01 17:34:53 +00:00
parent 3000263819
commit fcb83a251e
3 changed files with 23 additions and 12 deletions

View File

@ -41,6 +41,13 @@ ConfigVariableBool show_resize_box
"window would completely hide any resize control drawn by the " "window would completely hide any resize control drawn by the "
"OS. Set this variable false to allow this control to be hidden.")); "OS. Set this variable false to allow this control to be hidden."));
ConfigVariableBool osx_disable_event_loop
("osx-disable-event-loop", false,
PRC_DESC("Set this true to disable the window event loop for the Panda "
"windows. This makes sense only in a publish environment where "
"the window event loop is already handled by another part of the "
"app."));
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
// Function: init_libosxdisplay // Function: init_libosxdisplay
// Description: Initializes the library. This must be called at // Description: Initializes the library. This must be called at

View File

@ -26,5 +26,6 @@ NotifyCategoryDecl( osxdisplay , EXPCL_PANDAGL, EXPTP_PANDAGL);
extern EXPCL_PANDAGL void init_libosxdisplay(); extern EXPCL_PANDAGL void init_libosxdisplay();
extern ConfigVariableBool show_resize_box; extern ConfigVariableBool show_resize_box;
extern ConfigVariableBool osx_disable_event_loop;
#endif /* __CONFIG_OSXDISPLAY_H__ */ #endif /* __CONFIG_OSXDISPLAY_H__ */

View File

@ -1157,6 +1157,8 @@ bool osxGraphicsWindow::OSOpenWindow(WindowProperties &req_properties)
void osxGraphicsWindow::process_events() void osxGraphicsWindow::process_events()
{ {
GraphicsWindow::process_events(); GraphicsWindow::process_events();
if (!osx_disable_event_loop) {
EventRef theEvent; EventRef theEvent;
EventTargetRef theTarget; EventTargetRef theTarget;
theTarget = GetEventDispatcherTarget(); theTarget = GetEventDispatcherTarget();
@ -1172,6 +1174,7 @@ void osxGraphicsWindow::process_events()
// cerr << "------------------------------------Done Dispatch \n"; // cerr << "------------------------------------Done Dispatch \n";
} }
} }
}
}; };
// handle display config changes meaing we need to update the GL context via the resize function and check for windwo dimension changes // handle display config changes meaing we need to update the GL context via the resize function and check for windwo dimension changes