-
Notifications
You must be signed in to change notification settings - Fork 176
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
[Linux] Rendering a sprite in the same window garbles dialog text #8
Comments
Whoops, I didn't know this was necessary, but surrounding the sprite rendering calls with |
I don't think that closes the issue! Try drawing the sprite before the ImGui::Render(), it should work correctly. I've never drawn sprites after ImGui so never had problems like this (and btw, your code works okay on Windows) Does swapping ImGui::Render() and window.draw(sprite) works for you? |
I tried calling ImGui::Render both ways, before and after rendering the sprite. The result was the same. It works fine for me too on Windows and OSX. Just Linux seems to have a problem. |
Hmm, that's pretty strange. What SFML are you using? Maybe SFML is the problem... (though it's probably my fault, he-he, just want to be sure that I'll be able to reproduce the problem on my PC) |
Im using SFML 2, not sure of the minor versions. I did find this however, that indicates that you must manually preserve the OpenGL states when you mix SFML and OpenGL. |
You can check version of SFML in Config.hpp, like this. SFML 2.3.2. is the most stable, maybe there were previously bugs related to this in SFML. And yes, I preserve OpenGL state and I'm not sure what I'm doing wrong at the moment but I'll try to fix it (I need to have reproducible fail at first, though.) |
Cannot reproduce on Ubuntu 16.04, sfml 2.3.2, g++ 6.1.1 Are you using a Linux in a VM? Of course I am not using the same sprite as you do. Can you test with a PNG or share you image.jpg? |
I'm running Ubuntu 14.04 natively, with g++ 4.8 IIRC. (It actually stopped booting up Saturday evening, which may have had something to do with this too. That's also why I couldn't verify the minor SFML version.) If I can get my linux computer to boot up again, I'll attach the image.jpg that I used. However, I saw the same problem with multiple different sprites. I noticed the problem in a game I'm working on, and then reproduced it in the demo to eliminate more variables. I did notice that this code does try to preserve the GL state, but at that point, my SFML rendering code has already run, which could have corrupted the GL state. In the SFML docs, they said you needed to push the GL states before doing any SFML rendering. That's why I closed the issue. :) I'm happy to keep troubleshooting though if you still think there may be something wrong in imgui-SFML. (Assuming I can get my computer running again. 😛 |
Okay, I'll close this for now, if there's a problem with ImGui-SFML, feel free to reopen/open new issue. :) |
Ok, thanks! |
Without rendering
sf::Sprite
:With rendering
sf::Sprite
:This is taken directly from the sample program, but with a few lines added to load/render the sprite.
The only difference between the two screenshots was commenting out
window.draw(sprite)
.Have you seen this before?
The text was updated successfully, but these errors were encountered: