1
Graphics / Re: Is the alpha of default colors different in debug and release configurations?
« on: December 28, 2023, 12:03:37 pm »
After looking into it further. I was having any predefined sf::Color become 0,0,0,0 regardless of what it was.
so sf::Color test = sf::Color::Black would have values (r=0,g=0,b=0,a=0)
BUT only in places where I happened to be initalising before main().
To test I put, above main(), this:
And I knew about these kind of ordering issues, but I'd never expect it with predefined values of something as simple a a color. And it was extremely weird that it would work in release but not in debug.
My confusion now is that I don't know what bad assumption I made, I thought the two lines I wrote above would always be identical, and yet they are not?
Anyway hope this helps someone else avoid a headache from this!
so sf::Color test = sf::Color::Black would have values (r=0,g=0,b=0,a=0)
BUT only in places where I happened to be initalising before main().
To test I put, above main(), this:
Quote
sf::Color mainTest = sf::Color::Black; //results in 0,0,0,0
sf::Color mainTest2 = sf::Color(0, 0, 0); //results in 0,0,0,255
And I knew about these kind of ordering issues, but I'd never expect it with predefined values of something as simple a a color. And it was extremely weird that it would work in release but not in debug.
My confusion now is that I don't know what bad assumption I made, I thought the two lines I wrote above would always be identical, and yet they are not?
Anyway hope this helps someone else avoid a headache from this!