Can I get rid of the standard .cfg files?
-
- Gnoblar
- Posts: 8
- Joined: Wed May 11, 2005 7:14 pm
- Location: Portugal
Can I get rid of the standard .cfg files?
I'm working on a new project using OGRE, and I intend to distribute my game with a classic Windows installer (something like setup.exe) that should install all my binary files (executables, gfx, sound, etc.) as well as any third party dependecies such as the subset of OGRE DLL's I'll be using.
My only problem is with the .cfg files, like plugins.cfg! I would prefer not to use them and have my own single config file (or even use the Windows registry)!
Can someone give me some ideas on how can I do that? I.e. how can I tweak OGRE so that it dosen't look for plugins.cfg nor any other .cfg file?
I tried implementing my own code to acomplish the same as the Root::showConfigDialog method, but it keeps looking for the plugins.cfg file!
Currently I'm just using Root::restoreConfig and creating my Root object with a saved copy of ogre.cfg and plugins.cfg files, renamed to something like ProjX.cfg and ProjXPlugins.cfg.
But that's not quite what I'm looking for! I want to use a single config file and actually I want the options that go into plugins.cfg to be "hardcoded" in my game, i.e. I always want to use DX9, a fixed resolution, and a predefined, pre-bunded set of plugins!
How can I "get rid of" the "standard" .cfg files????
Thanks in advance for your help!
My only problem is with the .cfg files, like plugins.cfg! I would prefer not to use them and have my own single config file (or even use the Windows registry)!
Can someone give me some ideas on how can I do that? I.e. how can I tweak OGRE so that it dosen't look for plugins.cfg nor any other .cfg file?
I tried implementing my own code to acomplish the same as the Root::showConfigDialog method, but it keeps looking for the plugins.cfg file!
Currently I'm just using Root::restoreConfig and creating my Root object with a saved copy of ogre.cfg and plugins.cfg files, renamed to something like ProjX.cfg and ProjXPlugins.cfg.
But that's not quite what I'm looking for! I want to use a single config file and actually I want the options that go into plugins.cfg to be "hardcoded" in my game, i.e. I always want to use DX9, a fixed resolution, and a predefined, pre-bunded set of plugins!
How can I "get rid of" the "standard" .cfg files????
Thanks in advance for your help!
--
CG
CG
-
- OGRE Retired Moderator
- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
You can get rid of it by looking at the code for meshviewer.
The code is @ ogreaddons.
The code is @ ogreaddons.

/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
-
- OGRE Retired Moderator
- Posts: 20570
- Joined: Thu Jan 22, 2004 10:13 am
- Location: Denmark
- x 179
It uses the registry, too.
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
-
- Gnoblar
- Posts: 8
- Joined: Wed May 11, 2005 7:14 pm
- Location: Portugal
-
- Greenskin
- Posts: 133
- Joined: Tue Oct 15, 2002 10:14 am
- Location: Helsinki, Finland
- x 1
Initialize Ogre::Root like this:
The first param default to "plugins.cfg", the second param to "ogre.cfg" and the third to "Ogre.log". By doing that you get no input or output from Ogre .. You might want the log however.
I do exactly what you are talking about and load the plugins hardcoded. Check the API docs for more details.
Code: Select all
new Ogre::Root("", "", "");
I do exactly what you are talking about and load the plugins hardcoded. Check the API docs for more details.
-
- Gnoblar
- Posts: 8
- Joined: Wed May 11, 2005 7:14 pm
- Location: Portugal
-
- Gnoblar
- Posts: 8
- Joined: Wed May 11, 2005 7:14 pm
- Location: Portugal
-
- Gnoblar
- Posts: 8
- Joined: Wed May 11, 2005 7:14 pm
- Location: Portugal
-
- Greenskin
- Posts: 133
- Joined: Tue Oct 15, 2002 10:14 am
- Location: Helsinki, Finland
- x 1
-
- Gnoblar
- Posts: 8
- Joined: Wed May 11, 2005 7:14 pm
- Location: Portugal
Hmm... I'll check the No-Op option, that's a good idea! In the meantime I notice that a not so uncommon technique is to delete the log file when the application terminates, but I don't like it! I intend to use the log file during development only but not for the releas version.
Thanks again for the ideas!
Thanks again for the ideas!
-
- Greenskin
- Posts: 133
- Joined: Tue Oct 15, 2002 10:14 am
- Location: Helsinki, Finland
- x 1
-
- OGRE Retired Team Member
- Posts: 3067
- Joined: Tue Feb 10, 2004 12:53 pm
- Location: The Netherlands
- x 1
-
- Gnoblar
- Posts: 8
- Joined: Wed May 11, 2005 7:14 pm
- Location: Portugal