1
General / sfml2 with clang difference?
« on: February 20, 2013, 09:08:01 pm »
Hi,
I very recently installed SFML2.0 with clang. Earlier I used with gcc. And now I can see that the code, which used to work well when compiled with gcc now works only 80% correctly.
For example, if I don't import a system font earlier, the following code still produced results (it must be fetching default font somewhere), but with clang, the screen remains blank
sf::RenderWindow window(sf::VideoMode(1600,900), "Test");
sf::Text text("print me");
text.setPosition(sf::Vector2f(100, 100));
text.setCharacterSize(30);
text.setColor(sf::Color::Blue);
while (window.isOpen()) {
sf::Event e;
while (window.pollEvent(e)) {
if (e.type == sf::Event::Closed) {
window.close();
}
}
window.clear();
window.draw(text);
window.display();
}
Also, if I have a static texture, and in some class method, I prepare a temporary sprite out of it and draw on the window, I get nothing. It used to print that texture-image with gcc.
Are there any subtle differences I am missing?
(Of course, while I now use the SFML2.0 snapshot to compile for clang, I used the binary for mac osx for gcc earlier)
Thanks in advanced,
Nikhil
I very recently installed SFML2.0 with clang. Earlier I used with gcc. And now I can see that the code, which used to work well when compiled with gcc now works only 80% correctly.
For example, if I don't import a system font earlier, the following code still produced results (it must be fetching default font somewhere), but with clang, the screen remains blank
sf::RenderWindow window(sf::VideoMode(1600,900), "Test");
sf::Text text("print me");
text.setPosition(sf::Vector2f(100, 100));
text.setCharacterSize(30);
text.setColor(sf::Color::Blue);
while (window.isOpen()) {
sf::Event e;
while (window.pollEvent(e)) {
if (e.type == sf::Event::Closed) {
window.close();
}
}
window.clear();
window.draw(text);
window.display();
}
Also, if I have a static texture, and in some class method, I prepare a temporary sprite out of it and draw on the window, I get nothing. It used to print that texture-image with gcc.
Are there any subtle differences I am missing?
(Of course, while I now use the SFML2.0 snapshot to compile for clang, I used the binary for mac osx for gcc earlier)
Thanks in advanced,
Nikhil