Quantcast
Channel: CodeGuru Forums - Visual C++ Programming
Viewing all articles
Browse latest Browse all 3046

SFML errors

$
0
0
Hi, trying to build this sample code to test SFML for coding a simple racing game but running into errors.

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;
}

But I have errors I can't solve.

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'
Any help is much appreciated.

Viewing all articles
Browse latest Browse all 3046

Trending Articles