summaryrefslogtreecommitdiffstatshomepage
path: root/3rdparty/bgfx/src/glcontext_html5.cpp
diff options
context:
space:
mode:
author R. Belmont <rb6502@users.noreply.github.com>2023-01-04 23:29:18 -0500
committer GitHub <noreply@github.com>2023-01-04 23:29:18 -0500
commit94b1e168b2b97b48b81f7a8f64406b0a6f64184e (patch)
treef57362a0fa01bfe8f0ad75a447c4c9e10bc15756 /3rdparty/bgfx/src/glcontext_html5.cpp
parent5581eaa50a42256242f32569f59ce10d70ddd8c2 (diff)
Revert "Update BGFX, BX and BIMG (#10750)" (#10787)
This reverts commit 5581eaa50a42256242f32569f59ce10d70ddd8c2 due to link failure on macOS.
Diffstat (limited to '3rdparty/bgfx/src/glcontext_html5.cpp')
-rw-r--r--3rdparty/bgfx/src/glcontext_html5.cpp31
1 files changed, 6 insertions, 25 deletions
diff --git a/3rdparty/bgfx/src/glcontext_html5.cpp b/3rdparty/bgfx/src/glcontext_html5.cpp
index 016b7c189b3..a884ab7b35f 100644
--- a/3rdparty/bgfx/src/glcontext_html5.cpp
+++ b/3rdparty/bgfx/src/glcontext_html5.cpp
@@ -1,6 +1,6 @@
/*
- * Copyright 2011-2022 Branimir Karadzic. All rights reserved.
- * License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
+ * Copyright 2011-2021 Branimir Karadzic. All rights reserved.
+ * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
*/
#include "bgfx_p.h"
@@ -63,7 +63,7 @@ namespace bgfx { namespace gl
char* m_canvas;
};
- void GlContext::create(uint32_t _width, uint32_t _height, uint32_t /*_flags*/)
+ void GlContext::create(uint32_t _width, uint32_t _height)
{
// assert?
if (m_primary != NULL)
@@ -71,23 +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;
- if (context > 0)
- {
- if (emscripten_webgl_get_context_attributes(context, &s_attrs) >= 0)
- {
- import(s_attrs.majorVersion);
- m_primary = BX_NEW(g_allocator, SwapChainGL)(context, canvas);
- }
- else
- {
- BX_TRACE("Invalid WebGL context. (Canvas handle: '%s', context handle: %d)", canvas, context);
- }
- }
- else
- {
- m_primary = createSwapChain((void*)canvas);
- }
+ m_primary = createSwapChain((void*)canvas);
if (0 != _width
&& 0 != _height)
@@ -137,7 +121,7 @@ namespace bgfx { namespace gl
s_attrs.minorVersion = 0;
const char* canvas = (const char*) _nwh;
- int32_t error = 0;
+ int error = 0;
for (int version = 2; version >= 1; --version)
{
@@ -154,13 +138,10 @@ namespace bgfx { namespace gl
return swapChain;
}
-
- error = (int32_t)context;
+ error = (int) context;
}
BX_TRACE("Failed to create WebGL context. (Canvas handle: '%s', last attempt error %d)", canvas, error);
- BX_UNUSED(error);
-
return NULL;
}