1
Graphics / Black line sometimes appears when moving view
« on: November 24, 2012, 12:30:46 am »
Hi,
I've just started using SFML 2.0RC and I've encountered a small problem when moving my view. Here is my view move code, which is simply adapted from the 1.6 tutorial:
It's set to only run at 100 FPS, because if it gets too high view.move just does nothing (even with non-zero numbers).
When holding the key to constantly move, you can occasionally see a black vertical line on the screen. Usually it does not stay, but I managed to stop the view while it was visible. This screenshot was taken while the view was not moving.
http://i.imgur.com/GNBYC.png
Is there something I might be doing to cause this? Right now my sprite code is very simple, I'm just setting their position once and drawing them each frame.
I've just started using SFML 2.0RC and I've encountered a small problem when moving my view. Here is my view move code, which is simply adapted from the 1.6 tutorial:
Code: [Select]
if ( elapsed_time > 1/100.0f )
{
// Move the view using arrow keys
float Offset = 800.f * elapsed_time;
if (sf::Keyboard::isKeyPressed(sf::Keyboard::Up)) view.move( 0, -Offset);
if (sf::Keyboard::isKeyPressed(sf::Keyboard::Down)) view.move( 0, Offset);
if (sf::Keyboard::isKeyPressed(sf::Keyboard::Left)) view.move(-Offset, 0);
if (sf::Keyboard::isKeyPressed(sf::Keyboard::Right)) view.move( Offset, 0);
It's set to only run at 100 FPS, because if it gets too high view.move just does nothing (even with non-zero numbers).
When holding the key to constantly move, you can occasionally see a black vertical line on the screen. Usually it does not stay, but I managed to stop the view while it was visible. This screenshot was taken while the view was not moving.
http://i.imgur.com/GNBYC.png
Is there something I might be doing to cause this? Right now my sprite code is very simple, I'm just setting their position once and drawing them each frame.