CEGUI build

CEGUI build     Everygamesneed2dguisystemforplayerinterface,asweknownasOGRE3drenderenginepronouncethatitwilluseCEGUIcomponentforits2dpart,becauseCEGUIisveryprofessionalandpo

大家好,又见面了,我是你们的朋友全栈君。

        Every games need 2d gui system for player interface, as we known as OGRE 3d render engine pronounce that it will use CEGUI component for its 2d part, because CEGUI is very professional and powerful, so I want to see its miracle source code,I’d like to share some experience for newcomer.

Firstly, I download CEGUI 5.0 and dependencies 5.0 – vs8 and build successfully, here are necessary resource:

1. Src: http://prdownloads.sourceforge.net/crayzedsgui/CEGUI-0.5.0b.zip?download
2. Dependecies for vs 2005: http://prdownloads.sourceforge.net/crayzedsgui/CEGUI-DEPS-0.5.0b-vc8.zip?download
3. CEGUI Wiki: http://www.cegui.org.uk/wiki/index.php/Main_Page
4. All: http://sourceforge.net/projects/crayzedsgui/files/

Note: if you use visual studio 2005, must make sure it has sp1 package, will has 0XC0150002 error or not.
vs2005 sp1: http://download.microsoft.com/download/8/0/7/8071514d-9370-45c3-8af1-4ff09a70e59d/VS80sp1-KB926604-X86-CHS.exe

Now let us have a look at these source code file structure, as following,

./bin           all CEGUI base dll which will be compiled by me letter.
./datafiles        all demo resource
./dependencies      all depend on other library
./ImageCodecModules    some image codec source code
./include         all CEGUI head file
./makefiles/premake    cegui and examples’ project, and project configure[Important: config.lua]
./RendererModules     some render modules such as dx9, dx8, irrlich, opengl
./ScriptingModules    cegui lua module
./src           all CEGUI source code
./WindowRendererSets   all real render implement of cegui control like button, edit. latter I will explain in detail.
./XMLParserModules    some xml parser such TinyXML, Xerces etc. because cegui serialize all object to xml file format.
./XMLRefSchema      some schema for loading.

Here we go, secondly I will build a example for demo, check file directory in [./makefiles/premake]. Hold on please, there is a very important thing to do before you execute batch file. You should use which render module for rendering. for example, I want to use directx 9.0 for rendering, in this case please open config.lua using notepad, you will find,

————-
— Renderers
— this controls which renderer modules are built
OPENGL_RENDERER = true   ——-> false
DIRECTX81_RENDERER = false
DIRECTX9_RENDERER = false ——-> true
IRRLICHT_RENDERER = false

I think you understand what to do, just change opengl to false, turn on directx9. Let’s execute 2005 bat file, will produce two solutions, one is CEGUI.sln, building is OK! Here Focus on CEGUISamples.sln. Error will be see when run demo_xxx.exe because of loading resource. latter I will just give some to do and no reason, and you will understand when debuging source code. open CEGuiD3D9BaseApplication.cpp and modify it’s constructor,

// initialise the re quired dirs for the DefaultResourceProvider
CEGUI::DefaultResourceProvider* rp = static_cast<CEGUI::DefaultResourceProvider*> (CEGUI::System::getSingleton().getResourceProvider());
const char* dataPathPrefix = getDataPathPrefix();
char resourcePath[PATH_MAX];

sprintf_s(resourcePath, PATH_MAX, “%s%s”, dataPathPrefix, “datafiles/schemes/”);
rp->setResourceGroupDirectory(“schemes”, resourcePath);
sprintf_s(resourcePath, PATH_MAX, “%s%s”, dataPathPrefix, “datafiles/imagesets/”);
rp->setResourceGroupDirectory(“imagesets”, resourcePath);
sprintf_s(resourcePath, PATH_MAX, “%s%s”, dataPathPrefix, “datafiles/fonts/”);
rp->setResourceGroupDirectory(“fonts”, resourcePath);
sprintf_s(resourcePath, PATH_MAX, “%s%s”, dataPathPrefix, “datafiles/layouts/”);
rp->setResourceGroupDirectory(“layouts”, resourcePath);
sprintf_s(resourcePath, PATH_MAX, “%s%s”, dataPathPrefix, “datafiles/looknfeel/”);
rp->setResourceGroupDirectory(“looknfeels”, resourcePath);
sprintf_s(resourcePath, PATH_MAX, “%s%s”, dataPathPrefix, “datafiles/lua_scripts/”);
rp->setResourceGroupDirectory(“lua_scripts”, resourcePath);

at last add a member function for this class,

const char* CEGuiD3D9BaseApplication::getDataPathPrefix() const
{

// TO ADD:
// return your datafiles full path here
}

the end, good luck to you!

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/163749.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • Idea激活码最新教程2023.3版本,永久有效激活码,亲测可用,记得收藏

    Idea激活码最新教程2023.3版本,永久有效激活码,亲测可用,记得收藏Idea 激活码教程永久有效 2023 3 激活码教程 Windows 版永久激活 持续更新 Idea 激活码 2023 3 成功激活

    2025年5月27日
    5
  • Echarts 关系图谱示例「建议收藏」

    Echarts 关系图谱示例「建议收藏」<!DOCTYPEhtml><html><head><metaname=”viewport”content=”width=device-width”/><title>ECharts关系图谱</title><scriptsrc=”jquery-1.10.2.min.js”></script><scriptsrc=”echarts.min.js”>.

    2022年6月26日
    29
  • flutter下载图片到本地_禁止拍照上传图片

    flutter下载图片到本地_禁止拍照上传图片/Ios、Android应用权限开启流程/IOS应用(询问权限、开启权限)Android应用(询问权限、开启权限)/自定义选择相机和相册的对话框/创建一个存放对话框标题、相册拍照选项、关闭对话框的集合[{‘label’:’${titLab??’上传有效凭证’}’},{‘label’:’拍照’},{‘label’:’从手机相册选择’},{‘label’:’取消’},…

    2022年9月23日
    2
  • 创新与项目管理_创新与创业管理

    创新与项目管理_创新与创业管理值此新商业时代,作为组织内保证所有项目成功交付,支撑组织战略目标实现的PMO,在现代企业管理和商业运作中将扮演着十分重要的角色。现阶段,虽然PMO随着项目管理的普及和深入应用,已经成为组织项目管理发展的新趋势,但是它在迎来新的发展机遇的同时也面临着不小的挑战,其PMO管理能力与水平的高低将决定它自身在支撑组织战略中的价值程度。为进一步加强PMO人士之间的广泛交流,分享成功的PMO运作实践,促进…

    2022年8月31日
    5
  • pytest的assert_java单元测试断言

    pytest的assert_java单元测试断言前言断言是写自动化测试基本最重要的一步,一个用例没有断言,就失去了自动化测试的意义了。什么是断言呢?简单来讲就是实际结果和期望结果去对比,符合预期那就测试pass,不符合预期那就测试failed

    2022年7月29日
    9
  • puremvc的unity案例_游戏防闪退框架

    puremvc的unity案例_游戏防闪退框架作者:吴秦出处:http://www.cnblogs.com/skynet/本文基于署名2.5中国大陆许可协议发布,欢迎转载,演绎或用于商业目的,但是必须保留本文的署名吴秦(包含链接).参考资料[1]    PureMVC官方网站:www.puremvc.org[2]    Wikipedia:http://zh.wikipedia.org/zh-cn/MVC[

    2025年8月13日
    4

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号