Minor WebAssembly adjustments

This commit is contained in:
Joshua Granick
2023-05-24 12:37:17 -07:00
parent de5844aae1
commit 2406ff4b94
5 changed files with 39 additions and 1 deletions

View File

@@ -28,6 +28,8 @@ namespace lime {
static void GCEnterBlocking ();
static void GCExitBlocking ();
static void GCTryEnterBlocking ();
static void GCTryExitBlocking ();
static bool GetAllowScreenTimeout ();
static std::wstring* GetDeviceModel ();
static std::wstring* GetDeviceVendor ();

View File

@@ -926,8 +926,16 @@ namespace lime {
void SDLApplication::UpdateFrame () {
#ifdef EMSCRIPTEN
System::GCTryExitBlocking ();
#endif
currentApplication->Update ();
#ifdef EMSCRIPTEN
System::GCTryEnterBlocking ();
#endif
}

View File

@@ -201,7 +201,9 @@ namespace lime {
// if (window->flags & WINDOW_FLAG_VSYNC) {
// sdlRendererFlags |= SDL_RENDERER_PRESENTVSYNC;
#ifdef EMSCRIPTEN
sdlRendererFlags |= SDL_RENDERER_PRESENTVSYNC;
#endif
// }

View File

@@ -42,6 +42,28 @@ namespace lime {
}
void System::GCTryEnterBlocking () {
if (!_isHL) {
gc_try_blocking ();
}
}
void System::GCTryExitBlocking () {
if (!_isHL) {
gc_try_unblocking ();
}
}
#if defined (HX_WINDOWS) && !defined (HX_WINRT)
std::wstring* GetWMIValue (BSTR query, BSTR field) {