Skip to content

Segmentation faults when using GLFW3 #3209

Closed Answered by 0xdeadbeer
0xdeadbeer asked this question in Q&A
Discussion options

You must be logged in to vote

I solved the problem by following the advice on the issue #1560

Now the code looks like this

...

    bgfx::PlatformData pd; 
    pd.ndt = glfwGetX11Display();
    pd.nwh = (void *)(uintptr_t) glfwGetX11Window(window);
    // bgfx::setPlatformData(pd);

    bgfx::Init bgfxInit; 
    bgfxInit.type = bgfx::RendererType::OpenGL; 
    bgfxInit.resolution.width = screen_width; 
    bgfxInit.resolution.height = screen_height; 
    bgfxInit.resolution.reset = BGFX_RESET_VSYNC; 
    bgfxInit.platformData = pd;
    bgfx::init(bgfxInit);

    bgfx::setViewClear(0, BGFX_CLEAR_COLOR | BGFX_CLEAR_DEPTH, 0x443355FF, 1.0f, 0);
    bgfx::setViewRect(0, 0, 0, screen_width, screen_height);

    while (!glf…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by 0xdeadbeer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant