Saving and loading the configuration file
Building our configuration file starts with the decision of what needs to be stored and how we want to store the elements. By reusing our custom data types like the InstanceSettings
, creating the functions to save and load a file can be simplified. Now we no longer have to read each value individually, but we can use calls like getInstanceSettings()
and setInstanceSettings()
from the AssimpInstance
class to transfer the values directly between the parser and the instance.
We will start by exploring what we want to save, and after adding the code to write our custom data to the file, a user interface dialog will be added, allowing a simple way to save the file to disk. Finally, we will step through the process of loading the configuration back into the application.
Deciding what to store in the configuration file
As mentioned in the Saving and loading textual data section, adding a version number can help a lot during the development...