SFML community forums
Help => Graphics => Topic started by: Tank on March 25, 2011, 08:40:48 am
-
Hi guys,
it just happened to me that when enabling GL_CULL_FACE (with GL_BACK), SFML won't display its stuff anymore.
A workaround is to disable culling around the SFML rendering, however I'm just wondering if that should happen in SFML itself. Of course it means another call every cycle, I don't know how high the impact is.
Greetings.
-
There are many OpenGL states that can mess up SFML rendering, so I chose to not set explicitely those that have a correct default value, to avoid unnecessary overhead.
If you start using OpenGL on top of SFML, use the dedicated functions to save and restore OpenGL states.
-
Alright, just what I thought. I'll keep in manual then to avoid saving states that I don't need to. Thanks.
-
Hi,
I don't know for the rest of SFML (2.0) rendering, cause I use it's native functions only to draw text, but here we go:
glEnable (GL_CULL_FACE);
glCullFace(GL_BACK);
//glFrontFace(GL_CCW); This is an OpenGL's default
window->Draw(text); // doesn't render anything
glFrontFace(GL_CW);
window->Draw(text); // but this works fine
That means it's safe to assume that at least for text quads SFML uses wrong winding order. I think it should be considered a bug, Laurent :)
-
That's right ;)
But the problem is not about what GL states SFML uses, it's more about how it interacts with user GL states. This will be improved soon.