How to call the Ogre control on a webpage

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.