1
Graphics / Port app from 1.6 to 2.1. Now sf::Text isn't rendering
« on: December 03, 2013, 08:01:56 am »
Hey there,
I've just ported my fairly large application from SFML 1.6 to 2.1 and I've run into a bit of trouble when I go to render my sf::Text in a sf::RenderWindow.
==== Problem ====
- Under no circumstance does render_window->draw(my_sf_text); draw the text
==== Things i've checked/tried ====
- I have loaded a font and assigned it to my sf::Text
- I have verified that the font is loaded correctly by binding the sf::Texture of the font and pasted it on to a glBegin(GL_QUADS) region. This displays all the glyfs of the characters in my string.
- My GUI agent for rendering text is reporting the correct size of the font via .getLocalBounds()
- I have tried drawing some fresh text completely outside of all abstractions written in my program:
// Setup
sf::Text my_text;
my_text.setFont(*Forms::default_font);
my_text.setCharacterSize(24);
my_text.setColor(sf::Color::Red);
my_text.setStyle(sf::Text::Regular);
my_text.setPosition(500, 100);
my_text.setString("abcdefghijklnmopqrstuvwxyz1234567890 ");
// In main loop
// ...
// Setup view
App->pushGLStates();
App->draw(my_text);
App->popGLStates();
// ...
App->display();
- If I neglect to pushGLStates(), then it alters the state of opengl so that the rest of my graphics are corrupted, so I know that it's doing something.
==== Important notes (I think): ====
- I am making use of glew and initialize it after my RenderWindow has been created.
==== Question ====
- Are there any differences from 1.6 to 2.1 that I'm over looking that may lead to this?
- Is there some kind of conflict with glew in this case?
I'm sorry but I can't paste all relevant code as it's huge. If you want me to break down all of the code I'm using specifically for drawing fonts I can.
Thanks a bunch!
I've just ported my fairly large application from SFML 1.6 to 2.1 and I've run into a bit of trouble when I go to render my sf::Text in a sf::RenderWindow.
==== Problem ====
- Under no circumstance does render_window->draw(my_sf_text); draw the text
==== Things i've checked/tried ====
- I have loaded a font and assigned it to my sf::Text
- I have verified that the font is loaded correctly by binding the sf::Texture of the font and pasted it on to a glBegin(GL_QUADS) region. This displays all the glyfs of the characters in my string.
- My GUI agent for rendering text is reporting the correct size of the font via .getLocalBounds()
- I have tried drawing some fresh text completely outside of all abstractions written in my program:
// Setup
sf::Text my_text;
my_text.setFont(*Forms::default_font);
my_text.setCharacterSize(24);
my_text.setColor(sf::Color::Red);
my_text.setStyle(sf::Text::Regular);
my_text.setPosition(500, 100);
my_text.setString("abcdefghijklnmopqrstuvwxyz1234567890 ");
// In main loop
// ...
// Setup view
App->pushGLStates();
App->draw(my_text);
App->popGLStates();
// ...
App->display();
- If I neglect to pushGLStates(), then it alters the state of opengl so that the rest of my graphics are corrupted, so I know that it's doing something.
==== Important notes (I think): ====
- I am making use of glew and initialize it after my RenderWindow has been created.
==== Question ====
- Are there any differences from 1.6 to 2.1 that I'm over looking that may lead to this?
- Is there some kind of conflict with glew in this case?
I'm sorry but I can't paste all relevant code as it's huge. If you want me to break down all of the code I'm using specifically for drawing fonts I can.
Thanks a bunch!