1
Window / Re: Failed to activate OpenGL context
« on: October 24, 2018, 07:38:48 am »
eXpl0it3r, Thank you for reply.
But I create and use windows only in separate threads. Each window with its event/draw(update) loop is whole in its thread.
I create class in main(), but the windows are created and controller whole locally in function, whole in its self thread.
So one doubtfully thing is updating of Vertex in the main(). So I remove the whole for cycle from main(), so, there are created only two empty windows.
But the problem persists - I must close them in reverse order of the creation - so if I close first the window 1, and then the window 2, then the Error message "Failed to activate OpenGL context: The handle is invalid." is written, but if I close first window 2, than 1 - no message is displayed.
In the two cases the program seems to work properly and the exit code i 0. But this message in the console worry me.
Why the row of creation/closing is important?! The each class has fully independent memory, thread and so on. No any shared resources. I try to use std::thread and the result is the same.
But I create and use windows only in separate threads. Each window with its event/draw(update) loop is whole in its thread.
I create class in main(), but the windows are created and controller whole locally in function, whole in its self thread.
So one doubtfully thing is updating of Vertex in the main(). So I remove the whole for cycle from main(), so, there are created only two empty windows.
But the problem persists - I must close them in reverse order of the creation - so if I close first the window 1, and then the window 2, then the Error message "Failed to activate OpenGL context: The handle is invalid." is written, but if I close first window 2, than 1 - no message is displayed.
In the two cases the program seems to work properly and the exit code i 0. But this message in the console worry me.
Why the row of creation/closing is important?! The each class has fully independent memory, thread and so on. No any shared resources. I try to use std::thread and the result is the same.