Ogre1.7.2 + cegui0.7.5 environment configuration [reprinted] You need to prepare your own Basic Environment

Source: Internet
Author: User
Tags visual studio 2010
Ogre1.7.2 + cegui0.7.5 Configuration

Reprinted, please describe the source!

Http://blog.csdn.net/zhanghua1816/article/details/6650509

 

Since many of my friends are learning about ogre or cegui, but many of them have many problems with how to configure these two environments, I will briefly introduce the configuration method here and hope it will be useful to you, sharing is a pleasure. You can make progress together ~~~. My method here may not be the simplest configuration method, but I believe this configuration method may be more useful to you, so that you can better understand the entire configuration idea.

Note: The version used in this configuration method isWindows XP + ogre1.7.2 + cegui0.7.5(By the end of this article, the latest version of ogre is 1.7.3 and the latest version of cegui is 0.7.5. The reason why ogre1.7.2 is used is that I usually use this version, in addition, I use Visual Studio 2008 and have not configured ogre1.7.3 in Visual Studio 2010. However, according to the following method, I believe that the configuration of these two latest versions should be similar and there will be no major problems, in addition, I have not tested it on Windows 7, so it is not clear so far that there will be any errors. It should be no big problem with the system. If you have any questions during the configuration process, please contact us !)

Before configuration, You need to download the following files:

(I believe you can find this. I don't need to say it !)

(I believe you can also find this. You can download it on the Microsoft official website! Http://www.microsoft.com/download/en/details.aspx? Displaylang = en & id = 6812)

(This ogre official website has now updated to version 1.7.3. Note that we are building it through the source code. Do not download the error. If you want to download the version 1.7.2, you can find it on the official website)

 

First, install visualstudio2008 and directx2010. After installation, configure ogre and cegui:

Ogre1.7.2 Configuration

(There are two ogre Configuration Methods: one is to directly use the official website SDK, this configuration method is relatively simple; the other is to build through source code, to facilitate future viewing and modification of the source code, this installation uses the source code build method), decompress the Ogre SRC compressed file to the specified directory, as we use:

,

Then add the Ogre dependency Library to the following directory:

Then open it based on your vs version:

ClickGenerate ---- generate a solution, Compile the debug and release of the dependent library, as shown below:

Download and install cmake. After installation, open the following interface and set the Ogre decompression path in "whereis the source code" and "whereto build the binaries,

 

Click Configure and select the vs version as follows:

 

After you click Finish, if you cannot Click Generate, click Configure and generate to generate ogre. SLN. If some red errors are prompted after you click Configure, find ogre_dependencies_dir and change its value to path/dependencies. The generated result is displayed in the following directory:


Open ogre. sln and compile the debug and release of ogre. After the compilation is successful, find in the solution column.Samplebrowser,Right-click and selectSet as startup projectAnd then click Ctrl + F5 (or click the menu bar ---Debugging ---- start debugging) Run the program. After the program is started, the interface is as follows. In the rendering subsystem column, select OpenGL or DirectX to start the program. There are other options below (such as whether to display the program in full screen). You can choose the one you want:

 

Click OK. If the following page is displayed, the configuration is correct:


 

If both the debug and release modes run successfully, the ogre configuration is basically complete and you can proceed to the next step.


 

Cegui0.7.5 Configuration:

 

Decompress the cegui compressed file to any directory, as shown in the following figure:

 

Then add the cegui dependency Library to the following directory:

 

Then go to the following directory:


 

Use a text editor (for better display, we recommend that you useUltraeditOpen a text editor with strong functions.) OpenConfig. Lua,Find the following lines:


 

Changed :(Note: The specific directory is determined based on your own ogre installation directory.)


 

Find the cegui_old_ois_api variable and set it to false (The default value of this version is false.)

Locate the ogre_renderer variable and set it to true.

Locate the samples_ogre variable and set it to true.

 

As follows:

 

Save this file!

Then enter the Directory D: \ CEGUI-0.7.5 \ projects \ premake, run build_vs2008.bat (or corresponding to another version), you will see cegui. SLN, continue to run build_samples_vs2008.bat (or another version), you will see ceguisamples. SLN;

Note: To make the following compilation successful, you need to configure the directories required in vs2008. The specific process is as follows:

 

Right-click my computer --- properties --- advanced --- environment variable and create the environment variable ogre_home, as shown below:

 


After this environment variable is configured, we can directly use the Ogre root directoryOgre_homeThis environment variable is replaced (of course, we only define oneOgre_homeVariable, you can also defineCegui_homeTo replace the cegui root directory. Note that it is best to restart vs2008 after environment variables are defined, because sometimes vs may not recognize the newly defined environment variables)

 

 

At the same time, it is best to determine whether there is a DirectX environment variable: dxsdk_dir (it is automatically added when DirectX is installed by default. If not, it is best to manually create a variable name: dxsdk_dir variable value: D: \ ProgramFiles \ Microsoft DirectX SDK (June 2010) \ (this depends on the DirectX installation directory ))

 

 

Open vs2008 and select the menu bar:Tools --- options

The following dialog box is displayed: (make sure that the execution path of DirectX is configured in the executable file. This option is automatically added after DirectX is installed by default, if not, you need to manually add it as follows:


 

SimilarlyInclude filesConfiguration path:


 

Similarly, inLibrary filesThe configuration is as follows:

 

Go to the following directory (depending on your own cegui installation directory), open cegui. sln, select the debug and release models, and compile

After the compilation is successful, the ceguisamples. debug and release of SLN are compiled separately. After the compilation is successful, you can view the cegui. for instances in SLN, you can select a project and right-click it to set it as a startup project, as shown below:


Then run. Normally, such a dialog box will pop up (Don't worry ~~~) :

 

The solution is as follows:

ToD: \ CEGUI-0.7.5 \ dependencies \ bin(Depending on the installation directory of your own cegui) the following files are displayed in this directory:


For ease of use, you can copy all DLL files in this directory:D: \ CEGUI-0.7.5 \ bin(Depending on the installation directory of your own cegui ).D: \ ogre \ ogre_src_v1-7-2 \ bin \ debug and D: \ ogre \ ogre_src_v1-7-2 \ bin \ release(Based on your own ogre installation directory) Copy ogremain_d.dll, ois_d.dll, ogremain. dll, and Ois. DLLD: \ CEGUI-0.7.5 \ bin(Depending on the installation directory of your own cegui) in this directory, run the sample project again, you can see the following startup interface, choose openglrenderer or DirectX to run:

The following dialog box is displayed:


Select all projects in the solution column and right-click ---- properties:

 

Then select Configuration properties ---- debugging:


 

In the working directory bar, select the drop-down menu, select Browse, and find the datafiles folder corresponding to cegui:


 

Click "OK" to run the task again. If the preceding method is used, you can run the task successfully ~~~~

The effect is as follows:


 

In this way, the cegui is configured.

The last thing we need to do is to test whether the previous configurations are correct through code.First, for the convenience of coding, we also need to install a plug-in. As you know, we have an Application Wizard when creating an MFC application, you can use simple configuration to generate a lot of basic code. You can also use ogre to run this executable file to install it. After the installation is successful, open vs2008 and click: file ---- New ----- project ------ click visual c ++ to see the Ogre Application Wizard:

 

Enter a project file name, click "OK", and follow the prompts to successfully create a simple ogre application. Compile the application and run it. The following running result is displayed:


 

This simple ogre program is ready!

Of course, we don't have to use this application to think of plug-ins. In normal cases, we can create a Win32 application, but we only need to make some configuration.

The last thing we need to do is to combine ogre and cegui. As this part involves writing a lot of code, therefore, I will not list the specific methods here (in this case, I will be able to go through the tutorials, huh, and I will try again later). Here is a website, there are a lot of basic ogre teaching. If you want to learn it, you can study it here. The seventh teaching in this article is to teach you how to integrate ogre and cegui. The website is:

Http://www.ogre3d.org/tikiwiki/tiki-index.php? Page = Basic % 20 tutorials, some header files may be imported in different locations, but note that it is okay to import the header files according to the installed path, through this teaching, I believe that you will be able to really run your first program that combines ogre and cegui, and wish you success!

Although I have already written a lot of details about the configuration method, I cannot write every possible error because everyone's computer is always having one or another problem, if you have any questions, please contact us. My email address is [email protected] (If You Are the One, thank you !)

 

Ogre1.7.2 + cegui0.7.5 environment configuration [reprinted] You need to prepare your own Basic Environment

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.