前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >CEGUI build

CEGUI build

作者头像
全栈程序员站长
发布2022-09-15 10:24:46
5370
发布2022-09-15 10:24:46
举报
文章被收录于专栏:全栈程序员必看

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

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.cn/163749.html原文链接:https://javaforall.cn

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档