-
Notifications
You must be signed in to change notification settings - Fork 182
Embedding Imgui into personal project causes text on windows to render as white blocks #10
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
Comments
It's hard for me to tell what causes the problem, but maybe it's because of drawing other stuff. It's possible that it's bug in the binding but so far I haven't encountered it so if you will find what causes it, the problem will likely to be fixed later. :) P.S. What version of SFML are you using? What's your OS and compiler? There was previously similar problem (#8) but the main cause of the problem wasn't found. |
Thanks for the reply! I understand that it's difficult to diagnose the issue when I've only provided a tiny snippet of the code. I actually found out that this is causing the issue: The Imgui code is in the TestState. For whatever reason, adding in more game states prevents the Imgui window from rendering properly. By removing my SpashState, the Imgui renders properly. At this point, it's obvious that my code is breaking it somehow and doesn't seem to be an issue with the library so you may wish to close the issue. I still don't know why the Imgui window is not rendering properly (hopefully I find out soon!), as add_active_state doesn't do anything to directly affect the data contained in the states, and nothing else is being rendered in this project other than the Imgui window (the splash screen gets destroyed and stops rendering before Imgui even gets initialized). I tried placing the Imgui code into a different container class just to see if the states were somehow affecting it and I got the same effect (with garbled text) only when I added new game states. And now I'm just talking about code you can't see so I'm going to stop there. You can leave this open if you would like me to report if I've found a solution or not, but that"s up to you since this is now a personal problem. My OS is Ubuntu v. 14.04. |
Oh, you might be on to something. I tested activating the TestState before the SplashState -- no problem. Then when switching to the SplashState and then back to the TestState in the same program run, the text became garbled. Perhaps this is a similar issue to #8 since the SplashState renders a sprite to the window. I'll see if rendering a sprite in the TestState without the SplashState breaks the Imgui window. |
Yes. This seems to be the same issue as #8. I don't know if this is good or bad news. Haha! I forgot to mention that my Ubuntu is running through a VM! Perhaps this is part of the issue? I'm just happy that there is at least a hackish solution with the window.pushGLStates() and window.popGLStates() so I can at least move forward with my SFML-Imgui developments! |
Can you find a minimal complete example that reproduces the problem so I can test it? VM shouldn't be a problem, it works for me with Ubuntu and VM. And where do you put push/popGLStates? |
Do you want a similar architecture to my project, or just something that produces the problem? I placed the push/popGlStates as such:
I'm using SFML 2.1 |
Here is the minimum code that resembles my project architecture. If you need even less code, the example that issue #8 rose also affects me. Rendering sprites without push/popGLStates prevents the Imgui from rendering correctly. As it stands, on my end, the Imgui window does not get rendered correctly. |
In the morning (I reside in the USA), I will try updating SFML and see if the issue gets resolved. |
Hmm, that's pretty strange... looks like SFML somehow changes OpenGL in a weird state. :S |
I've updated to SFML 2.4.0. No more problems! It seems that the bugs you mentioned must have been messing with the ImGui window. Perhaps this is a solution for #8 as well. Thanks for taking the time to work through this with me! I really appreciate it. :) I'm going to close the issue. |
Nice! You're welcome. |
Uh oh!
There was an error while loading. Please reload this page.
Hello!
This might not be something that you, Elias, can find a solution for, considering that my project is rather large, but this is worth a shot in case a solution IS found and others have the same problem as me. :)
Following the tutorial you provided on your blog as an introduction to Imgui, I was able to create the sample window with no problem -- the text was rendering properly. However, upon using the same code in my own project, the text only renders as white blocks.
Clearly, this is an issue with either my code, or my makefile (but everything seems to be linking correctly). The functions in which the Imgui code is embedded are called in the correct order in which the Imgui window should be constructed.
Below is how I am using Imgui. Granted, this is only one file of many in my project (these functions are being called by a separate class). Is there something that I'm failing the understand about how the Imgui window gets constructed?
Note that TestState::update_imgui() is only being called once every frame, and "window.display()" is called outside of this file.
I will continue to dabble until I find a solution to my problem. I'm sure I'm doing something really dumb.
The text was updated successfully, but these errors were encountered: