mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-06-05 04:56:31 +03:00
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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user