| Summary: | Documentation request: functions can be called without SDL_Init(), especially SDL_GetBasePath() and SDL_GetPrefPath() | ||
|---|---|---|---|
| Product: | SDL | Reporter: | LGB <lgblgblgb> |
| Component: | file | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED INVALID | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | CC: | sylvain.becker |
| Version: | 2.0.5 | ||
| Hardware: | All | ||
| OS: | All | ||
|
Description
LGB
2017-09-04 19:04:45 UTC
It may work for one platform and not the other... maybe you could do : SDL_Init() with no sub-system GetPrefPath() SDL_Quit() Thanks for the tip. Can I assume, that with SDL_Init(0) before my getpath stuff, and SDL_Quit() after it makes a situation as it wouldn't been any SDL call yet? Since it can also happen that I don't want to initialize SDL (based on the the content of the configuration file, whose path is known with SDL_GetPrefPat) at all, and I wouldn't like to interference with anything. Also, if it turns out I need SDL, I assume, I can use SDL_Init() later again (of course not with argument of zero then!). I've checked this and seems to work (on Linux), but I would like to be sure, if this behaviour is correct expectation, works on all platforms, and will be in the future too. But anyway, thanks for your comment, so there is no point for my ticket here to update the documentation, since it's really not safe to use these functions without SDL_Init(), and for being safe, I need something like the trick you've mentioned. Yep, that should be safe. If it's not, that would be a bug, and you can report it here. |