mirror of
https://github.com/SFML/SFML.git
synced 2025-01-19 15:55:13 +08:00
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:
parent
cdf32a7881
commit
0c3d361ceb
@ -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));
|
||||||
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
|
Loading…
Reference in New Issue
Block a user