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

Author Topic: sfml2 with clang difference?  (Read 1600 times)

0 Members and 1 Guest are viewing this topic.

njoshi3

  • Newbie
  • *
  • Posts: 4
    • View Profile
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

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: sfml2 with clang difference?
« Reply #1 on: February 20, 2013, 09:24:56 pm »
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 :(
The default font has been removed a few month ago, seems like your GCC version was a bit outdated.

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.
I've no idea what you're talking about here. :-\

Are there any subtle differences I am missing?
You can take a look at the commit history to see all the changes that where made, which might be quite a few, depending on how old your previous version was.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

FRex

  • Hero Member
  • *****
  • Posts: 1848
  • Back to C++ gamedev with SFML in May 2023
    • View Profile
    • Email
Re: sfml2 with clang difference?
« Reply #2 on: February 20, 2013, 09:27:00 pm »
Default font was removed long time ago, this is intended.
Back to C++ gamedev with SFML in May 2023

 

anything