Reputation: 65
I'm making a game with C++/SFML on a windows platform(7). I have saving and loading down but currently if you want to load a world you must type the name of the folder that world is saved in exactly. My goal is to have the game display a list of the folders within the "saves" directory and have the player select one, loading the correct world. What I need help with is the displaying the folders part, How would i search the "saves" directory and then get the names of all the folders in there, all I need is the name of all the folders.
if its necessary, or would help, here is my current build:
https://docs.google.com/file/d/0BwIyLLkXSiakSUxuM2FpWGhUdGc/edit
click: file->download, or ctrl+s, to download
Upvotes: 0
Views: 46
Reputation: 35440
In Windows, you can use the FindFirstFile() and FindNextFile() API functions.
http://msdn.microsoft.com/en-us/library/windows/desktop/aa365200%28v=vs.85%29.aspx
Upvotes: 1