nuclear@0: #include nuclear@0: #include "opengl.h" nuclear@0: #include "screen.h" nuclear@0: #include "logger.h" nuclear@0: #include "unistate.h" nuclear@0: nuclear@0: static std::vector scrstack; nuclear@0: nuclear@0: void push_screen(Screen *screen) nuclear@0: { nuclear@0: Screen *prev = current_screen(); nuclear@0: if(prev) { nuclear@0: prev->stop(); nuclear@0: } nuclear@0: nuclear@0: scrstack.push_back(screen); nuclear@0: screen->start(); nuclear@0: } nuclear@0: nuclear@0: Screen *pop_screen() nuclear@0: { nuclear@0: if(scrstack.empty()) { nuclear@0: error_log("trying to pop a screen, but the stack is empty!\n"); nuclear@0: return 0; nuclear@0: } nuclear@0: Screen *res = scrstack.back(); nuclear@0: scrstack.pop_back(); nuclear@0: nuclear@0: res->stop(); nuclear@0: nuclear@0: Screen *next = current_screen(); nuclear@0: if(next) { nuclear@0: next->start(); nuclear@0: } nuclear@0: return res; nuclear@0: } nuclear@0: nuclear@0: Screen *current_screen() nuclear@0: { nuclear@0: if(scrstack.empty()) { nuclear@0: return 0; nuclear@0: } nuclear@0: return scrstack.back(); nuclear@0: } nuclear@0: nuclear@0: Screen *previous_screen() nuclear@0: { nuclear@0: int sz = scrstack.size(); nuclear@0: if(sz < 2) { nuclear@0: return 0; nuclear@0: } nuclear@0: return scrstack[sz - 2]; nuclear@0: } nuclear@0: nuclear@0: Screen::~Screen() nuclear@0: { nuclear@0: } nuclear@0: nuclear@0: const char *Screen::get_name() const nuclear@0: { nuclear@0: return "Screen"; nuclear@0: } nuclear@0: nuclear@0: bool Screen::init() nuclear@0: { nuclear@0: return true; nuclear@0: } nuclear@0: nuclear@0: void Screen::cleanup() nuclear@0: { nuclear@0: } nuclear@0: nuclear@0: void Screen::start() nuclear@0: { nuclear@0: } nuclear@0: nuclear@0: void Screen::stop() nuclear@0: { nuclear@0: } nuclear@0: nuclear@0: long Screen::redisplay_interval() const nuclear@0: { nuclear@0: return 0; // don't redisplay implicitly by default nuclear@0: } nuclear@0: nuclear@0: void Screen::update(unsigned long tmsec) nuclear@0: { nuclear@0: } nuclear@0: nuclear@0: void Screen::pre_draw() const nuclear@0: { nuclear@0: } nuclear@0: nuclear@0: void Screen::display() const nuclear@0: { nuclear@0: } nuclear@0: nuclear@0: void Screen::post_draw() const nuclear@0: { nuclear@0: } nuclear@0: nuclear@0: void Screen::keyboard(int key, bool pressed) nuclear@0: { nuclear@0: } nuclear@0: nuclear@0: void Screen::motion(int x, int y, bool pressed) nuclear@0: { nuclear@0: } nuclear@0: nuclear@0: void Screen::button(int bn, bool pressed, int x, int y) nuclear@0: { nuclear@0: } nuclear@0: nuclear@0: void Screen::reshape(int x, int y) nuclear@0: { nuclear@0: }