SFML community forums
Help => Window => Topic started by: Zweistein on December 10, 2010, 04:00:22 pm
-
Hey,
For some reason my RenderWindow is not answering to events like moving the window around or minimize, maximize. The OpenGL stuff is rendered correctly, but the windows does not respond to any windows7 messages. I render in a thread.
-
Do you call GetEvent?
-
Yes, i do.
I got the error. I created the Window in an other Thread. But i thought setActive() is implemented for the reason to switch the context to the current thread. its also working witht he opengl stuff, but not with the windows messaging stuff.
-
SetActive activates the OpenGL context, this has nothing to do with event handling.
OpenGL contexts can be used in other threads, but not events (that's a limitation of the OS).
-
Ok, now i created the Window in thread X, this way i can ask for input from thread X.
On the other site i want to render in thread Y. But everytime i try to use m_Window->setActive(true) in thread Y it says: "Failed to activate the window's context".
What are the conditions to make it work?
-
You must call window->SetActive(false) from the other thread, before activating it in the new thread.
-
Ok, i got 3 Problems that are fixed now:
1) i didn t called SetActive(false)
2) I hadn t had a sf::Context in both Threads
3) I called m_Window->Display() in Thread X and i think this activates the context for thread X again?
lg
-
3) I called m_Window->Display() in Thread X and i think this activates the context for thread X again?
Yes it does.