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


相关推荐

  • 图像去噪序列——BM3D图像去噪模型实现

    图像去噪序列——BM3D图像去噪模型实现1.BM3D模型简介BM3D模型是一个两阶段图像去噪方法,主要包含两个步骤:(1)在噪声图像上,利用局部区域搜索相似块,并进行堆叠,在变换域(DCT域、FFT域)利用硬阈值去噪方法对堆叠的图像块进行去噪,获得堆叠相似块的估计值,最后,根据均值权重进行聚合;(2)通过步骤(1)获取初步估计的图像,在初步估计的图像上进行相似块的聚合;然后,利用维纳协同滤波进行图像去噪,从而,获取最后的去…

    2022年6月4日
    30
  • chrome谷歌浏览器怎么清除指定网站cookie

    chrome谷歌浏览器怎么清除指定网站cookie

    2021年10月15日
    79
  • 电路实习报告:简易收音机的焊接

    电路实习报告:简易收音机的焊接本文是本科生电路实习(焊接部分)的实习报告

    2025年8月2日
    3
  • Python列表(list)详解[通俗易懂]

    Python列表(list)详解[通俗易懂]Python内置的四种常用数据结构:列表(list)、元组(tuple)、字典(dict)以及集合(set)。这四种数据结构一但都可用于保存多个数据项,这对于编程而言是非常重要的,因为程序不仅需要使

    2022年7月3日
    40
  • AVX2 初探

    AVX2 初探Intel最近发布了AVX-512,据说对浮点运算有很大提升,我的机器目前不支持AVX-512,但是支持AVX2,按照之前Intel给出的数据,据说能提速将近8倍:IntroductiontoIntel®AdvancedVectorExtensions测试环境可能这篇文章有点偏老,我这边也想验证一下没有优化的C/C++浮点运算和AVX2优化后的浮点运算到底快多少。这是我机器的配置:Manufacturer GenuineIntelName IntelCorei77820

    2022年5月30日
    90
  • 用Spring提高java观察者模式灵活性

    用Spring提高java观察者模式灵活性

    2021年12月1日
    40

发表回复

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

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