{"action":"created","issue":{"url":"https://api.github.com/repos/fallahn/sfml-tmxloader/issues/28","labels_url":"https://api.github.com/repos/fallahn/sfml-tmxloader/issues/28/labels{/name}","comments_url":"https://api.github.com/repos/fallahn/sfml-tmxloader/issues/28/comments","events_url":"https://api.github.com/repos/fallahn/sfml-tmxloader/issues/28/events","html_url":"https://github.com/fallahn/sfml-tmxloader/issues/28","id":60219349,"number":28,"title":"Draw only visible tiles","user":{"login":"makao95","id":11295543,"avatar_url":"https://avatars.githubusercontent.com/u/11295543?v=3","gravatar_id":"","url":"https://api.github.com/users/makao95","html_url":"https://github.com/makao95","followers_url":"https://api.github.com/users/makao95/followers","following_url":"https://api.github.com/users/makao95/following{/other_user}","gists_url":"https://api.github.com/users/makao95/gists{/gist_id}","starred_url":"https://api.github.com/users/makao95/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/makao95/subscriptions","organizations_url":"https://api.github.com/users/makao95/orgs","repos_url":"https://api.github.com/users/makao95/repos","events_url":"https://api.github.com/users/makao95/events{/privacy}","received_events_url":"https://api.github.com/users/makao95/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-03-07T18:57:33Z","updated_at":"2015-04-19T17:02:02Z","closed_at":null,"body":"In ```void LayerSet::draw(sf::RenderTarget& rt, sf::RenderStates states) ```\r\nfunction draws every tile, even when it's not visible. \r\n```rt.draw(&m_vertices[0], static_cast<unsigned int>(m_vertices.size()), sf::Quads, states);```\r\nI know that sfml propably won't draw tiles which are outside of screen, but even looping through every tile in layer slows down application when using large tilemaps. For example in my project FPS drop about 30% (140 FPS when map is 50x50 and 100 FPS when 200x100). I use tiled layer for background. *I know that framerate is low, but i also use some demanding shaders.*\r\n\r\nSince tiles are always in grid, it wouldn't be very hard to use that property and draw only visible tiles (especially when tiles would be stored in 2D array/vector)."},"comment":{"url":"https://api.github.com/repos/fallahn/sfml-tmxloader/issues/comments/94296394","html_url":"https://github.com/fallahn/sfml-tmxloader/issues/28#issuecomment-94296394","issue_url":"https://api.github.com/repos/fallahn/sfml-tmxloader/issues/28","id":94296394,"user":{"login":"fallahn","id":5619252,"avatar_url":"https://avatars.githubusercontent.com/u/5619252?v=3","gravatar_id":"","url":"https://api.github.com/users/fallahn","html_url":"https://github.com/fallahn","followers_url":"https://api.github.com/users/fallahn/followers","following_url":"https://api.github.com/users/fallahn/following{/other_user}","gists_url":"https://api.github.com/users/fallahn/gists{/gist_id}","starred_url":"https://api.github.com/users/fallahn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fallahn/subscriptions","organizations_url":"https://api.github.com/users/fallahn/orgs","repos_url":"https://api.github.com/users/fallahn/repos","events_url":"https://api.github.com/users/fallahn/events{/privacy}","received_events_url":"https://api.github.com/users/fallahn/received_events","type":"User","site_admin":false},"created_at":"2015-04-19T17:02:02Z","updated_at":"2015-04-19T17:02:02Z","body":"OK, thanks for your effort. When you have it more complete I shall definitely consider merging this"}}