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

Author Topic: Declaring VertexArray in class.  (Read 1080 times)

0 Members and 1 Guest are viewing this topic.

Sasha

  • Newbie
  • *
  • Posts: 2
    • View Profile
Declaring VertexArray in class.
« on: April 01, 2014, 05:24:06 pm »
I would like to declare VertexArray in class

class ramka
{
  public:
 sf::VertexArray ramkaa(sf::Triangles, 3);
     void positioning();
     void draw();
};
 

But this shows error like "'sf::Triangles' is not a type|" . If im declaring it in void draw(); then there is no problem, but i would to have it like globally in class. How can i do this?

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Re: Declaring VertexArray in class.
« Reply #1 on: April 01, 2014, 05:30:31 pm »
Declare it only in the class without initialization, and use the constructor initializer list for initializatino.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

Sasha

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Declaring VertexArray in class.
« Reply #2 on: April 01, 2014, 06:01:06 pm »
Thank you very much, it has worked ^^


 

anything