Fixed problem with wrongly initialized sf::RenderStates::Default

This static variable depended on the global variable sf::BlendAlpha, which may not be constructed yet.
This commit is contained in:
Jan Haller 2014-05-01 00:35:55 +02:00
parent cdf32a7881
commit 0c3d361ceb

View File

@ -32,7 +32,11 @@
namespace sf namespace sf
{ {
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////
const RenderStates RenderStates::Default; // We cannot use the default constructor here, because it accesses BlendAlpha, which is also global (and dynamically
// initialized). Initialization order of global objects in different translation units is not defined.
const RenderStates RenderStates::Default(BlendMode(
BlendMode::SrcAlpha, BlendMode::OneMinusSrcAlpha, BlendMode::Add,
BlendMode::One, BlendMode::OneMinusSrcAlpha, BlendMode::Add));
//////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////