move clocktick outside of draw callback to python igloop

This commit is contained in:
cxgeorge 2001-12-01 03:12:18 +00:00
parent f14192b0e7
commit 68ecc1df88
2 changed files with 7 additions and 5 deletions

View File

@ -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):

View File

@ -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);