﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-Game？Life？-文章分类-CEGUI</title><link>http://www.cppblog.com/sureandrew/category/13107.html</link><description>Love Family &amp;&amp; Love Career = Love Life</description><language>zh-cn</language><lastBuildDate>Sun, 21 Feb 2010 09:47:13 GMT</lastBuildDate><pubDate>Sun, 21 Feb 2010 09:47:13 GMT</pubDate><ttl>60</ttl><item><title>CEGUI本来就支持中文显示</title><link>http://www.cppblog.com/sureandrew/articles/108147.html</link><dc:creator>阿炳</dc:creator><author>阿炳</author><pubDate>Sun, 21 Feb 2010 07:13:00 GMT</pubDate><guid>http://www.cppblog.com/sureandrew/articles/108147.html</guid><wfw:comment>http://www.cppblog.com/sureandrew/comments/108147.html</wfw:comment><comments>http://www.cppblog.com/sureandrew/articles/108147.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/sureandrew/comments/commentRss/108147.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/sureandrew/services/trackbacks/108147.html</trackback:ping><description><![CDATA[研究CEGUI首先想解决中文显示问题，我在网上找了很多关于中文现实的问题，结果发现只对CEGUI的FontDemo例子有效果，其他的例子都不行，后来发现原来是源代码文件的编码格式问题，原来只有FontDemo的源代码文件Unicode（utf-8 无签名）格式，其他都不是此格式，我用vs2003把其他源代码文件转为Unicode（utf-8 无签名）格式，就可以正常显示中文了。<br><br>以CEGUI自带的最简单的例子FirstWindow为例，先将Sample_FirstWindow.cpp转为Unicode（utf-8 无签名）格式保存。<br>将系统文件夹的黑体字字库文件simhei.ttf拷贝到CEGUI-0.7.1\datafiles\fonts目录里，然后在FirstWindowSample::initialiseSample()
函数中添加以下代码：<br>&nbsp;&nbsp;&nbsp; FontManager::getSingleton().createFreeTypeFont("DefaultFont", 10/*pt*/, true, "simhei.ttf");<br>&nbsp;&nbsp; &nbsp;// 设为默认字体<br>&nbsp;&nbsp; &nbsp;System::getSingleton().setDefaultFont("DefaultFont");
<br>然后再在同一个函数内将wnd-&gt;setText("Hello World!");
<br>改为：<br>&nbsp;&nbsp;&nbsp;&nbsp; wnd-&gt;setText((CEGUI::utf8*)"大家好！Hello World!");记住一定要有CEGUI::utf8*指针。<br>&nbsp;编译运行即可。<br><br> <img src ="http://www.cppblog.com/sureandrew/aggbug/108147.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/sureandrew/" target="_blank">阿炳</a> 2010-02-21 15:13 <a href="http://www.cppblog.com/sureandrew/articles/108147.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>CEGUI 0.7.1版编译</title><link>http://www.cppblog.com/sureandrew/articles/108143.html</link><dc:creator>阿炳</dc:creator><author>阿炳</author><pubDate>Sun, 21 Feb 2010 06:37:00 GMT</pubDate><guid>http://www.cppblog.com/sureandrew/articles/108143.html</guid><wfw:comment>http://www.cppblog.com/sureandrew/comments/108143.html</wfw:comment><comments>http://www.cppblog.com/sureandrew/articles/108143.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/sureandrew/comments/commentRss/108143.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/sureandrew/services/trackbacks/108143.html</trackback:ping><description><![CDATA[因为在编译cegui 0.7.1是遇到了些问题，所以记录下来，防止以后遗忘。<br><br>首先，在其官网下载windows版本的CEGUI-0.7.1.zip源码压缩包和vs编译用的依赖库CEGUI-DEPS-0.7.x-r1-vc71.zip（我的开发环境是vs2003，所以是vc71）。<br>然后，解压CEGUI-0.7.1.zip，生成CEGUI-0.7.1文件夹，将CEGUI-DEPS-0.7.x-r1-vc71.zip解压产生的dependencies放入CEGUI-0.7.1目录中，在进入CEGUI-0.7.1\projects\premake目录，执行build_vs2003.bat批处理脚本，生成CEGUI.sln工程文件，就可以编译了，我的编译非常顺利。<br><br>但是执行的时候却遇到了问题，我运行所有的CEGUI Sample全部内存错误，后来我跟踪发现Window::setParent(Window* parent)函数有问题，在他的函数体内只保留d_parent = parent;transferChildSurfaces();
这两行内容就可以了，再编译就一切正常了。<br><br> <img src ="http://www.cppblog.com/sureandrew/aggbug/108143.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/sureandrew/" target="_blank">阿炳</a> 2010-02-21 14:37 <a href="http://www.cppblog.com/sureandrew/articles/108143.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>