Threaded server/display mode (for real this time)#174
Conversation
- Don't build logo when we're on Windows - Use imported SDL2 targets when possible - needed for correct DLL handling - Don't use M_PI constant
|
Never mind, it was a missing define in the makefile. It should work now. |
Works now, thanks! |
|
The overall behavior looks really good - thanks @kanye-quest ! I have just encountered the following However, if I click on the dock icon, then everything shuts down normally. |
|
I still see issues with the some of them have scaled viewport which can be seen in the caption (letters have scaled width) and when you zoom in: Can you reproduce? |
I will also like to be able to close the server with |
|
Not sure if this is a change in this PR, but the handling of |
|
I can confirm that e380892 fixed #174 (comment) and #174 (comment) for me. |
tzanio
left a comment
There was a problem hiding this comment.
This is a pretty major overhaul of the GLVis server internals, that I'm pretty sure would not have happened without your help @kanye-quest -- Thank you! 🎉 🎉 🎉
All my testing has been good for a while now, so I am approving with the expectation that continued use may uncover some issues in corner cases. 👍
pazner
left a comment
There was a problem hiding this comment.
Very nice quality-of-life improvements! Makes GLVis behave a lot more like a standard Mac app, and works much more reliably than before. Dock icon and Ctrl-C are both working properly for me.
I haven't looked at the code in the PR, but from a user's perspective it's a big improvement!
lib/gl/types.cpp
Outdated
| float theta = atan2 (vy, vx); | ||
|
|
||
| #ifndef M_PI | ||
| const double M_PI = glm::pi<double>(); |
| } | ||
| if (XISelectEvents_(disp, wnd, &event_mask, 1) != Success) | ||
| { | ||
| cerr << "Failed to disable XInput on the current window!" << endl; |
There was a problem hiding this comment.
should these error blocks also exit(EXIT_FAILURE) ? Or is XInput being enabled pretty minor? edit: i noticed glvis just has a lot of cases where errors are reported but they aren't necessarily fatal, it probably keeps things running in more cases which is good
There was a problem hiding this comment.
Yeah, I think if we can't disable XInput extension events, it just means our event loop gets woken up more.
tomstitt
left a comment
There was a problem hiding this comment.
This is awesome, thanks @kanye-quest !
|
Looks good to me too with Laghos. |


Summary
fork()to open new windows for an incoming session. Each thread is associated with a single window and problem state, and handles scene operations and rendering to OpenGL.thread_local, and is set by a session worker thread upon a call toGLVisInitVis()/GLVisStartVis().fork().SdlMainThreadclass to deal with operations that need to be handled on the main thread, such as event handling and window operations. This class is instantiated once for a program, and essentially operates as a "server" which accepts commands from session threads.GLVisServer(), which runs on its own thread.TODO