From 14e0aa5aff65a12df621fbc9466b42d41d01f013 Mon Sep 17 00:00:00 2001 From: Francisco Facioni Date: Sat, 28 Jun 2025 21:31:59 +0200 Subject: [PATCH] [emscripten] Fix MEMORY64 mode (#3437) EMSCRIPTEN_WEBGL_CONTEXT_HANDLE is 64bit when using MEMORY64 but it's stored as an int 32 bit causing overflow --- src/glcontext_html5.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/glcontext_html5.cpp b/src/glcontext_html5.cpp index 03dae927f..24f1996e9 100644 --- a/src/glcontext_html5.cpp +++ b/src/glcontext_html5.cpp @@ -28,7 +28,7 @@ namespace bgfx { namespace gl struct SwapChainGL { - SwapChainGL(int _context, const char* _canvas) + SwapChainGL(EMSCRIPTEN_WEBGL_CONTEXT_HANDLE _context, const char* _canvas) : m_context(_context) { size_t length = bx::strLen(_canvas) + 1; @@ -60,7 +60,7 @@ namespace bgfx { namespace gl // to the browser. } - int m_context; + EMSCRIPTEN_WEBGL_CONTEXT_HANDLE m_context; char* m_canvas; };