I won't talk about making ogre controls. It's not complicated. Just do it by controls. It was originally done to call other programs. There is no problem,
Yesterday, we needed to make it called in the browser. The trouble was coming. Here we will share with you, so that the new TX will soon avoid the same old path.
In IE, calling is mainly about the path,
When ogre is initialized by default, the paths of the called plugins. cfg, ogre. cfg, ogre. log, and resources. cfg are all called in the current directory of the program,
Once it is called through a browser, take ie as an example. I thought it would first find all the directories of the IE browser program, namely c: \ Program Files \ Internet Explorer,
Later, the test found that it is not from this directory to find these configuration files, but from the current directory, very strange, I printed the current directory, it turned out to be: C: \ Documents and Settings \ Administrator \ Desktop (the current directory may be changed due to various program operations)
Therefore, it creates ogre. log on the desktop, and Plugins. cfg, ogre. cfg, and resources. cfg cannot be found, so it crashes.
It is actually a waste of time, just to indicate a problem, that is, the path problem. The solution is very simple.
When calling these four files, specify an absolute path, for example:
Mroot = New Root ("C: \ test \ plugins. cfg", "C: \ test \ ogre. cfg", "C: \ test \ ogre. log ");
The same is true for resource configuration file calls. The absolute path is used.
Of course, I first query the directory where a control is located, and then find it in the directory where the control is located. The above path is just an example.
The first step is to solve the problem. The path of the configuration file is correct and the program can continue. Below are the paths of the specified plug-ins and resources in these configuration files,
Change the path to the absolute path:
For example, in plugins. cfg,
Pluginfolder = D:/acitivextest // change it to the directory where the actual plug-in is located
The same is true for resource. cfg. Just specify the absolute directory.
This is caused by great efforts and can be run.
This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/zhucde/archive/2011/01/09/6125090.aspx