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

Author Topic: [SOLVED] Class::sf Problem  (Read 1346 times)

0 Members and 1 Guest are viewing this topic.

torenf

  • Newbie
  • *
  • Posts: 29
    • View Profile
    • Email
[SOLVED] Class::sf Problem
« on: November 16, 2013, 12:48:31 pm »
Hi guys,
I compiled SFML and was tested a little programm:

#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
#include <iostream>

int main()
{
    sf::RenderWindow Window(sf::VideoMode(800, 600, 32), "SFML Sample Application");

    while (Window.IsOpened())
    {
    sf::Event Event;
    while (Window.PollEvent(Event))
    {
    switch (Event.Type)
    {
    case sf::Event::Closed: Window.Close(); break;
    default: break;
    }
    }

    Window.Clear(sf::Color(0, 255, 255));
    Window.Display();
    }

return 0;
}


but it sayed:

error: 'class sf::RenderWindow' has no member named 'IsOpened'
error: 'class sf::RenderWindow' has no member named 'PollEvent'
error: 'class sf::Event' has no member named 'Type'
error: 'class sf::RenderWindow' has no member named 'Close'
error: 'class sf::RenderWindow' has no member named 'Clear'
error: 'class sf::RenderWindow' has no member named 'Display'

and i dont know why??
I linked the libs and include from SFML but it dont compile :(
Sincerly Toren




« Last Edit: November 16, 2013, 01:29:10 pm by torenf »

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Class::sf Problem
« Reply #1 on: November 16, 2013, 01:19:53 pm »
SFML 2 uses a different naming convention, all functions start with lowercase letters.

Check out this page, and make sure you read the tutorials and API documentation of version 2.1.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

torenf

  • Newbie
  • *
  • Posts: 29
    • View Profile
    • Email
Re: Class::sf Problem
« Reply #2 on: November 16, 2013, 01:28:54 pm »
Thanks so much :D

 

anything