Missing error report

In SDL_CreateTextureFromSurface, several different places return 0 without calling SDL_SetError, which can make figuring out what went wrong very difficult.

I can see one place only, if renderer is not created and/or not activated. Other “return 0” rely on error, which is set by other functions, like SDL_CreateTexture(), SDL_ConvertSurface(). And it is right, because these functions can set up more detailed error string, then upper-level function SDL_CreateTextureFromSurface().

As for first, try to grep “if (!renderer)” in SDL_video.c, and you will see a lot places, in which error string is not set in such case.
“Mason Wheeler” wrote in message news:451672.61113.qm at web53203.mail.re2.yahoo.com
In SDL_CreateTextureFromSurface, several different places return 0 without calling SDL_SetError, which can make figuring out what went wrong very difficult.------------------------------------------------------------------------------


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Yeah, I figured that one out. I submitted a fix to Bugzilla as #761.

I can see one place only, if renderer is
not created and/or not activated. Other “return 0” rely on error, which is set
by other functions, like SDL_CreateTexture(), SDL_ConvertSurface(). And it is
right, because these functions can set up more detailed error string, then
upper-level function SDL_CreateTextureFromSurface().

As for first, try to grep "if (!renderer)"
in SDL_video.c, and you will see a lot places, in which error string is not set
in such case.
“Mason Wheeler” <@Mason_Wheeler> wrote inFrom: mike@malva.ua (Mike Gorchak)
Subject: Re: [SDL] Missing error report

message news:451672.61113.qm at web53203.mail.re2.yahoo.com
In SDL_CreateTextureFromSurface, several different places return 0
without calling SDL_SetError, which can make figuring out what went wrong very
difficult.