-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactoring to remove global state #170
base: master
Are you sure you want to change the base?
Conversation
…er function events
…isWindow into GLVisCommand
face_has_kerning(false) | ||
face_has_kerning(false), | ||
is_hidpi(false), | ||
ppi_w(96), ppi_h(96) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(minor) these could be default values when the members are declared:
... etc ...
bool face_has_kerning = false;
bool is_hidpi = false;
int ppi_w = 96, ppi_h = 96;
I can now build and run the js version but there is at least on thing that isn't working yet. I saw that the Instead of this: I'll spend some more time debugging. |
closer to working but not quite there
…is is happening yet but reusing the existing GLVisWindow does the trick (and is what we were doing previously)
The JS target seems to work well for me now, I slacked a copy to @tzanio and @kanye-quest so check it out if you want |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Preliminary review
} | ||
|
||
if (input_streams.Size() > 0) | ||
catch (std::runtime_error& ex) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this may be the first use of exceptions in MFEM or GLVis 😁
continue; | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one empty line
This PR is intended to split off some of the work from #149 into a somewhat-smaller PR.
GLVisWindow
, which consolidates most of the global state withinaux_vis.cpp
.GLVisWindow
handles creation of theSdlWindow
,VisualizationScene*
, andGLVisCommand
objects from aStreamState
object and/or an array of input streams.VisualizationScene*
event handlers member functions where possible, removing dependence on global pointers.GLVisCommand
and other idle function runs fromSdlWindow
toGLVisWindow
.