Skip to content

OpenGL Functions Unloaded/Crash #200

@RobertBColton

Description

@RobertBColton

Hello, our project, a game engine, is investigating switching our glew dependency to libepoxy so that we can simplify context creation and support OpenGL ES. We use a bridging system so the user can select from the GUI whether to use SDL or raw native Win32/XLIB for the window. I've had relatively great success switching our bridges over to using libepoxy instead of glew.
enigma-dev/enigma-dev#1602

Now, I've run into an issue with bridging Win32 or SDL with OpenGL 3.3 core. I am compiling with MSYS2 64 bit and I seem to be getting a crash in wglMakeCurrent(NULL,NULL); when I close the window (negative return code). I don't get it with the same setup with OpenGL1 and get a successful 0 exit code. My context deletion code is the same for GL1 and GL3 because the bridges are capable of sharing source code.

In the case of SDL, all I do is call SDL_GL_DeleteContext(context);:
https://github.com/enigma-dev/enigma-dev/blob/2cc99695e0929a2ca84becdac62acc36b18f6619/ENIGMAsystem/SHELL/Bridges/SDL-OpenGL/graphics_bridge.cpp#L47

In the case of Win32, I use the same context deletion as your tests:
https://github.com/enigma-dev/enigma-dev/blob/2cc99695e0929a2ca84becdac62acc36b18f6619/ENIGMAsystem/SHELL/Bridges/Win32-OpenGL/graphics_bridge.cpp#L35

Yet, alas, I get this stack trace when closing the window if my context is a core 3.3 context:

#0  0x00007fff554e436f in msvcrt!memmove ()
   from C:\WINDOWS\System32\msvcrt.dll
#1  0x00000000004cb916 in epoxy_handle_external_wglMakeCurrent.part.1 ()
#2  0x00000000004cb94b in epoxy_wglMakeCurrent_wrapped ()
#3  0x00000000004caaf2 in enigma::DisableDrawing ()
    at Bridges/Win32-OpenGL/graphics_bridge.cpp:34

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