Hi,
when I debug my app i get following assertion failed errors:
File: D:\developpement\sfmp-master\src\SFML..\Texture.cpp
Line: 315
Expression: x + width <= m_size.x
Assertion failed
File: D:\developpement\sfmp-master\src\SFML..\Texture.cpp
Line: 316
Expression: y + height <= m_size.y
Assertion failed
It happens both with static and dynamic libs on debug exe. I don't even have that D:\developpement dir on my disk.
Release build works without any problems when linked statically (however it gives error memory cant be read after exiting while using dynamic sfml libs). I don't use any other libs.
I can't give minimal code because it crashes the debugger just after opening window (it doesn't make it to draw loop, if I ignore both errors I just get white screen in my draw loop). So I have no idea how to track what's exactly wrong (I don't have experience with using debuggers), I just want to know what may be the reason of those sfml error and I will track it myself.
In one topic I found that those errors happen when texture is too big for gpu, but my gpu is 6870 and I use only 30x30 textures and 30 text size (And I don't render to texture).
Thanks
IMPORTANT EDIT:Well, I got it. It may be sfml bug I think?
Here's the code with that error. Compile it as debug with debug graphics, window and system libs. SFML 2 ofc.
#include <SFML/Graphics.hpp>
sf::Image emptyImage;
sf::Texture emptyTexture;
int main()
{
emptyImage.create(50, 50, sf::Color::White);
emptyTexture.update(emptyImage);
return 0;
}
Doing this makes asserts errors in debug builds. I think that doing this shouldn't result in error. Is it meant to be this way? I checked source code and I understand why that assert is there, however I think it doesn't always work (as you see in above code). Lauren, could you look into it? Thanks
There should be function to set width and height of texture, something like setSize or overloaded constructor. Empty texture is very useful, for example resource manager (when render asks for texture which doesn't exist (ie file was deleted), it's a good idea to return empty texture rathen than crash entire application).