-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Update documentation to reflect the recommended way SDL_StorageReady()
should be used
#12400
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
base: main
Are you sure you want to change the base?
Conversation
…()` should be used (addresses libsdl-org#12201)
* bool quit = false; | ||
* while (!quit) { | ||
* // This part is key: You must keep polling events when waiting on | ||
* // storage to be ready (SDL_StorageReady() returns true). Events |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* // storage to be ready (SDL_StorageReady() returns true). Events | |
* // storage to be ready (SDL_StorageReady() returns true). Event |
* | ||
* // Game/graphics/sound/etc. logic here, only using data known to | ||
* // already be valid right now. Logic would set readGameDataNow and/or | ||
* // saveDataOp when needed, then could wait for them every logic tick |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's a tick?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A single step of updating the game logic. In classical 60 FPS games, it'd be a single frame.
So this got much more complicated. We can create an article with the storage best practices, but is there a way to simplify this? |
Yeah, this needs to move to the wiki if it needs this much code. |
The example code had to get a bit bigger, since demonstrating the proper usage pattern for
SDL_StorageReady()
requires showing a main loop with the readiness checking inside.