fallahn / tmxlite

lightweight C++14 parser for Tiled tmx files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Blinking between tiles in SFML Demo

DmitruMoth opened this issue · comments

So, problem is here:
map.zip
blinking

This is a well documented issue with SFML vertex arrays, rather than the map loader itself. This post has some details why it happens: https://en.sfml-dev.org/forums/index.php?topic=15338.0 (or just search for SFML tile tearing)

A good solution I've found is to render the map with a shader, like this https://github.com/SFML/SFML/wiki/Source%3A-ShaderTileMap

How can i implement this to existing sfml demo?

Short answer: not easily, it would pretty much be a re-write. The example is really just that: an example. Have you tried some of the suggested solutions in the forum topic, such as rounding your view's position to the neareset whole pixel? You could also render the visible set of chunks to a render texture first, then use that to make a sprite which you can scroll.

Thanks, i will try to fix this problem
p.s. rounding make it worse