SFML community forums

Help => Graphics => Topic started by: Sasha on April 01, 2014, 05:24:06 pm

Title: Declaring VertexArray in class.
Post by: Sasha 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?
Title: Re: Declaring VertexArray in class.
Post by: Nexus on April 01, 2014, 05:30:31 pm
Declare it only in the class without initialization, and use the constructor initializer list for initializatino.
Title: Re: Declaring VertexArray in class.
Post by: Sasha on April 01, 2014, 06:01:06 pm
Thank you very much, it has worked ^^