Summary
When setting any input related callbacks in GLFW, PollEvents causes an AccessViolationException
Steps to reproduce
- Platform: Desktop
- Framework Version: .NET 4.7.2
- API: OpenGL
- API Version: Legacy/OpenGL 1.1 (I mostly use Silk.NET to port legacy games)
- Properly initialize a GLFW context and a window
- Use either SetKeyCallback, SetMouseButtonCallback or SetCursorPosCallback (probably others too)
- Call PollEvents
Comments
Oddly enough, SetWindowSizeCallback and other non-input related callbacks do not cause an access violation
// Leaving on this callback is fine
glfw.SetWindowSizeCallback(window, (WindowHandle* window, int width, int height) =>
{
// Code is executed
// ...
});
// But uncommenting this line, causes an AccessViolationException when polling the events
glfw.SetKeyCallback(window, (WindowHandle * window, Keys key,
int scanCode, InputAction action, KeyModifiers mods) =>
{
// Code is not executed, game crashes
// ...
});
Summary
When setting any input related callbacks in GLFW, PollEvents causes an AccessViolationException
Steps to reproduce
Comments
Oddly enough, SetWindowSizeCallback and other non-input related callbacks do not cause an access violation