diff --git a/direct/src/showbase/ShowBase.py b/direct/src/showbase/ShowBase.py index b80931c597..7bfe5ed5c3 100644 --- a/direct/src/showbase/ShowBase.py +++ b/direct/src/showbase/ShowBase.py @@ -62,6 +62,7 @@ from panda3d.core import ( DepthTestAttrib, DepthWriteAttrib, DriveInterface, + EventQueue, ExecutionEnvironment, Filename, FisheyeMaker, @@ -114,7 +115,7 @@ from panda3d.core import ( WindowProperties, getModelPath, ) -from panda3d.direct import throw_new_frame, init_app_for_gui +from panda3d.direct import init_app_for_gui from panda3d.direct import storeAccessibilityShortcutKeys, allowAccessibilityShortcutKeys from . import DConfig @@ -2284,9 +2285,8 @@ class ShowBase(DirectObject.DirectObject): # now until someone complains. time.sleep(0.1) - # Lerp stuff needs this event, and it must be generated in - # C++, not in Python. - throw_new_frame() + # Lerp stuff needs this event, thrown directly on the C++ queue. + EventQueue.getGlobalEventQueue().queueEvent("NewFrame") return Task.cont def __igLoopSync(self, state: object) -> int: @@ -2332,9 +2332,8 @@ class ShowBase(DirectObject.DirectObject): self.cluster.waitForFlipCommand() self.graphicsEngine.flipFrame() - # Lerp stuff needs this event, and it must be generated in - # C++, not in Python. - throw_new_frame() + # Lerp stuff needs this event, thrown directly on the C++ queue. + EventQueue.getGlobalEventQueue().queueEvent("NewFrame") return Task.cont def restart(self, clusterSync: bool = False, cluster=None) -> None: diff --git a/direct/src/showbase/showBase.cxx b/direct/src/showbase/showBase.cxx index 43a8a16f8e..e7ccadaf2d 100644 --- a/direct/src/showbase/showBase.cxx +++ b/direct/src/showbase/showBase.cxx @@ -21,7 +21,6 @@ extern "C" { void CPSEnableForegroundOperation(ProcessSerialNumber* psn); } #include "showBase.h" -#include "throw_event.h" #include "graphicsWindow.h" #include "renderBuffer.h" #include "camera.h" @@ -45,13 +44,6 @@ ConfigureDef(config_showbase); ConfigureFn(config_showbase) { } -// Throw the "NewFrame" event in the C++ world. Some of the lerp code depends -// on receiving this. -void -throw_new_frame() { - throw_event("NewFrame"); -} - // Initialize the application for making a Gui-based app, such as wx. At the // moment, this is a no-op except on Mac. void diff --git a/direct/src/showbase/showBase.h b/direct/src/showbase/showBase.h index 25cf5fdf14..bfea13462a 100644 --- a/direct/src/showbase/showBase.h +++ b/direct/src/showbase/showBase.h @@ -16,7 +16,6 @@ #include "directbase.h" -#include "eventHandler.h" #include "graphicsWindow.h" #include "graphicsPipe.h" #include "animControl.h" @@ -32,8 +31,6 @@ class GraphicsEngine; BEGIN_PUBLISH -EXPCL_DIRECT_SHOWBASE void throw_new_frame(); - EXPCL_DIRECT_SHOWBASE void init_app_for_gui(); // to handle windows stickykeys