Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Not a member of sf::Style?  (Read 1421 times)

0 Members and 1 Guest are viewing this topic.

dpixel

  • Newbie
  • *
  • Posts: 20
    • View Profile
Not a member of sf::Style?
« 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.

Ixrec

  • Hero Member
  • *****
  • Posts: 1241
    • View Profile
    • Email
Re: Not a member of sf::Style?
« Reply #1 on: August 27, 2013, 05:11:36 am »
It's Style::Fullscreen, not Style::FullScreen.  Read the tutorials carefully.

dpixel

  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: Not a member of sf::Style?
« Reply #2 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?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10914
    • View Profile
    • development blog
    • Email
Re: Not a member of sf::Style?
« Reply #3 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.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

dpixel

  • Newbie
  • *
  • Posts: 20
    • View Profile
Re: Not a member of sf::Style?
« Reply #4 on: August 27, 2013, 02:38:03 pm »
Thanks.  Good to know.