Hi, trying to build this sample code to test SFML for coding a simple racing game but running into errors.
But I have errors I can't solve.
'sf::RenderWindow::RenderWindow': no overloaded function could convert all the argument types
'sf::WindowBase::pollEvent': function does not take 1 arguments
'sf::Event': no appropriate default constructor available
'<function-style-cast>': cannot convert from 'initializer list' to 'sf::VideoMode'
'type': is not a member of 'sf::Event'
Any help is much appreciated.
Code:
#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;
}Quote:
'sf::RenderWindow::RenderWindow': no overloaded function could convert all the argument types
'sf::WindowBase::pollEvent': function does not take 1 arguments
'sf::Event': no appropriate default constructor available
'<function-style-cast>': cannot convert from 'initializer list' to 'sf::VideoMode'
'type': is not a member of 'sf::Event'