diff options
Diffstat (limited to 'termbox')
-rw-r--r-- | termbox/termbox.c | 5 | ||||
-rw-r--r-- | termbox/termbox.h | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/termbox/termbox.c b/termbox/termbox.c index 80aeb3a9..0e4d5a9f 100644 --- a/termbox/termbox.c +++ b/termbox/termbox.c @@ -153,6 +153,11 @@ void tb_shutdown(void) termw = termh = -1; } +int tb_is_active(void) +{ + return termw != -1; +} + void tb_present(void) { int x,y,w,i; diff --git a/termbox/termbox.h b/termbox/termbox.h index 0bd55be9..ac31230a 100644 --- a/termbox/termbox.h +++ b/termbox/termbox.h @@ -44,6 +44,8 @@ int tb_init(void); /* Restore terminal mode. */ void tb_shutdown(void); +int tb_is_active(void); + /* Size of the screen. Return negative values before tb_init() or after * tb_shutdown() */ int tb_width(void); |