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)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • vue基础教程总结篇,用最短的时间入门vue.js(持续更新…)

    vue基础教程总结篇,用最短的时间入门vue.js(持续更新…)目前,vue已经成为前端工程师必会的框架之一,这里简单总结一下,可以让您快速的入门vue,师傅带进门,修行靠个人,最主要的还是自己多动手,多实践,本专栏会持续更新。1.vue安装教程及简介2.vue计算属性computed与监听属性watch的基本使用3.Vue组件及自定义事件4.Vue过渡&动画&混入5.Vue路由的基本使用6.vue中Ajax(axios)及Ajax(vue-resource)的使用方法7.vues响应接口and实例8.vue目录.

    2022年6月4日
    31
  • Easyui Datagrid的Rownumber行号显示问题

    Easyui Datagrid的Rownumber行号显示问题在Oracle中使用orderby进行查询排序时,如果排序字段中有空值(null),排序结果可能会达不到我们想要的结果。如:select*fromtestorderbyagedesc;按照age字段降序排序,结果如下:将sql语句改为select*fromtestorderbyagedescnullslast;即可将null值排到

    2022年6月12日
    68
  • 人工智能马尔可夫模型_高斯马尔科夫模型

    人工智能马尔可夫模型_高斯马尔科夫模型(马尔可夫与马尔科夫都可以,所以也别纠结)马尔可夫模型(MarkovModel)是一种统计模型,广泛应用在语音识别,词性自动标注,音字转换,概率文法等各个自然语言处理等应用领域。经过长期发展,尤其是在语音识别中的成功应用,使它成为一种通用的统计工具。      ———–百度对于马尔科夫实际上是根据根据历史数据和其中的规律,总结出变化的规律,使用概率转移图的形式来推断…

    2022年9月1日
    1
  • Autodesk 产品

    Autodesk 产品

    2021年8月13日
    58
  • 4096!——化简的2048游戏[通俗易懂]

    4096!——化简的2048游戏

    2022年2月1日
    129
  • nfs

    nfs

    2021年9月9日
    59

发表回复

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

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