Made all the examples Emscripten friendly.

cWindow::Display( bool clear = false ) now doesn't Clear by default.
Fixed a bug in cSprite::GetAABB().
This commit is contained in:
Martín Lucas Golini
2013-11-14 02:30:46 -03:00
parent d40a10a07c
commit 2e016791da
10 changed files with 314 additions and 270 deletions

View File

@@ -1,14 +1,10 @@
#include "eetest.hpp"
Demo_Test::cEETest * MY_INSTANCE = NULL;
Demo_Test::cEETest * TestInstance = NULL;
#if EE_PLATFORM == EE_PLATFORM_EMSCRIPTEN
#include <emscripten.h>
void MainLoop() {
MY_INSTANCE->Update();
static void MainLoop() {
TestInstance->Update();
}
#endif
namespace Demo_Test {
@@ -1612,17 +1608,9 @@ void cEETest::Process() {
Init();
if ( NULL != mWindow && mWindow->Created() ) {
#if EE_PLATFORM == EE_PLATFORM_EMSCRIPTEN
cLog::instance()->Write( "Entering the main loop" );
MY_INSTANCE = this;
TestInstance = this;
emscripten_set_main_loop(MainLoop, 0, 1);
#else
// Application loop
while ( mWindow->Running() ) {
Update();
}
#endif
mWindow->RunMainLoop( &MainLoop );
}
End();