SFML community forums
Help => General => Topic started by: Sumzary on July 25, 2013, 07:55:59 pm
-
Hi!
I have a program made with Qt that looks like this:
(http://oi42.tinypic.com/n396o5.jpg)
Then the binds should be exported to an xml file and imported by the game on startup.
How would I go about doing that?
-
Should? This smells of homework. Have you checked the logo on the top right of the forum? This has nothing to do with SFML. Just get an XML parser, learn XML, and do it yourself.
-
What I am asking is how would I convert the strings in the xml to the enums in SFML and the other way around.
-
SFML doesn't provide such conversion functions, but Thor (http://www.bromeon.ch/libraries/thor/v2.0/doc/_input_names_8hpp.html) does.
The problem is, to convert between enums and strings in C++, you have to list every single case explicitly -- that's why I included this boilerplate code to Thor, hoping that not everybody has to reinvent the wheel ;)
-
Ooh, thanks a whole bunch Nexus, it would have taken AGES otherwise.
Thanks again :D