When I resize the screen from left to rigth, or top to bottom, everything is smooth and works perfectly, but when I resize it in diagonal, it immediatly crashes.
There is no event handling or nothing.
There is simply a mainthread with a single function : glfwpollevents()
And a render thread as shown above.
I slightly modified your code to make the most basic threaded app:
#include <GLFW/glfw3.h>
#include <thread>
int main(void)
{
GLFWwindow* window;
/* Initialize the library */
if (!glfwInit())
return -1;
/* Create a windowed mode window and its OpenGL context */
window = glfwCreateWindow(640, 480, "Hello World", NULL, NULL);
if (!window)
{
glfwTerminate();
return -1;
}
/* Make the window's context current */
glfwMakeContextCurrent(window);
glfwMakeContextCurrent(NULL);
std::thread render_thread([window] {
glfwMakeContextCurrent(window);
while(!glfwWindowShouldClose(window))
{
/* Render here */
glClear(GL_COLOR_BUFFER_BIT);
/* Swap front and back buffers */
glfwSwapBuffers(window);
}
});
/* Loop until the user closes the window */
while (!glfwWindowShouldClose(window))
{
glfwPollEvents();
}
render_thread.join();
glfwTerminate();
return 0;
}
Your code (without GLEW code as it’s not required here) and this code did not crash when resizing or moving in any way including diagonally.
I can’t see anything in the call stack image you show, the fact it shows Unknown Source makes me think this is from an injected DLL, similar to other issues I have seen with Nahimic:
The solution there was to uninstall Nahimic. Asus’s Sonic Suite has also caused issues, as have some viruses.
I disabled nahimic service and it doesnt crash anymore. The window resize is even smoother than before.
Does this mean that if I run this prorgam on a computer that has Nahimic the app would crash or do I just need to build my project while nahimic is disabled?