I am trying to use stb_tilemap_editor.h with sfml, And I have a few doubts
1.
| if (sf::Mouse::isButtonPressed(sf::Mouse::Left))
stbte_mouse_button(tilemap, mousePos.x, mousePos.y, 0, 1, 0, 0);
|
I am using this piece of code for clicking should I write a else condition for unclicking?
2.
| while(window.pollEvent(event))
{
if (event.type == sf::Event::MouseMoved)
{
mousePos = sf::Vector2i(event.mouseMove.x, event.mouseMove.y);
mousePos.x = mousePos.x * (640.0f / window.getSize().x);
mousePos.y = mousePos.y * (480.0f / window.getSize().y);
stbte_mouse_move(tilemap, mousePos.x, mousePos.y, 0, 0);
}
}
|
because of the while loop the above code becomes laggy, how do i handle this?
If anyone else have integrated this with sfml, please help me figure this out
Thanks.