hello all, i have problems with vertical syncing and screen tearing when running my app on PC with Ubuntu 12.10 installed, GPU is nvidia gtx 275 card, drivers are 304.41. I cant get rid of excessive screen tearing, using window.setVerticalSyncEnabled(true); changes nothing at all. i red that ubuntu have some problems with nvidia drivers so it may be ubuntu issue not sfml but the only place where it happens is my sfml app. Here is minimal code sample, niebo.png resolution is 2048x2048:
#include <SFML/Audio.hpp>
#include <SFML/Graphics.hpp>
#include <sstream>
int main()
{
float czas1;
float klatki;
sf::Vector2f vfklatki;
sf::Vector2i viklatki(0,0);
sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window",sf::Style::Fullscreen);
window.setVerticalSyncEnabled(true);
sf::Clock clock1;
sf::Texture texture;
texture.loadFromFile("niebo.png");
sf::Sprite sprite;
sprite.setTexture(texture);
sf::View view;
view.reset(sf::FloatRect(800,600,800,600));
window.setView(view);
sf::Font font;
font.loadFromFile("FreeMono.ttf");
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if ((event.type == sf::Event::KeyPressed)&&(event.key.code==sf::Keyboard::Escape))
window.close();
}
clock1.restart();
window.clear();
window.draw(sprite);
if (sf::Keyboard::isKeyPressed(sf::Keyboard::Left))
view.move(-1000.0f*czas1,0.0f);
if (sf::Keyboard::isKeyPressed(sf::Keyboard::Right))
view.move(1000.0f*czas1,0.0f);
if (sf::Keyboard::isKeyPressed(sf::Keyboard::Up))
view.move(0.0f,-1000.0f*czas1);
if (sf::Keyboard::isKeyPressed(sf::Keyboard::Down))
view.move(0.0f,1000.0f*czas1);
window.setView(view);
vfklatki = window.mapPixelToCoords(viklatki);
klatki = 1/czas1;
std::stringstream ss;
ss << klatki;
std::string myString = ss.str();
sf::Text text(myString,font,50);
text.setPosition(vfklatki);
window.draw(text);
window.display();
sf::Time time1 = clock1.getElapsedTime();
czas1 = time1.asSeconds();
}
return EXIT_SUCCESS;
}
btw, there is no change in documentation about changing convertCoords function to mapPixelToCoords.
I would be very grateful for confirming or denying if on your Ubuntu installations there is the same issue.