Fixes Emscripten wasm64 compile error in glcontext_html5.cpp. (#3282)

Fixes compile error:

```
glcontext_html5.cpp:74:45: error: cast from pointer to smaller type
'EMSCRIPTEN_WEBGL_CONTEXT_HANDLE' (aka 'int') loses information
74 |                 EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context =
reinterpret_cast<EMSCRIPTEN_WEBGL_CONTEXT_HANDLE>(g_platformData.context);
|
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
```
This commit is contained in:
João Matos 2024-04-30 15:16:20 +01:00 committed by GitHub
parent 1138cc0cc9
commit 57d8a0838b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -71,7 +71,7 @@ namespace bgfx { namespace gl
const char* canvas = (const char*) g_platformData.nwh;
EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context = (EMSCRIPTEN_WEBGL_CONTEXT_HANDLE) g_platformData.context;
EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context = bx::narrowCast<EMSCRIPTEN_WEBGL_CONTEXT_HANDLE>((uintptr_t) g_platformData.context);
if (context > 0)
{
if (emscripten_webgl_get_context_attributes(context, &s_attrs) >= 0)