mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 02:42:49 -04:00
add osx-disable-event-loop
This commit is contained in:
parent
3000263819
commit
fcb83a251e
@ -41,6 +41,13 @@ ConfigVariableBool show_resize_box
|
||||
"window would completely hide any resize control drawn by the "
|
||||
"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
|
||||
// Description: Initializes the library. This must be called at
|
||||
|
@ -26,5 +26,6 @@ NotifyCategoryDecl( osxdisplay , EXPCL_PANDAGL, EXPTP_PANDAGL);
|
||||
extern EXPCL_PANDAGL void init_libosxdisplay();
|
||||
|
||||
extern ConfigVariableBool show_resize_box;
|
||||
extern ConfigVariableBool osx_disable_event_loop;
|
||||
|
||||
#endif /* __CONFIG_OSXDISPLAY_H__ */
|
||||
|
@ -1157,21 +1157,24 @@ bool osxGraphicsWindow::OSOpenWindow(WindowProperties &req_properties)
|
||||
void osxGraphicsWindow::process_events()
|
||||
{
|
||||
GraphicsWindow::process_events();
|
||||
EventRef theEvent;
|
||||
EventTargetRef theTarget;
|
||||
theTarget = GetEventDispatcherTarget();
|
||||
|
||||
if (!_properties.has_parent_window())
|
||||
if (!osx_disable_event_loop) {
|
||||
EventRef theEvent;
|
||||
EventTargetRef theTarget;
|
||||
theTarget = GetEventDispatcherTarget();
|
||||
|
||||
if (!_properties.has_parent_window())
|
||||
{
|
||||
// while (ReceiveNextEvent(0, NULL,kEventDurationForever,true, &theEvent)== noErr)
|
||||
while (ReceiveNextEvent(0, NULL,kEventDurationNoWait,true, &theEvent)== noErr)
|
||||
{
|
||||
// cerr << "--------------------------------------------Dispatch Event " << pass++ << "\n";
|
||||
SendEventToEventTarget (theEvent, theTarget);
|
||||
ReleaseEvent(theEvent);
|
||||
// cerr << "------------------------------------Done Dispatch \n";
|
||||
}
|
||||
// while (ReceiveNextEvent(0, NULL,kEventDurationForever,true, &theEvent)== noErr)
|
||||
while (ReceiveNextEvent(0, NULL,kEventDurationNoWait,true, &theEvent)== noErr)
|
||||
{
|
||||
// cerr << "--------------------------------------------Dispatch Event " << pass++ << "\n";
|
||||
SendEventToEventTarget (theEvent, theTarget);
|
||||
ReleaseEvent(theEvent);
|
||||
// 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
|
||||
|
Loading…
x
Reference in New Issue
Block a user