// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need.
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
// Change the registry key under which our settings are stored.
// TODO: You should modify this string to be something appropriate
// such as the name of your company or organization.
SetRegistryKey(_T("Skin"));
LoadStdProfileSettings(10); // Load standard INI file options (including MRU)
loadOptions_();
// Register the application's document templates. Document templates
// serve as the connection between documents, frame windows and views.
int CSkinApp::ExitInstance()
{
saveOptions_();
return CWinApp::ExitInstance();
}
void CSkinApp::loadOptions_()
{
unsigned int red,green,blue;
// Gl back color
red = GetProfileInt("OpenGL back color","Red",0);
green = GetProfileInt("OpenGL back color","Green",0);
blue = GetProfileInt("OpenGL back color","Blue",0);
m_OptionColorGlBack = RGB(red,green,blue);
// Gl light ambient color
red = GetProfileInt("OpenGL light ambient color","Red",200);
green = GetProfileInt("OpenGL light ambient color","Green",200);
blue = GetProfileInt("OpenGL light ambient color","Blue",200);
m_OptionColorGlLight = RGB(red,green,blue);
// Gl back color
red = GetRValue(m_OptionColorGlBack);
green = GetGValue(m_OptionColorGlBack);
blue = GetBValue(m_OptionColorGlBack);
WriteProfileInt("OpenGL back color","Red",red);
WriteProfileInt("OpenGL back color","Green",green);
WriteProfileInt("OpenGL back color","Blue",blue);
// Gl light ambient color
red = GetRValue(m_OptionColorGlLight);
green = GetGValue(m_OptionColorGlLight);
blue = GetBValue(m_OptionColorGlLight);
WriteProfileInt("OpenGL light ambient color","Red",red);
WriteProfileInt("OpenGL light ambient color","Green",green);
WriteProfileInt("OpenGL light ambient color","Blue",blue);