I'm trying to make a game. But when I tried to load and use map (I'm using this lib to load map made in Tiled ->
http://trederia.blogspot.co.uk/2013/05/tiled-map-loader-for-sfml.html) it starts tearing like on the images listed below(first image is normal the second is the problem). There is the code that have this problem
#include <tmx/MapLoader.h>
#include <SFML/System.hpp>
#include <SFML/Graphics.hpp>
#include <iostream>
using namespace sf;
using namespace tmx;
using namespace std;
void main()
{
RenderWindow mWindow(VideoMode(640,480),"");
MapLoader mlvl("");
if (!(mlvl.Load("stage1.tmx")))
{
cout << "Map error";
}
Clock clock;
while (mWindow.isOpen())
{
float time = clock.getElapsedTime().asSeconds();
clock.restart();
Event event;
while (mWindow.pollEvent(event))
{
if (event.type == Event::Closed)
mWindow.close();
}
View view = mWindow.getView();
view.move(Vector2f(0.1*time, 0.1*time));
mWindow.setView(view);
mWindow.clear();
mWindow.draw(mlvl);
mWindow.display();
}
}
So, can someone say where I need to dig?
P.S. There is archive with map and tile sheet if you want to run this code.
Sorry for my English i'm using google translate