Add option to warn if texture is missing when in debug mode
JohnSundell opened this issue Β· comments
John Sundell commented
We should make it easier to identify why a texture is not rendered on the screen. In TextureManager
, when an image for a texture couldn't be found, we should make it possible to either log an error to the console or to trigger an assert. This should be off by default but be configurable by the user:
Things to do:
- Make it possible to toggle an
errorMode
onTextureManager
(for example using an enum) that lets the user pick between no error, triggering an assert or logging an error if a texture is missing. - In
TextureManager
, when a texture can't be found, read the error mode and act accordingly. - This should only be evaluated in debug builds.
Good to know:
- All the texture loading code takes place in
TextureManager
. - The default behavior is currently to silently return
nil
when a texture is missing, this is what should optionally be changed.
Vijay Tholpadi commented
Will pick this one π
John Sundell commented
@vijaytholpadi Awesome π
Vijay Tholpadi commented
Issued PR: #72
John Sundell commented
Fixed by @vijaytholpadi in #72 π