libsdl-org / SDL

Simple Directmedia Layer
https://libsdl.org
zlib License
8.72k stars 1.64k forks source link

SDL_Vulkan_CreateSurface() return value? #10091

Closed slouken closed 1 week ago

slouken commented 2 weeks ago

SDL_Vulkan_CreateSurface() returns SDL_bool unlike most other SDL functions. Is this modeled after another API or just an oversight that we should fix for SDL3?

icculus commented 1 week ago

I think this was an oversight, I'm cleaning it up now.

slouken commented 1 week ago

I think this was an oversight, I'm cleaning it up now.

FWIW, if I had to do it all over again, I would have all the SDL functions return bool, but changing all the error handling for every function is probably too big a change for SDL 3.0 :)

icculus commented 1 week ago

is probably too big a change for SDL 3.0 :)

The ultimate muscle memory! Not to mention literally everything would cleanly compile but every function call would look like it failed...I think we're committed to it for SDL3, SDL4, and on.

slouken commented 1 week ago

Yeah, it just hurts so much to see lots and lots of application code doing this:

if (!SDL_Function()) {
    // succeeded
}