Hello, I am a object oriented programming newbie and I've encountered a weird problem while trying to make a level class. My application crashes every time I try to draw a level object, here is the code I'm using:
virtual void draw(sf::RenderTarget &target,sf::RenderStates states) const
{
states.transform *=getTransform();
states.texture = m_texture;
target.draw(m_vertices,states); //Crashes here
}
During debug I receive an SIGSEGV segmentation fault signal when that specific line is executed. If I disable it the program runs as expected. m_vertices is a sf::VertexArray and m_texture is a sf::Texture pointer.
Also it doesn't matter if I constructed a mesh inside the vertex array or not, it still crashes. I've used the exact same piece of code for another class and it works just fine.
I really don't know what the problem could be and some help would be appreciated.
Thanks in advance, regards Antonio.