Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: glCullFace makes SFML blind  (Read 2822 times)

0 Members and 1 Guest are viewing this topic.

Tank

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1486
    • View Profile
    • Blog
    • Email
glCullFace makes SFML blind
« 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.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
glCullFace makes SFML blind
« Reply #1 on: March 25, 2011, 08:57:52 am »
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.
Laurent Gomila - SFML developer

Tank

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1486
    • View Profile
    • Blog
    • Email
glCullFace makes SFML blind
« Reply #2 on: March 25, 2011, 10:52:56 am »
Alright, just what I thought. I'll keep in manual then to avoid saving states that I don't need to. Thanks.

niyaro

  • Newbie
  • *
  • Posts: 1
    • View Profile
glCullFace makes SFML blind
« Reply #3 on: June 23, 2011, 01:56:09 pm »
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:
Code: [Select]

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 :)

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
glCullFace makes SFML blind
« Reply #4 on: June 23, 2011, 02:08:51 pm »
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.
Laurent Gomila - SFML developer