@Elysia
I want to do something like this:
Code:
CSettings::GetInstance()->SetDefault("WindowTitle", PROGRAM_NAME);
I'd like to do it in screen.cpp and input.cpp, etc... so that the application defaults are set before main. Then I'd like main to start, and eventually request a setting value:
Code:
int main(...) {
// ...
int iWidth = CSettings::GetInstance()->GetValue<int>("ScreenWidth");
// ...
}
When GetValue is called for the first time, it will load the users setting file, and possibly replace any application default settings. It'll be up to me to keep any calls to GetValue inside main, but I can deal with that.
I could do this in main (a few ways i suppose) but all my default settings would have to be in one place. I'd rather have screen specific settings in the screen.cpp file, and I'd rather not have to remeber to call ScreenLoadDefaultSettings, etc... for each file.
@Codeplug?/Daved
I like that idea, I suppose I could put a "static CDefaultSettings DefaultSettings();" in each cpp, and make a virtual class in the settings header to help. I'd end up using some extra memory though.