SFML community forums

Help => Graphics => Topic started by: dpixel on August 27, 2013, 04:57:31 am

Title: Not a member of sf::Style?
Post by: dpixel on August 27, 2013, 04:57:31 am
I was messing around with this sample code and got this error...

H:\SFML_Projects\Sample1\main.cpp||In function 'int main()':|
H:\SFML_Projects\Sample1\main.cpp|6|error: 'FullScreen' is not a member of 'sf::Style'|
||=== Build finished: 1 errors, 0 warnings (0 minutes, 0 seconds) ===|


#include <SFML/Graphics.hpp>

int main()
{
    sf::RenderWindow window;
    window.create(sf::VideoMode(800, 600, 32), "A New Window", sf::Style::FullScreen);

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

If I take out the...    sf::Style::FullScreen  it works fine.

When I type sf::Style::  ...  I get   ...  __Unnamed  as my only option

I'm using codeblocks 12.11 and sfml 2.1

Thanks for any help on this.
Title: Re: Not a member of sf::Style?
Post by: Ixrec on August 27, 2013, 05:11:36 am
It's Style::Fullscreen, not Style::FullScreen.  Read the tutorials carefully.
Title: Re: Not a member of sf::Style?
Post by: dpixel on August 27, 2013, 01:27:37 pm
Thanks.

Does codeblocks have a probrem with SFML?  Why is it only giving me a choice of __Unnamed?  Is there anyway to have a list show up?
Title: Re: Not a member of sf::Style?
Post by: eXpl0it3r on August 27, 2013, 02:28:41 pm
Yes Code::Blocks has sometimes issues with resolving Enums, not sure why though. So you better learn the different enums (or know where to look them up) rather than trusting auto completion.
Title: Re: Not a member of sf::Style?
Post by: dpixel on August 27, 2013, 02:38:03 pm
Thanks.  Good to know.