Skip to content
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

Fix screen for applications that want to manage their own glfw and not rely on nanogui #91

Closed
wants to merge 10 commits into from

Conversation

AlwaysGeeky
Copy link
Contributor

Also include a new example, example3.cpp that demonstrates a way to create your own windows management code with glfw but still create GUI objects with nanogui.

…ns that want to manage their own glfw context and code
… your own glfw and render loop

Also fix the cmake comment for GLAD
…ounds

The alignment and tooltip width was off for when a tooltip text was
smaller than the hard-coded tooltip box of 150px.

Account for this when drawing the tooltip and tooltip bounds box
…ce we dont always want to control GLFW functionality

If we are not the owner, then don't automatically hide the glfw window
when we make the root screen not visible, we might simply not want to
show the GUI, but carry on showing the glfw window.
@@ -192,6 +192,7 @@ class NANOGUI_EXPORT Screen : public Widget {
std::string mCaption;
bool mShutdownGLFWOnDestruct;
bool mFullscreen;
bool mOwningGLFWContext;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation issue (are you using tabs? NanoGUI uses only spaces.)

glfwShowWindow(mGLFWWindow);
else
glfwHideWindow(mGLFWWindow);
if (mOwningGLFWContext) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why disable setVisible() for non-owned GLFW context? I think it would be quite reasonable to leave this on.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I am managing my own GLFW and windowing code, and just using a pointer to a 'screen' object for my GUI, having the whole window hidden just because I call: screen->setVisible(false) is misleading, what if I just want to hide the GUI alone, but keep my true window visible?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, screen is a wrapper around the GLFW window, so setVisible() should be forwarded to GLFW. Whether the Screen also owns the GLFW window and is responsible for construction/deconstruction should not change the behavior of this function. Hiding the individual windows can be accomplished with their respective setVisible() functions.

@wjakob
Copy link
Owner

wjakob commented Aug 2, 2016

I added a few more comments -- after that, it looks good to me.

@wjakob
Copy link
Owner

wjakob commented Aug 2, 2016

(Please squash everything into one commit when you're done.)

@wjakob
Copy link
Owner

wjakob commented Aug 8, 2016

merged, thanks!

@wjakob wjakob closed this Aug 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants