mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
move clocktick outside of draw callback to python igloop
This commit is contained in:
parent
f14192b0e7
commit
68ecc1df88
@ -405,6 +405,7 @@ class ShowBase:
|
||||
self.cTrav.traverse(self.render)
|
||||
# Finally, render the frame.
|
||||
self.win.update()
|
||||
globalClock.tick()
|
||||
return Task.cont
|
||||
|
||||
def restart(self):
|
||||
|
@ -67,7 +67,11 @@ void render_frame(GraphicsPipe *pipe) {
|
||||
GraphicsWindow *win = pipe->get_window(w);
|
||||
win->get_gsg()->render_frame();
|
||||
}
|
||||
ClockObject::get_global_clock()->tick();
|
||||
// clock tick moved to igloop in ShowBase.py because
|
||||
// clock must tick while app is iconified and draw
|
||||
// callback is not being called by panda gsg
|
||||
|
||||
// ClockObject::get_global_clock()->tick();
|
||||
throw_event("NewFrame");
|
||||
}
|
||||
|
||||
@ -84,9 +88,6 @@ public:
|
||||
render_frame(_pipe);
|
||||
}
|
||||
|
||||
virtual void idle(void) {
|
||||
}
|
||||
|
||||
PT(GraphicsPipe) _pipe;
|
||||
PT(Node) _render_top;
|
||||
AppTraverser _app_traverser;
|
||||
@ -180,7 +181,7 @@ setup_panda_2d(GraphicsWindow *win, const string &graph_name) {
|
||||
new RenderRelation(render2d, cam2d);
|
||||
|
||||
Frustumf frustum2d;
|
||||
frustum2d.make_ortho(-1000,1000);
|
||||
frustum2d.make_ortho(-1000.0f,1000.0f);
|
||||
cam2d->set_projection(OrthoProjection(frustum2d));
|
||||
|
||||
add_render_layer(win, render2d_top, cam2d);
|
||||
|
Loading…
x
Reference in New Issue
Block a user