1
Window / Re: sf::Mouse::getPosition lags behind the mouse curser
« on: September 03, 2016, 09:26:09 pm »
Ok, thanks for your answers.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
sf::Window::setMouseCursorVisible(false).
setPosition(sf::Vector2f(window.mapPixelToCoords(sf::Mouse::getPosition(window))));
window.draw(sprite);
which calls sf::RenderTarget::draw and then sf::Sprite::draw. In this draw function I'm accessing the sprites data members m_origin, m_position, m_rotation and so on through the call to sf::Transformable::getTransform().#include <SFML/Graphics.hpp>
int main()
{
sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
sf::CircleShape shape(100.f);
shape.setFillColor(sf::Color::Green);
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
}
window.clear();
window.draw(shape);
window.display();
}
return 0;
}
#include <SFML/Graphics.hpp>
int main()
{
sf::Vector2f vec;
vec.x = 8;
std::cout << vec.x << std::endl;
return 0;
}
#include <SFML/Graphics.hpp>
int main()
{
sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
return 0;
}