You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
and I wanted to set the title from this secondary thread.
The problem is that i need the window for the main window.should_close() loop under this thread code:
while !window.should_close(){
glfw.wait_events_unbuffered(|window_id, event| {iflet(_,WindowEvent::Close) = event {
window.set_should_close(false);};Some(event)});}
i see that PRenderContext has the window_ptr() function, so techincally i can do this on the second thread:
unsafe {
glfwSetWindowTitle(window_ptr, ...)
}
is this bad? If not, is there a way to retrieve the window from the render context? do I need to use Arc<Mutex>?
Thank you!
The text was updated successfully, but these errors were encountered:
Hello! I was wondering if it was possible to get the window handle from the render context on another thread.
Let's say i wanted to create another thread with the render context:
and I wanted to set the title from this secondary thread.
The problem is that i need the window for the main window.should_close() loop under this thread code:
i see that
PRenderContext
has thewindow_ptr()
function, so techincally i can do this on the second thread:is this bad? If not, is there a way to retrieve the window from the render context? do I need to use Arc<Mutex>?
Thank you!
The text was updated successfully, but these errors were encountered: