﻿<?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++博客-组件工厂-随笔分类-疑问篇</title><link>http://www.cppblog.com/flashboy/category/7028.html</link><description>------3D游戏研发</description><language>zh-cn</language><lastBuildDate>Fri, 04 Dec 2009 10:32:52 GMT</lastBuildDate><pubDate>Fri, 04 Dec 2009 10:32:52 GMT</pubDate><ttl>60</ttl><item><title>3D游戏UI在多分辨率下的底图拼接问题（OpenGL渲染）</title><link>http://www.cppblog.com/flashboy/archive/2009/05/19/83405.html</link><dc:creator>RedLight</dc:creator><author>RedLight</author><pubDate>Tue, 19 May 2009 12:37:00 GMT</pubDate><guid>http://www.cppblog.com/flashboy/archive/2009/05/19/83405.html</guid><wfw:comment>http://www.cppblog.com/flashboy/comments/83405.html</wfw:comment><comments>http://www.cppblog.com/flashboy/archive/2009/05/19/83405.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/flashboy/comments/commentRss/83405.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/flashboy/services/trackbacks/83405.html</trackback:ping><description><![CDATA[在3D游戏中，UI这一块也是挺重要的， 它提供了用户友好的操作接口。一般的话，需要一个控件库，都基本采用自绘来组织。基本上都是贴图及位置计算，布局，消息传递等。我之前也做过两年信息系统的UI，感觉应该没什么问题，跟游戏大致相同。不过游戏要求要适应多分辨率布局支持，好了，这下麻烦了，由于早期OpenGL一般只支持256*256以下的图片，而要做一张512*512的底图显然需要四张256*256的小贴图拼接而成，虽然说OpenGL会提供相当的图片像素点插值来扩大或缩小贴图，但如果你移动窗口底图到某个地方的话， 很显然的会出现 + 裂缝，经过各种方式都未能搞定。 大家有做过这种问题的， 或者有什么好的建议的好， 跟我说一下， 谢谢！<br><br>注：WOW的UI窗口底图也是256*256的底图拼接而成，但它为什么就不会出现裂缝呢？而且它的UI界面还可以调整缩放的，真的好强，但我不明白它当中的道理， 闷就只有一个字， 对你说一次， 有搞过的， 一定要对我说喔， 十分感谢！ <br><br>问题终于解决了, 原来OpenGL的纹理没有镜像寻址方式, 所以很麻烦, 暂时没想到更好的方法, 只能让窗口的底图有一张图。后来我改用了D3D，知道D3D有一种纹理寻址方式叫D3DTADDRESS_MIRROR, 过滤方式使用线性插值就可以了。现在窗口的底图完全可以像wow一样，用四张图拼成，每张图不超过256*256, 以适应配置更低的机器使用。
<img src ="http://www.cppblog.com/flashboy/aggbug/83405.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/flashboy/" target="_blank">RedLight</a> 2009-05-19 20:37 <a href="http://www.cppblog.com/flashboy/archive/2009/05/19/83405.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>epoll之郁闷篇(它为什么不行, 它就是不行)</title><link>http://www.cppblog.com/flashboy/archive/2008/05/09/49276.html</link><dc:creator>RedLight</dc:creator><author>RedLight</author><pubDate>Fri, 09 May 2008 01:08:00 GMT</pubDate><guid>http://www.cppblog.com/flashboy/archive/2008/05/09/49276.html</guid><wfw:comment>http://www.cppblog.com/flashboy/comments/49276.html</wfw:comment><comments>http://www.cppblog.com/flashboy/archive/2008/05/09/49276.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.cppblog.com/flashboy/comments/commentRss/49276.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/flashboy/services/trackbacks/49276.html</trackback:ping><description><![CDATA[做游戏服务器的同志们一般都会使用epoll来做高性能服务器, 但本人在Linux RedHat AS4上使用epoll(LT, ET不敢用, 听说比较难控制)的时候遇到比较郁闷的问题, io接收的接收模块是没有问题的, 客户端连续发包到epoll服务器都可以接收到总长度一样长的数据流, 这个我非常满意;&nbsp; 如果有100个连接同时连接到epoll服务器, 然后异常断开, 结果也可以收到100个断开的信号, 但如果是<span style="COLOR: red">1000个连接同时连接到epoll服务器然后同时异常断开</span>, 这时候就<span style="COLOR: red">搞不定</span>了, 大概只收到100多个的信号, 有时候<span style="COLOR: red">甚至出现间断性的阻塞</span>,&nbsp; 于是我在想, 是不是我的程序有问题, 思考中........,[好像自己写的程序都比较完美, 其实我很多程序都抄别人/example代码], 嘿嘿, 不相信的话就用ACE网络框架模型来搞一搞看有没有搞头, 于是我用了ACE的Reactor框架,&nbsp; 用ACE_Dev_Poll_Reactor实例化Reactor试了一把, 大并发量的异常连接断开还是一样,&nbsp; 只收到部分信号, 于是我郁闷了, 最后我想了一个办法, 还是只能加心脏包来跳动一下, 记时间差来判断客户端是否在线, 想起Windows上IOCP的舒服, 愉悦的服务器编程经历, 于是有点悲哀, 难道是linux内核的机制问题, 不会吧, 猜想中.....,&nbsp;&nbsp; 也许吧!<br><br>我书读得少, 请Linux网络编程高手指教一下, 谢谢!&nbsp; <br><br>------------------------------------------------------------------<br><br>原来IOCP也会这样, 只是之前我在本机上测试的原因, 因为本机连本机的话没有经过网卡, 断开信号也是虚拟的, 所以全部可以接收到。所以不管如何，必须加上心跳包来防止意外退出问题。------------靠天靠地靠祖先，算不得好汉！
<img src ="http://www.cppblog.com/flashboy/aggbug/49276.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/flashboy/" target="_blank">RedLight</a> 2008-05-09 09:08 <a href="http://www.cppblog.com/flashboy/archive/2008/05/09/49276.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>