I rewrote sample game from SFML Game Development book using C++ 11 standart. Specifically, I used uniform initialization syntax {} in constructor. But in one place it didn't work correctly.
Button::Button(const FontHolder& fonts, const TextureHolder& textures)
: mCallback{}
, mNormalTexture{textures.get(Textures::ButtonNormal)} // here
, mSelectedTexture{textures.get(Textures::ButtonSelected)}
, mPressedTexture{textures.get(Textures::ButtonPressed)}
, mSprite()
, mText{"", fonts.get(Fonts::Main), 16}
, mIsToggle{false}
{
mSprite.setTexture(mNormalTexture);
sf::FloatRect bounds = mSprite.getLocalBounds();
mText.setPosition(bounds.width / 2.f, bounds.height / 2.f);
}
Game works, but textures don't render on window. Instead of them there is only white rectangle. However, when I use old style () initialization everything is OK.
I use Code::Blocks with MinGW compiler (version is 4.5.2), Windows 7.
I wonder where is error? Maybe it is in MinGW?
Thank you.