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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - RadWayne

Pages: [1]
1
Graphics / Re: Creating a Vector of Shapes
« on: January 12, 2014, 03:14:54 am »
Nope.

It has something to do with SFML trying to free memory allocated for the vector. Someone else suggested I compile SFML on my own so I'm going to try that.

2
Graphics / Creating a Vector of Shapes
« on: January 10, 2014, 11:04:06 pm »
I have no problem creating and using shapes stored in a vector but when I try and close the window while using a shape stored in a vector I "trigger a breakpoint".
The error is being thrown from free.c from a  function used to free a memory block in the heap.

What exactly is happening and why is there a problem freeing memory?

int main()
{
   
    sf::RenderWindow window(sf::VideoMode(800, 600), "My window");
        sf::RectangleShape rect1(sf::Vector2f(100,50));
        rect1.setFillColor(sf::Color(255,0,0));
        std::vector <sf::RectangleShape> vectorRect(1);
        vectorRect[0]=rect1;

    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();
        }

                window.draw(vectorRect[0]);
        window.display();
    }

    return 0;
}

Pages: [1]