Hi, I think I have done something wrong but can't find what.
I have recorded video (attachment) of what is happening as it will be easiest way to show what I mean.
First (and most important): if I move my cursor some black circle is going around cursor.
My main loop is:
while (renderWindow->isOpen())
{
sf::Event event;
while (renderWindow->pollEvent(event))
{
// close window
if (event.type == sf::Event::Closed)
renderWindow->close();
// update title with mouse position
if (event.type == sf::Event::MouseMoved)
{
// update title
auto mouseWorldPos = renderWindow->mapPixelToCoords(sf::Vector2i(event.mouseMove.x, event.mouseMove.y));
std::stringstream title;
title << Config::Window::Title.toAnsiString() << " -";
title << " X: " << mouseWorldPos.x;
title << " Y: " << mouseWorldPos.y;
renderWindow->setTitle(title.str());
}
// resize view of render window when resized
if (event.type == sf::Event::Resized)
{
sf::FloatRect visibleArea(0.f, 0.f, static_cast<float>(event.size.width), static_cast<float>(event.size.height));
renderWindow->setView(sf::View(visibleArea));
}
if (windowCallback)
windowCallback->onEvent(event);
}
renderWindow->clear(Config::Window::ClearColor);
if (windowCallback)
windowCallback->onRender();
renderWindow->display();
}
and I draw RectangleShapes in a loop like (it's
windowCallback->onRender()):
// [...] just assign sf::Vector2f gridSize, gridPositionStart and int verticalLinesCount
sf::RectangleShape lineShape;
lineShape.setSize(sf::Vector2f(1.f, gridSize.y));
for (int i = 0; i < verticalLinesCount; i++)
{
lineShape.setPosition(gridPositionStart.x + i * Config::Grid::GridSpace, gridPositionStart.y);
Render->draw(lineShape);
}
Render is just RenderWindow.
I'm not sure where is a problem.
I'm using SFML 2.2
static with VS2013 Community.
Windows 8.1 x64 with GTX 970.