Skip to content

GlContext::createSwapChain fails when g_platformData.context != nullptr #3386

@AdamBalazsVay

Description

@AdamBalazsVay

Steps to reproduce the behavior:

  1. Init BGFX with init.platformData.context != nullptr
  2. In GlContext::create m_display won't be set, remains nullptr:
    m_display = eglGetDisplay(NULL == ndt ? EGL_DEFAULT_DISPLAY : ndt);
  3. In GlContext::create m_config won't be set:
    success = eglChooseConfig(m_display, attrs, &m_config, 1, &numConfig);
  4. GlContext::createSwapChain fails, as m_display and m_config are invalid:
    return BX_NEW(g_allocator, SwapChainGL)(m_display, m_config, m_context, (EGLNativeWindowType)_nwh, _width, _height);

Expected behavior
BGFX should work with an externally set context, GlContext's m_display and m_config should contain meaningful data even in these cases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions