Ogre (18) -- ogre + cegui: powerful user interface [12:08:28 | Author: Yan Chen] font size: large | medium | small cegui, the full name "Crazy Eddie's GUI system" is a dedicated user interface library, which is open-source and free of charge. It supports directx8 and directx9, in addition to being used as an ogre interface plug-in, it also supports another Free and Open Source 3D engine irrlicht. Because of its relatively powerful and flexible functions, the ogre development team has been recommending ogre users to use this cegui to develop user interfaces, and gradually abandoning the Ogre's overly simple GUI plug-ins. This is particularly emphasized in the statement of the coming new version of ogre 1.5, although this version still temporarily retains the built-in GUI system, however, ogre 1.5 will be the last version that retains the built-in GUI. Ogre seems to focus on developing towards a pure, yet collaborative and scalable graphics engine, thanks to its huge community support, many things can be achieved through plug-ins with more professional engines. The physical engine uses ode, tokamak, and novodex. The network engine uses opentnl, raknet, and enet. The sound engine uses fmod and openal, and this interface engine uses cegui. The advantage of plug-ins and ready-made modules is that they can focus on one aspect. It is not easy to develop a dirty game engine. The development of several of the most prestigious commercial engines on the market, unreal, RenderWare, and lithtech often take hundreds of years, and plug-ins are also used in these commercial engines. In this age, no one can create everything from scratch.
Cegui is based on Unicode, so it supports Chinese font display, but the input of Chinese characters is not yet resolved, because there are constant questions and applications from ogre + cegui users in China, chinese Input support may be under consideration.
The official website of cegui is here:
Crazy Eddie's GUI system
1. Download CVS from cegui
Use wincvs. For details about how to use it, refer to ogre (1) -- Obtain ogre.
(1) Select "cvshome" in the left column of the wincvs main interface ";
(2) select [admin]-[command line...] from the main menu, the "command line Settings" panel is displayed. In the upper input box of the "Settings" tab, enter the following command to log on:
CVS-D: pserver: anonymous@cvs.sourceforge.net:/cvsroot/crayzedsgui Login
In the displayed dialog box, press Enter.
(3) After successful login, the lower information bar of the wincvs main interface will display the following information:
* ***** CVS exited normally with code 0 *****
Code 0 indicates that the logon is successful. If the logon fails, code 1 is displayed.
(4) After successful login, open the "command line Settings" Panel again and enter and run the following command:
CVS-Z3-D: pserver: anonymous@cvs.sourceforge.net:/cvsroot/crayzedsgui Co cegui_mk2
The source code of CVS is downloaded. Wait until the download is complete.
(5) At this time, under "cvshome" in the left column of the wincvs main interface, a "cegui_mk2" folder is added. You can go to the hard disk F:/cvshome/cegui_mk2/and check that all the source code is there.
2. cegui library and DLL Compilation:
It is best to use vc7.1 of vs. NET 2003 for compilation. It supports both ogre and cegui well. Both vc7.0 and vc7.1 are supported.
(1) first download the dependencies required for compiling cegui, including header files and libraries. The download page is here:
Http://crayzedsgui.sourceforge.net/modules.php? Name = downloads & d_op = viewdownload & cid = 6
First downloadCegui Mk-2 Win32 dependencies: common filesThese are common header files;
Next, select the corresponding library based on your compiler version. For example, if I use VC. NET 2003, select download.Cegui Mk-2 Win32 dependencies: libs for msvc 7.1.
After downloading, extract the header file cegui_mk2-deps-common/dependencies/include and the library file cegui_mk2-deps-vc7.1/dependencies/lib these two directories are all copied to the cvshome/cegui_mk2/dependencies directory.
(2) set the working environment. Open. net or. NET 2003, select [tools]-[Options...] in the main menu, open the "options" Panel, select [project]-[VC ++ Directory] In the left directory, and add the following path under the include and Lib directories in the right column:
Include files:
X:/cvshome/cegui_mk2/dependencies/include
Library file:
X:/cvshome/cegui_mk2/dependencies/lib
Note that these entries are stored at the top of the directory list.
(3) OK. open cvshome/cegui_mk2/makefiles/Win32/VC ++ 7.1/cegui. SLN, select [generate]-[batch generate...] from the main menu, open the "batch generation" Panel, click the [select all] button on the right, and then click the [regenerate] button to start generating. Wait until the generation ends.
The *. dll file generated by compilation is in the cvshome/cegui_mk2/bin directory, and the *. Lib file is in the cvshome/cegui_mk2/lib directory.
After compilation, we need to add the include and Lib directories of cegui in the working environment of vs. Net to compile the cegui-related projects:
Include files:
X:/cvshome/cegui_mk2/include
Library file:
X:/cvshome/cegui_mk2/lib
3. Compile cegui example
(1) first download several cegui examples:
Http://crayzedsgui.sourceforge.net/modules.php? Name = downloads & d_op = viewdownload & cid = 5
The cegui under ogre-demo 4 and cegui under ogre-demo 7 contain source files. We select cegui under ogre-demo 4 to compile the file.
(2) decompress the demo after downloading it. Do not place the file directories in disorder and put them in the cvshome directory.
Double-click cvshome/ogre_gui_demo4/ceguiogre_testdriver1.sln to open the solution.
Due to the negligence of the cegui author, there are several redundant Lua. Lib files in the release project settings, which may cause the compilation failure because these libraries cannot be found. Therefore, we need to delete these libraries. Open the Project Properties of ceguiogre_demo4 and delete the [linker]-[input]-[Additional dependency] entry in the release Configuration Attribute.Liblua. Lib liblualib. Lib libluabind. LibThese databases.
(3) then generate.
The generated *. EXE file is in the release and debug directories of cvshome/ogre_gui_demo4. However, if you enable it now, it will certainly fail.
The first reason for the failure is that this demo uses the header file and library of the latest version of Ogre for compilation, but the release and debug directories are under the old version *. DLL, so you need to put the release of cvshome/ogrenew/samples/common/bin and all * in the DEBUG directory *. DLL copies to the release and debug directories of cvshome/ogre_gui_demo4. Use your latest version to overwrite the old version;
Then, *. DLL. There are two * In cvshome/cegui_mk2/dependencies/lib *. DLL, copy the xerces-c_2_5_0.dll to cvshome/ogre_gui_demo4/release, copy the xerces-c_2_5_0D.dll to cvshome/ogre_gui_demo4/debug.
Also, the *. dll of the cegui ontology must be copied in the cvshome/cegui_mk2/bin directory. * The. dll file name with _ d is the debug version.
OK. Now the example can be run.
As an application instance for cegui, you can download the following ogre particle editor to experience it:
Particle editor_alphademo