Fixed Android build.

This commit is contained in:
Бранимир Караџић
2025-10-29 13:59:22 -07:00
parent bf31667394
commit 71e0db9369

View File

@@ -546,14 +546,21 @@ WL_EGL_IMPORT
EGLNativeWindowType nwh = (EGLNativeWindowType )g_platformData.nwh; EGLNativeWindowType nwh = (EGLNativeWindowType )g_platformData.nwh;
eglMakeCurrent(m_display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); eglMakeCurrent(m_display, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
eglDestroySurface(m_display, m_surface); eglDestroySurface(m_display, m_surface);
m_surface = eglCreateWindowSurface(m_display, m_config, nwh, NULL); m_surface = eglCreateWindowSurface(m_display, m_config, nwh, NULL);
BGFX_FATAL(m_surface != EGL_NO_SURFACE, Fatal::UnableToInitialize, "Failed to create surface."); BGFX_FATAL(m_surface != EGL_NO_SURFACE, Fatal::UnableToInitialize, "Failed to create surface.");
EGLBoolean success = eglMakeCurrent(m_display, m_surface, m_surface, m_context); EGLBoolean success = eglMakeCurrent(m_display, m_surface, m_surface, m_context);
BGFX_FATAL(success, Fatal::UnableToInitialize, "Failed to set context."); BGFX_FATAL(success, Fatal::UnableToInitialize, "Failed to set context.");
EGLint format; EGLint format;
eglGetConfigAttrib(m_display, m_config, EGL_NATIVE_VISUAL_ID, &format); eglGetConfigAttrib(m_display, m_config, EGL_NATIVE_VISUAL_ID, &format);
ANativeWindow_setBuffersGeometry( (ANativeWindow*)g_platformData.nwh, _width, _height, format); ANativeWindow_setBuffersGeometry(
(ANativeWindow*)g_platformData.nwh
, _resolution.width
, _resolution.height
, format
);
} }
# elif BX_PLATFORM_EMSCRIPTEN # elif BX_PLATFORM_EMSCRIPTEN
EMSCRIPTEN_CHECK(emscripten_set_canvas_element_size( EMSCRIPTEN_CHECK(emscripten_set_canvas_element_size(