Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use SDL3's Storage API for Save Data? #104

Open
NoelFB opened this issue Oct 10, 2024 · 1 comment
Open

Use SDL3's Storage API for Save Data? #104

NoelFB opened this issue Oct 10, 2024 · 1 comment

Comments

@NoelFB
Copy link
Collaborator

NoelFB commented Oct 10, 2024

I'm not sure about this yet, but SDL3 introduced a new Storage API that would be good for Save Data across platforms (desktop, consoles, web, etc). It may make sense to modify our UserStorage to use this as the backing implementation.

https://wiki.libsdl.org/SDL3/CategoryStorage

@NoelFB
Copy link
Collaborator Author

NoelFB commented Dec 16, 2024

I partially implemented this in the SDL3/GPU branch here: fd83d4b

However there are some bugs with SDL that make this a bit hacky/unstable right now, particularly around their SDL_GlobStorageDirectory method which returns full paths, instead of virtual relative paths. I've hacked around it for now but I need to look into either fixing this in SDL or waiting for it to be resolved.

The other caveat is the SDL storage API requires you to wait for it to be ready (and not spinlock wait on the main thread), so I've implemented a wrapper around that before returning the actual Storage object to the user ... I think that's the easiest solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant