diff --git a/examples/common/entry/entry.cpp b/examples/common/entry/entry.cpp index a72b80278..1b92d2101 100644 --- a/examples/common/entry/entry.cpp +++ b/examples/common/entry/entry.cpp @@ -339,6 +339,24 @@ BX_PRAGMA_DIAGNOSTIC_POP(); } #endif // BX_PLATFORM_EMSCRIPTEN + static App* s_apps = NULL; + + App::App(const char* _name) + { + m_name = _name; + m_next = s_apps; + s_apps = this; + } + + App::~App() + { + } + + App* getFirstApp() + { + return s_apps; + } + int runApp(AppI* _app, int _argc, char** _argv) { _app->init(_argc, _argv); @@ -485,7 +503,7 @@ BX_PRAGMA_DIAGNOSTIC_POP(); _mouse->m_mx = mouse->m_mx; _mouse->m_my = mouse->m_my; _mouse->m_mz = mouse->m_mz; - if (!mouse->m_move) + if (!mouse->m_move) { _mouse->m_buttons[mouse->m_button] = mouse->m_down; } diff --git a/examples/common/entry/entry.h b/examples/common/entry/entry.h index 54c79d1cc..f388ff83c 100644 --- a/examples/common/entry/entry.h +++ b/examples/common/entry/entry.h @@ -9,6 +9,7 @@ #include "dbg.h" #include // memset #include +#include namespace bx { struct FileReaderI; struct FileWriterI; struct AllocatorI; } @@ -278,6 +279,32 @@ namespace entry { } + class App : public AppI + { + public: + App(const char* _name); + + virtual ~App(); + + const char* getName() const + { + return m_name; + } + + AppI* getNext() + { + return m_next; + } + + private: + const char* m_name; + App* m_next; + }; + + /// + App* getFirstApp(); + + /// int runApp(AppI* _app, int _argc, char** _argv); } // namespace entry