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 - hanik

Pages: [1]
1
General / Re: C++ 11 compatibility
« on: August 27, 2014, 09:12:36 pm »
As you mentioned, c++ 11 is a new language, so is it reasonable to learn to write code in this new laguage, instead of old one?

2
General / Re: C++ 11 compatibility
« on: August 27, 2014, 08:21:16 pm »
Thanks for your replies!
I am already using Code::Blocks/VS2012 interchangeably. But I will consider VS2013 also!

3
General / C++ 11 compatibility
« on: August 24, 2014, 06:33:09 pm »
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.

Pages: [1]
anything