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

Author Topic: class sf::Sprite has no member named GetGlobalBounds SFML2.0  (Read 2739 times)

0 Members and 1 Guest are viewing this topic.

reDo

  • Full Member
  • ***
  • Posts: 104
    • View Profile
class sf::Sprite has no member named GetGlobalBounds SFML2.0
« on: December 30, 2011, 07:24:47 pm »
I have SFML 2.0, and I have this code, but it says error
 'class sf::Sprite' has no member named 'GetGlobalBounds'|
what am I doing wrong please?
Code: [Select]
#include <SFML/System.hpp>
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
#include <iostream>

int main()
{
    sf::RenderWindow App(sf::VideoMode(800,800,32),"SFML");
    App.SetFramerateLimit(60);
    sf::Texture Tex;
    Tex.LoadFromFile("quad.png");
    Tex.SetSmooth(false);
    sf::Sprite pic(Tex);
    pic.SetOrigin(50,50);
    float x=400, y=300;
    pic.SetPosition(x,y);
    float angle=0;
    while(App.IsOpened())
    {
        App.Clear();
        sf::Event event;
        while(App.PollEvent(event))
        {
            if((event.Type == sf::Event::KeyPressed) && (event.Key.Code == sf::Keyboard::Escape)) App.Close();
            if(sf::Keyboard::IsKeyPressed(sf::Keyboard::Left))
                angle--;
            if(sf::Keyboard::IsKeyPressed(sf::Keyboard::Right))
                angle++;
        }
        pic.SetRotation(angle);
        App.Draw(pic);
        sf::FloatRect c = pic.GetGlobalBounds();
        App.Display();
    }

    return 0;
}




Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
class sf::Sprite has no member named GetGlobalBounds SFML2.0
« Reply #1 on: December 30, 2011, 07:47:38 pm »
Update from Git, recompile SFML, make sure that you're not using other SFML headers, etc. ;)
Laurent Gomila - SFML developer

reDo

  • Full Member
  • ***
  • Posts: 104
    • View Profile
class sf::Sprite has no member named GetGlobalBounds SFML2.0
« Reply #2 on: January 01, 2012, 07:26:32 pm »
Recompiling latest verison helped :)

 

anything