| Summary: | Patch that adds hint to disable the idle timeout on iOS | ||
|---|---|---|---|
| Product: | SDL | Reporter: | Tim Angus <tim> |
| Component: | video | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | enhancement | ||
| Priority: | P2 | CC: | icculus |
| Version: | HG 2.0 | ||
| Hardware: | iPhone/iPod touch | ||
| OS: | iOS (All) | ||
| Attachments: |
Patch that adds hint to disable the idle timeout on iOS
Patch that adds hint to disable the idle timeout on iOS Alternative patch that just adds the missing file |
||
This is now hg changeset 3ecad5e5dbe4, thanks! --ryan. Whoops, this patch didn't include SDL_hints_c.h ... can you add that file to this bug report so I can fix the build? --ryan. Created attachment 626 [details]
Patch that adds hint to disable the idle timeout on iOS
New patch, now including SDL_hints_c.h. I've got so used to Xcode's svn integration (which auto adds new files to source control) that I completely forgot about the new files. Apologies again.
Created attachment 627 [details]
Alternative patch that just adds the missing file
And here is a patch that just adds the file I missed, without the rest of the changes.
Thanks, this is in the repo now! --ryan. |
Created attachment 621 [details] Patch that adds hint to disable the idle timeout on iOS iOS will timeout after about 45 seconds with no input and dim the screen, then subsequently lock the phone. This is fine for applications that always have touch input, but games often use the accelerometer alone. Accelerometer inputs are not counted towards preventing the idle timeout, so if this is the primary means of control, the idle timer must be disabled. This patch adds a hint SDL_IOS_IDLE_TIMER_DISABLED in order to do this. I found I needed to add a callback facility to the hint system in order to notify any interested parties when a particular hint value changed. This was necessary as there isn't really a convenient place to periodically check the hint value on the iOS port of SDL and only checking the hint once on start up means you can't toggle the setting later on. It's probably quite a useful addition for future hints though, so I don't feel too bad about it.