diff --git a/Source/Engine/Engine/Web/WebGame.h b/Source/Engine/Engine/Web/WebGame.h
index f65ba4a93..366c4f5a1 100644
--- a/Source/Engine/Engine/Web/WebGame.h
+++ b/Source/Engine/Engine/Web/WebGame.h
@@ -12,6 +12,9 @@
///
class WebGame : public GameBase
{
+public:
+ // [GameBase]
+ static void InitMainWindowSettings(CreateWindowSettings& settings);
};
typedef WebGame Game;
diff --git a/Source/Engine/Platform/Web/WebPlatform.cpp b/Source/Engine/Platform/Web/WebPlatform.cpp
index 4400d1af9..3a820f5de 100644
--- a/Source/Engine/Platform/Web/WebPlatform.cpp
+++ b/Source/Engine/Platform/Web/WebPlatform.cpp
@@ -13,6 +13,7 @@
#include "Engine/Platform/CPUInfo.h"
#include "Engine/Platform/MemoryStats.h"
#include "Engine/Profiler/ProfilerCPU.h"
+#include "Engine/Engine/Web/WebGame.h"
#include "Engine/Utilities/StringConverter.h"
#include
#include
@@ -28,6 +29,16 @@ namespace
double DateStart = emscripten_get_now();
};
+void WebGame::InitMainWindowSettings(CreateWindowSettings& settings)
+{
+ // Set window size matching the canvas item in HTML
+ settings.Fullscreen = false;
+ int width = 1, height = 1;
+ emscripten_get_canvas_element_size(WEB_CANVAS_ID, &width, &height);
+ settings.Size.X = width;
+ settings.Size.Y = height;
+}
+
void WebFileSystem::GetSpecialFolderPath(const SpecialFolder type, String& result)
{
result = TEXT("/");