I've read a few reviews about SMFL, in particular, sf::RenderTexture having some issues with older intel drivers, maybe this is applying towards me too? =(
GPU spec: (Displays interpretation)
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) 852GM/855GM x86/MMX/SSE2
OpenGL version string: 1.3 Mesa 10.1.3
sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
sf::CircleShape shape(100.f);
shape.setFillColor(sf::Color::Green);
sf::RenderTexture rt;
sf::Sprite s;
rt.create(200,200);
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
}
rt.clear();
rt.draw(shape);
rt.display();
s.setTexture(rt.getTexture());
window.clear();
window.draw(s);
window.display();
}
I've encounter an distorted graphics error on my larger project and decided to reproduce this "behavior" with the simple getting started code above; the changes were with drawing the shape first to renderTexture then to the renderWindow.
The resulting graphics behavior I am receiving is a single green line going vertically in the window; whereas you would normally get a green circle.
Help please.
My larger project is producing the same behavior. I would like to not avoid renderTexture; the larger project draws many objects to the screen and would be better off drawn on multiple render textures, with effects.
You were both right, that I did not have the newest version; I wasn't aware myself and did not know that the command line installation wasn't up to date. I couldn't even determine what version I was on even though I had all the files ha ha.
Sorry for all the trouble, everything is working great now.
I'm still learning my way into linux, so I have a question... Does newer versions of (L)ubuntu provide different versions of SFML or are they all being distributed versions < 2.2? Are all the repositories the same?
If they're all being distributed lower versions of SFML, this problem might occur again in the future because the SFML linux installation tutorial may be suggesting a not up to date version through the method of CLI installation.
http://www.sfml-dev.org/tutorials/2.3/start-linux.php
Choice #1: command line installation was preferred by the tutorial, for ease I understand.
Everything is fine now.
But, it'd be nice if the tutorial leaves a note stating which version should be expected, or heck, maybe have a builtin variable somewhere in the header that allows the user to print the value.
Example:
std::cout<<"The SFML version number is: "<<sf::Version::VALUE<<std::endl
A version number in the header, within the namespace Version and being a global const static variable called VALUE.
Thanks a lot everyone.
Edit:
Ubuntu Package Search
Interesting, it shows the version number on the Ubuntu Package Search.
I installed it using the tutorials from SFML so I was never aware of the version.
Knowing the version number would've helped a lot.
Like this?
std::cout << SFML_VERSION_MAJOR << "." << SFML_VERSION_MINOR << "." << SFML_VERSION_PATCH << std::endl;
;)