from ttgx.model import gamestate
from ttgx.meta import from_yaml
-log = logging.getLogger('ttg-demo')
+log = logging.getLogger('ttgx-demo')
-#XXX FPS and CPU time is incredibly high (>90% CPU, usually thousands of FPS,
-# sometimes tens of thousands).
-# Somehow, pyglet sucks at sleep()ing or doesn't even try.
-# Despite the docs praising the built-in event loop as less CPU-hungry,
-# it does as many updates as it can, so the end result is just as CPU-hungry.
-# (Though to be fair, it may avoid busy waits in some places and just use the
-# free time for other drawing.)
-#TODO: dive into pyglet.event.EventLoop and come up with a better idle() that
- start_time = datetime.datetime.now()
- end_time = datetime.datetime.now()
- dt = end_time - start_time
- pseudo_fps = draw_count / dt.total_seconds()
- "%d draw() calls in %.2f seconds => %.2f FPS",
- draw_count, dt.total_seconds(), pseudo_fps
log.error('Initialization failed:', exc_info=True)
if __name__ == '__main__':