zzzzzzzz
#include <SFML/Graphics.hpp>
int main()
{
sf::RenderWindow window(sf::VideoMode(1024, 600), "SFML works!? No");
window.setVerticalSyncEnabled(true);
sf::Vector2f pos(0,0);
sf::Vector2f pos2(2048,0);
sf::Texture img;
img.loadFromFile( "test.png" );
img.setSmooth( false );
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
}
pos.x -= 0.5f;
pos2.x -= 0.5f;
if(pos.x + 2048 < 0)
pos.x = pos2.x + 2048;
if(pos2.x + 2048 < 0)
pos2.x = pos.x + 2048;
sf::Sprite sr(img);
sr.setPosition(pos);
sf::Sprite sr2(img);
sr2.setPosition(pos2);
window.clear(sf::Color::Yellow);
window.draw(sr);
window.draw(sr2);
window.display();
}
return 0;
}
Test asset:
https://dl.dropbox.com/u/9649932/test.pngHow to test: compile and run, stare at it literally for 30-60seconds, focus please, and tell me whether the movement is fluid and smooth as toddler's arse or choppy and jerky for whatever reason