Original address: http://blog.sina.com.cn/s/blog_6841a32d0100jtcw.html
Babe his daddy
I. Overview
For the game interface Development, Cegui is a good choice. However, Cegui and its related tools used a lot of third-party libraries, resulting in a more complex compilation steps, so that the new people do not. So I'm here to introduce Cegui 0.7.1 and the compilation of Ceimageseteditor and Celayouteditor. Hope to be able to prepare to learn Cegui of children's shoes are helpful:)
Second, prepare
We need to use
0. DirectX 9 SDK, this find yourself
1. Cegui 0.7.1,:http://prdownloads.sourceforge.net/crayzedsgui/cegui-0.7.1.zip?download
2. Cegui 0.7.1 precompiled Dependencies for VC + + 2008, because Cegui use a lot of third-party libraries, their own compilation is very troublesome, and generally we do not make changes to these libraries, so borrow compiled files on it.
:
Http://prdownloads.sourceforge.net/crayzedsgui/CEGUI-DEPS-0.7.x-r1-vc9.zip?download
You can also use Cegui 0.7.1 precompiled SDK for msvc++ 2008:
Http://prdownloads.sourceforge.net/crayzedsgui/CEGUI-SDK-0.7.1-vc9.zip?download
3. WxWidgets 2.8.11, open source cross-platform GUI library, Ceimageseteditor and celayouteditor used it.
:
Http://prdownloads.sourceforge.net/wxwindows/wxMSW-2.8.11-Setup.exe
4. Ceimageseteditor 0.7.1,:
Http://prdownloads.sourceforge.net/crayzedsgui/CEImagesetEditor-0.7.1.tar.gz?download
5. Celayouteditor 0.7.1,:
Http://prdownloads.sourceforge.net/crayzedsgui/CELayoutEditor-0.7.1.tar.gz?download
Third, compiling Cegui
0. Prepare the Cegui, CEGUI-SDK, and DirectX9 SDK
1. Unzip the downloaded Cegui, CEGUI-SDK (dependencies)
2. Copy the Dependencies folder in CEGUI-SDK (dependencies) to the Cegui directory (same as datafiles sibling). There are many. h,. lib, and. dll files that we do not use and can be deleted as appropriate
3. Copy the include and Lib files from the DirectX9 SDK to the Dependencies folder, where I have the following DX-related directory hierarchies:
\cegui-0.7.1\
Dependencies\
Dx90sdk\
Include\
Lib\
3. Modify the Config.lua file in Cegui, I only use freeimage here, so I set the other encoder to False
----------------
--Image Codecs
--this controls which image codecs is built
Tga_image_codec = False
Silly_image_codec = False
Devil_image_codec = False
Freeimage_image_codec = True
Corona_image_codec = False
--This setting selects the default image codec module
--can be either "TGA", "silly", "devil", "Freeimage" or "Corona"
--SILLY was written for Cegui
Default_image_codec = "Freeimage"
4. Modify the Helpers.lua file to add the include path and Lib path of DirectX
4.1 Adding an include path to DX9
--Defaults
Package.includepaths =
{
RootDir. " Cegui/include ",
RootDir. " Dependencies/include ",
RootDir. " Dependencies/dx90sdk/include ",--add the include path to the DX9
}
4.2 Adding a dx9 lib path
--4.2.1-------------------------
debug.libpaths =
{
RootDir. " Dependencies/lib/dynamic ",
RootDir. " Dependencies/dx90sdk/lib ",
}
--4.2.2-------------------------
debug.libpaths =
{
RootDir. " Dependencies/lib/dynamic ",
RootDir. " Dependencies/dx90sdk/lib ",
}
--4.2.3-------------------------
Debug_static.libpaths =
{
RootDir. " Dependencies/lib/static ",
RootDir. " Dependencies/dx90sdk/lib ",
}
--4.2.4-------------------------
release_sym.libpaths =
{
RootDir. " Dependencies/lib/dynamic ",
RootDir. " Dependencies/dx90sdk/lib ",
}
--4.2.5-------------------------
release.libpaths =
{
RootDir. " Dependencies/lib/dynamic ",
RootDir. " Dependencies/dx90sdk/lib ",
}
--4.2.6-------------------------
release_static.libpaths =
{
RootDir. " Dependencies/lib/static ",
RootDir. " Dependencies/dx90sdk/lib ",
}
4.3 Modify the lib file used by the linker (originally formulated as dxerr.lib, should actually be dxerr9.lib)
--4.2.7-------------------------
If Direct3d9_renderer Then
Library_static ("Dxguid")
Library_static ("d3dx9")
Library_static ("Dxerr9")
End
5. Modify Projects\premake\renderermodules\direct3d9\premake.lua
Library ("Dxerr9")--Originally for Dxerr
Library ("D3dx9", "D")
6. Run Build_vs2008.bat to generate the SLN and vcproj files
7. Open CEGUI.sln, generate
Iv. compiling Celayouteditor
0. Run Wxmsw-2.8.11-setup.exe, install wxwidgets;
Unzip the celayouteditor-0.7.1.tar.gz
1. Add environment variables cegui_7, ce_layout_editor_7, and wxwidgets_7, respectively, for Cegui, Celayouteditor, and wxwidgits paths
2. Modify the following statement in Wxwidgits Include\wx\msw\setup.h to turn on OpenGL support for wxwidgets (required for celayouteditor):
#define Wxuse_glcanvas 0
Revision changed to
#define Wxuse_glcanvas 1
3. Using VS2008 to open wx.dsw in BUILD\MSW under Wxwidgits, generate Unicode Debug and Unicode Release, respectively, when the conversion succeeds, which automatically generates lib\vc_lib\mswud\wx\ MSW and LIB\VC_LIB\MSWU\WX\MSW two directories and related files. You chose to generate Unicode because Celayouteditor's character set uses Unicode by default, and if we modify the Celayouteditor character set, we need to use the appropriate configuration to generate the wxwidgits.
4. Modify the following statement in the Editorframe::initializecegui function in Src\editorframe.cpp in the Celayouteditor directory:
//Setup support for Tga,jpg and PNG
Cegui::system::setdefaultimagecodecname ("Sillyimagecodec");
Revision changed to
Setup support for Tga,jpg and PNG
Cegui::system::setdefaultimagecodecname ("Freeimageimagecodec");
5. Modify the following statement in the Celayouteditor project properties in the build event ==> post-build event:
In the Debug attribute:
We use Freeimage as the image decoder, so we will
copy $ (cegui_7) \bin\ceguisillyimagecodec_d.dll $ (ce_layout_editor_7) \bin\debug/y
Copy $ (cegui_7) \bin\ceguitgaimagecodec_d.dll $ (ce_layout_editor_7) \bin\debug/y
Revision changed to
copy $ (cegui_7) \bin\ceguifreeimageimagecodec_d.dll $ (ce_layout_editor_7) \bin\debug/y
Copy $ (cegui_7) \dependencies\bin\freeimaged.dll $ (ce_imageset_editor) \bin\debug/y --------------------(er ror_1)
We no longer use silly as a picture decoder, so delete this line
Copy $ (cegui_7) \dependencies\bin\silly_d.dll $ (ce_layout_editor_7) \bin\debug/y
The original path was incorrectly written, so it will
copy $ (ce_layout_editor_7) \src\bitmaps\splash.png "$ (ce_layout_editor_7) \vc++7.1"/y
Revision changed to
copy $ (ce_layout_editor_7) \src\bitmaps\splash.png "$ (ce_layout_editor_7) \vc++9"/y
Release properties:
We use Freeimage as the image decoder, so we will
Copy $ (cegui_7) \bin\ceguisillyimagecodec.dll $ (ce_layout_editor_7) \bin\release/y
Copy $ (cegui_7) \bin\ceguitgaimagecodec.dll $ (ce_layout_editor_7) \bin\release/y
Revision changed to
Copy $ (cegui_7) \bin\ceguifreeimageimagecodec.dll $ (ce_layout_editor_7) \bin\release/y
Copy $ (cegui_7) \dependencies\bin\freeimage.dll $ (ce_imageset_editor) \bin\debug/y--------------------(er ror_2)
We no longer use silly as a picture decoder, so delete this line
Copy $ (cegui_7) \dependencies\bin\silly.dll $ (ce_layout_editor_7) \bin\release/y
The original path was incorrectly written, so it will
Copy $ (ce_layout_editor_7) \src\bitmaps\splash.png "$ (ce_layout_editor_7) \vc++7.1"/y
Revision changed to
Copy $ (ce_layout_editor_7) \src\bitmaps\splash.png "$ (ce_layout_editor_7) \vc++9"/y
6. Create a new resource.h file in the vc++9 directory of Celayouteditor empty. Otherwise you will be prompted not to find this file
7. Compile Celayouteditor to
8. If you need to run, create a new Celayouteditor.ini in the generated directory, as follows:
[SETTINGS]
bigkeystep=10
smallkeystep=1
defaultfont=
currentbackground=
Backgroundvisible=0
currentlayout=
viewwidth=1024
viewheight=768
snapmode=2
gridsize=10
gridvisible=0
Configspath=
fontspath=
imagesetspath=
looknfeelspath=
scriptspath=
schemespath=
LayoutsPath =
Supportedproperties=alpha,float; Clickstepsize,float; Maximumvalue,float; Visible,bool; Alwaysontop,bool; Clippedbyparent,bool;inheritsalpha,bool; Selected,bool; Readonly,bool; Closebuttonenabled,bool;dragmovingenabled,bool; Frameenabled,bool; Sizingenabled,bool; Titlebarenabled,bool; Multiselect,bool; Sort,bool;draggingenabled,bool; Backgroundenabled,bool;inheritstooltiptext,bool; Hoverimage,text; Pushedimage,text;disabledimage,text; Normalimage,text; Font,font; Titlebarfont,font; Verticalalignment,vert_align; Horizontalalignment,horz_align; Vertformatting,vert_text_format; Horzformatting,horz_text_format; Tooltip,text;image,text; Textcolours,text;
V. Generation of Ceimageeditor
1. Assume that you have set the environment variables in the way described in section fourth;
Decompression celayouteditor-0.7.1.tar.gz
2. Add the environment variable ce_imageset_editor, the content is ceimageseteditor after the extracted path
3. Open the Ceimageseteditor.vcproj file in Vc++9 under Ceimageseteditor with a text editor, replace $ ( Cegui) with $ ( cegui_7) and $ ( WXWIDGETS) Replace all to $ (wxwidgets_7)
4. Using VS2008 to open the. sln file under Vc++9, modify the post-build event for the Ceimageseteditor project
Under Debug
Copy $ (cegui_7) \bin\ceguisillyimagecodec_d.dll $ (ce_imageset_editor) \bin\debug/y
Copy $ (cegui_7) \bin\ceguitgaimagecodec_d.dll $ (ce_imageset_editor) \bin\debug/y
Revision changed to
Copy $ (cegui_7) \bin\ceguifreeimageimagecodec_d.dll $ (ce_imageset_editor) \bin\debug/y
Copy $ (cegui_7) \dependencies\bin\freeimaged.dll $ (ce_imageset_editor) \bin\debug/y
Release under
Copy $ (cegui_7) \bin\ceguisillyimagecodec.dll $ (ce_imageset_editor) \bin\release/y
Copy $ (cegui_7) \bin\ceguitgaimagecodec.dll $ (ce_imageset_editor) \bin\release/y
Revision changed to
Copy $ (cegui_7) \bin\ceguifreeimageimagecodec.dll $ (ce_imageset_editor) \bin\release/y
Copy $ (cegui_7) \dependencies\bin\freeimage.dll $ (ce_imageset_editor) \bin\debug/y --------------------(error_3 )
5. Generate
Vi. Other
If you want to generate a multibyte version of Celayouteditor:
The first thing to do is to modify the character set settings for the project property (this estimate is known to everyone);
Then you need to StringHelper.h the
Static wxstring towxstring (const wxstring& STR)
{
return str;
}
And
Static cegui::string toceguistring (const cegui::string& STR)
{
return str;
}
These two functions are commented out, otherwise they will cause an ambiguous error in the function invocation.
All right, let's just say this.
Things to keep in mind when referring to the above steps:
1. In step 4.1 of the third section, due to the Lib sub-x86 and x64 two versions of DXSDK (June 2010), the sub-paths of Lib need to be supplemented complete , such as %dx_sdk_dir%/lib/x86.
2. In the fourth step, the error that I marked with red rose may be the original author's hand, should read as follows:
(error_1):copy $ (cegui_7) \dependencies\bin\freeimaged.dll $ (ce_imageset_editor)\bin\ debug/y
instead: Copy $ (cegui_7) \dependencies\bin\freeimaged.dll $ (ce_layout_editor_7)\bin\debug/y
(error_2): copy $ (cegui_7) \dependencies\bin\freeimage.dll $ (ce_imageset_editor)\bin\debug /y
Instead:copy $ (cegui_7) \dependencies\bin\freeimage.dll $ (ce_layout_editor_7)\bin\ Release /y
(error_3):copy $ (cegui_7) \dependencies\bin\freeimage.dll $ (ce_imageset_editor)\ bin\Debug /y Y
instead: copy $ (cegui_7) \dependencies\bin\freeimage.dll $ (ce_imageset_editor)\bin\release/y
Follow the compilation steps provided by the original author to successfully compile the 0.7.1 version of Cegui and the corresponding tool software.
Compilation of Cegui 0.7.1 and related tools in VS2008 environment (reprint + additional precautions)