This commit is contained in:
Branimir Karadžić 2016-11-19 18:38:13 -08:00
parent 0e9a45f353
commit 68fb1f5bdd
2 changed files with 46 additions and 1 deletions

View File

@ -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;
}

View File

@ -9,6 +9,7 @@
#include "dbg.h"
#include <string.h> // memset
#include <bx/bx.h>
#include <bx/string.h>
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