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 - no name

Pages: [1]
1
Graphics / Re: Can't add sf::Text to STL containers?
« on: August 11, 2016, 01:08:50 am »
This works fine for. I assume you must have some bad configuration. Do you use debug libs in release mode or release libs in debug mode? What's your compiler? What's your OS?

Yep, problem was on my end, got it resolved (forgot to update the DLL files).

Thanks and sorry for wasting your time!

2
Graphics / Can't add sf::Text to STL containers?
« on: August 11, 2016, 12:09:37 am »
I just upgraded to the latest version of SFML in the hopes of fixing a small problem, but it seems like I've just created a much bigger one. I was able to put sf::Text objects in vectors in the old version but now doing so causes my program to crash.

This code causes a bad_alloc error:

Code: [Select]
#include <SFML/Window.hpp>
#include <SFML/Graphics.hpp>
#include <SFML/System.hpp>

int main()
{
     sf::Text t;
     std::vector<sf::Text> vec;
     vec.push_back(t);
     return 0;
}

Pushing a sf::Sprite object into a vector of Sprites works fine. Only sf::Text is causing this issue. sizeof(sf::Text) is 260 bytes while sizeof(sf::Sprite) is 272 bytes so I don't think it has anything to do with memory shortage.

Did I install something wrong or can we not put sf::Text objects in containers?

Pages: [1]