diff --git a/src/SFML/Graphics/RenderStates.cpp b/src/SFML/Graphics/RenderStates.cpp index 2ec3fb895..093d902d6 100644 --- a/src/SFML/Graphics/RenderStates.cpp +++ b/src/SFML/Graphics/RenderStates.cpp @@ -32,7 +32,11 @@ 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)); ////////////////////////////////////////////////////////////