EDIT: Arrgh, I meant to post this in programming. Sorry.
I'm trying to understand this code (which is from the roguebasin python + libtcod tutorial):
import libtcodpy as libtcod
#actual size of the window
SCREEN_WIDTH = 80
SCREEN_HEIGHT = 50
LIMIT_FPS = 20 #20 frames-per-second maximum
libtcod.console_set_custom_font('arial10x10.png', libtcod.FONT_TYPE_GREYSCALE | libtcod.FONT_LAYOUT_TCOD)
libtcod.console_init_root(SCREEN_WIDTH, SCREEN_HEIGHT, 'python/libtcod tutorial', False)
libtcod.sys_set_fps(LIMIT_FPS)
while not libtcod.console_is_window_closed():
libtcod.console_set_default_foreground(0, libtcod.white)
libtcod.console_put_char(0, 1, 1, '@', libtcod.BKGND_NONE)
libtcod.console_flush()
If libtcod.console_init_root(SCREEN_WIDTH, SCREEN_HEIGHT, 'python/libtcod tutorial', False) initializes the console, and libtcod.console_flush() displays the changes that I have made to it, why doesn't the console stay open in a script with just these two commands after libtcod.sys_set_fps(LIMIT_FPS)? It looks almost like you have to use while not libtcod.console_is_window_closed(): to keep the console open, but I thought that line was essentially asking the question "is the console window open?" not giving python the command "keep the window open". So, what is the bare minimum of commands necessary to keep the console window open and what the heck is the mechanism by which they work?
Is python looping through the commands after while not libtcod.console_is_window_closed(): LIMIT_FPS times per second, or does the console just stay drawn until it gets a command to change what it displays and is flushed?
Yes, I could ask this on the libtcod boards, but after a brief inspection of how complex the topics there are, I think I am too embarrassed to.