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

Author Topic: Can't draw a sf::Text when having culling enabled.  (Read 2165 times)

0 Members and 1 Guest are viewing this topic.

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
Can't draw a sf::Text when having culling enabled.
« on: May 10, 2011, 12:57:45 am »
Well I think it was working before so might be something else being wrong but here's what I've narrowed it down to.

While I was struggling with loading in an OBJ file I noticed that my FPS counter wasn't showing anymore, tried to boil it down to that wrong context was on( since the window is created in main and passed to another thread ) but no that was not the problem. Then I just thought... What if the vertexes are written wrong? So I removed these lines:

Code: [Select]

glEnable( GL_CULL_FACE );
glCullFace( GL_BACK );


And my test was able to display my sf::Text, sf::Sprite AND my own model. Though the question is, why did the culling go over to the sprites? Am I doing something wrong? I am using PreserveStates.

Code: [Select]
if( myShowFPS == true )
{
myContext.Prepare2DView(); // <- Simply wraps SFML
sf::Text fps( ConvertToString< float >( 1 / delta ) );
fps.SetPosition( 1, 1 );
myContext.Render( fps );
myContext.Prepare3DView(); // <- Simply wraps SFML
}




How it looks when rendered correctly. When it was incorrect both the sprite and the text disappeared. Nevermind the low FPS, I get some spikes then and then when it drops(usually lies around 700-1000 for this), probably my threading that needs a look at.
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

 

anything