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

Author Topic: sf::Shape Pointer ?  (Read 1164 times)

0 Members and 1 Guest are viewing this topic.

Ptlomej

  • Newbie
  • *
  • Posts: 48
    • ICQ Messenger - 353167418
    • View Profile
    • Local
sf::Shape Pointer ?
« on: February 21, 2012, 03:38:57 pm »
Using SFML 1.6
Visual C++

Code: [Select]

sf::Shape S1 = sf::Shape::Circle(sf::Vector2f(X,Y),sf::Randomizer::Random(2,20),sf::Color::White);
sf::Shape *S2 = new [u]sf::Shape::Circle[/u](sf::Vector2f(X,Y),sf::Randomizer::Random(2,20),sf::Color::White);


The underline is the Error ?

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
sf::Shape Pointer ?
« Reply #1 on: February 21, 2012, 03:45:08 pm »
sf::Shape::Circle is not a type, it's a function. The result is always a sf::Shape.

Code: [Select]
sf::Shape *S2 = new sf::Shape;
*S2 = sf::Shape::Circle(sf::Vector2f(X,Y),sf::Randomizer::Random(2,20),sf::Color::White);
Laurent Gomila - SFML developer

Ptlomej

  • Newbie
  • *
  • Posts: 48
    • ICQ Messenger - 353167418
    • View Profile
    • Local
sf::Shape Pointer ?
« Reply #2 on: February 21, 2012, 04:00:36 pm »
Thank you i doesnt know that but now works fine ;)