- Added stderr redirect to file (or /dev/null) based on platform and build config

- Added Window::Invalidate() that can be called to force a full refresh
This commit is contained in:
Casey Langen 2016-05-29 22:00:43 -07:00
parent 9400c65a61
commit 6ba643a2cc
3 changed files with 17 additions and 0 deletions

View File

@ -56,6 +56,8 @@
#include <boost/chrono.hpp>
#include <cstdio>
#ifdef WIN32
#undef MOUSE_MOVED
#endif
@ -196,6 +198,12 @@ int main(int argc, char* argv[])
#ifndef WIN32
setlocale(LC_ALL, "");
#ifdef DEBUG
freopen("/tmp/musikbox.log", "w", stderr);
#else
freopen("/dev/null", "w", stderr);
#endif
#endif
musik::debug::init();
@ -267,6 +275,9 @@ int main(int argc, char* argv[])
else if (kn == "^D") { /* ctrl+d quits */
quit = true;
}
else if (kn == "ALT_R" || kn == "M-r") {
Window::Invalidate();
}
else if (kn == "KEY_RESIZE") {
resizeAt = now() + REDRAW_DEBOUNCE_MS;
}

View File

@ -32,6 +32,11 @@ void Window::WriteToScreen(IInput* input) {
}
}
void Window::Invalidate() {
wclear(stdscr);
drawPending = true;
}
Window::Window(IWindow *parent) {
this->frame = this->content = 0;
this->framePanel = this->contentPanel = 0;

View File

@ -51,6 +51,7 @@ namespace cursespp {
virtual void SetFocusOrder(int order = -1);
static void WriteToScreen(IInput* input);
static void Invalidate();
protected:
IWindow* GetParent() const;