﻿<?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++博客-力为的技术博客-随笔分类-Mac&amp;iOS</title><link>http://www.cppblog.com/mythma/category/19757.html</link><description>C++QQ群：320523969，320523982</description><language>zh-cn</language><lastBuildDate>Mon, 25 Aug 2014 02:30:42 GMT</lastBuildDate><pubDate>Mon, 25 Aug 2014 02:30:42 GMT</pubDate><ttl>60</ttl><item><title>Mac OSX 10.9下XCode包含X11头文件</title><link>http://www.cppblog.com/mythma/archive/2014/08/24/macosx-x11-ln.html</link><dc:creator>力为</dc:creator><author>力为</author><pubDate>Sun, 24 Aug 2014 03:11:00 GMT</pubDate><guid>http://www.cppblog.com/mythma/archive/2014/08/24/macosx-x11-ln.html</guid><wfw:comment>http://www.cppblog.com/mythma/comments/208110.html</wfw:comment><comments>http://www.cppblog.com/mythma/archive/2014/08/24/macosx-x11-ln.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/mythma/comments/commentRss/208110.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/mythma/services/trackbacks/208110.html</trackback:ping><description><![CDATA[默认情况下，再Mac OSX 10.9中XCode SDK中不包括X11得头文件，如果用到则需要稍微改动一下。<br /><br />X11位于目录：<br />/opt/local/include/X11<br /><br />在XCode SDK中为X11加个替身：<br /><div style="font-size: 13px; border: 1px solid #cccccc; padding: 4px 5px 4px 4px; width: 98%; word-break: break-all; background-color: #eeeeee;"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />-->sudo&nbsp;ln&nbsp;-s&nbsp;/opt/local/include/X11&nbsp;/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/&nbsp; &nbsp;</div><br />替身，在Mac OSX下是相当有用。<img src ="http://www.cppblog.com/mythma/aggbug/208110.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/mythma/" target="_blank">力为</a> 2014-08-24 11:11 <a href="http://www.cppblog.com/mythma/archive/2014/08/24/macosx-x11-ln.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>OpenGL on OSX for Beginner</title><link>http://www.cppblog.com/mythma/archive/2013/10/02/opengl-on-mac-osx-cocoa.html</link><dc:creator>力为</dc:creator><author>力为</author><pubDate>Wed, 02 Oct 2013 10:25:00 GMT</pubDate><guid>http://www.cppblog.com/mythma/archive/2013/10/02/opengl-on-mac-osx-cocoa.html</guid><wfw:comment>http://www.cppblog.com/mythma/comments/203523.html</wfw:comment><comments>http://www.cppblog.com/mythma/archive/2013/10/02/opengl-on-mac-osx-cocoa.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/mythma/comments/commentRss/203523.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/mythma/services/trackbacks/203523.html</trackback:ping><description><![CDATA[在Mac上使用OpenGL那是非常的简单，简单几步就也可以完成窗口初始化，这都得益于Cocoa的NSOpenGLView类。<br /><br />首先，创建一个Cocoa窗口程序，打开xib设计环境，点Window进入窗口设计界面<br />然后，在Object Library中选择OpenGL View拖到窗口上：<br /><img src="http://www.cppblog.com/images/cppblog_com/mythma/EE687AAA-F82A-48D5-9119-0682A00B4A78.png" border="0" alt="" width="559" height="438" /><br /><br />接下来要实现我们自己的View。<br />新建一个ObjectC class，名字为MyOpenGLView，修改代码：<br />MyOpenGLView.h文件：<br /><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />-->#import&nbsp;&lt;Cocoa/Cocoa.h&gt;<br />@interface&nbsp;MyOpenGLView&nbsp;:&nbsp;NSOpenGLView<br />{<br /><br />}<br /><br />-(<span style="color: #0000FF; ">void</span>)&nbsp;drawRect:(NSRect)dirtyRect;<br />@end</div><br /><br />MyOpenGLView.m<br /><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />-->#import&nbsp;"MyOpenGLView.h"<br />#import&nbsp;&lt;OpenGL/gl.h&gt;<br /><br /><span style="color: #0000FF; ">static</span>&nbsp;<span style="color: #0000FF; ">void</span>&nbsp;drawObjects()<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;glColor3f(1.0f,&nbsp;0.85f,&nbsp;0.35f);<br />&nbsp;&nbsp;&nbsp;&nbsp;glBegin(GL_TRIANGLES);<br />&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;glVertex3f(&nbsp;&nbsp;0.0,&nbsp;&nbsp;0.6,&nbsp;0.0);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;glVertex3f(&nbsp;-0.2,&nbsp;-0.3,&nbsp;0.0);<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;glVertex3f(&nbsp;&nbsp;0.2,&nbsp;-0.3&nbsp;,0.0);<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;glEnd();<br />}<br /><br />@implementation&nbsp;MyOpenGLView<br /><br />-(<span style="color: #0000FF; ">void</span>)drawRect:(NSRect)dirtyRect<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;glClearColor(1,&nbsp;0,&nbsp;0,&nbsp;1);<br />&nbsp;&nbsp;&nbsp;&nbsp;glClear(GL_COLOR_BUFFER_BIT);<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;drawObjects();<br />&nbsp;&nbsp;&nbsp;&nbsp;glFlush();<br />}<br /><br />@end</div><br />自定义的控件类有了，在选中上面拖到窗口上的OpenGL Object，在Show the Identity Inspector设置面板中设置其Custom Class为MyOpenGLView。大功告成：<br /><img src="http://www.cppblog.com/images/cppblog_com/mythma/D6DC33E6-AC90-4242-95FF-029CB381D6A2.png" border="0" alt="" width="480" height="382" /><br /><br />跟在Windows上使用OpenGL相比，Cocoa方便很多。<img src ="http://www.cppblog.com/mythma/aggbug/203523.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/mythma/" target="_blank">力为</a> 2013-10-02 18:25 <a href="http://www.cppblog.com/mythma/archive/2013/10/02/opengl-on-mac-osx-cocoa.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Mac上编译boost</title><link>http://www.cppblog.com/mythma/archive/2012/10/25/build_boost_with_clang_mac.html</link><dc:creator>力为</dc:creator><author>力为</author><pubDate>Thu, 25 Oct 2012 07:32:00 GMT</pubDate><guid>http://www.cppblog.com/mythma/archive/2012/10/25/build_boost_with_clang_mac.html</guid><wfw:comment>http://www.cppblog.com/mythma/comments/193841.html</wfw:comment><comments>http://www.cppblog.com/mythma/archive/2012/10/25/build_boost_with_clang_mac.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/mythma/comments/commentRss/193841.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/mythma/services/trackbacks/193841.html</trackback:ping><description><![CDATA[<ul><li><strong>首先编译Boost.Build</strong></li></ul>&nbsp; &nbsp; &nbsp; &nbsp; 修改sh的文件属性<br />&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br /><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all">&nbsp;chmod&nbsp;+x&nbsp;bootstrap.sh</div></blockquote><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all">&nbsp;chmod&nbsp;+x&nbsp;./tools/build/v2/engine/build.sh</div></blockquote>&nbsp;<br /><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;">执行 bootstrap.sh</blockquote><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all">./bootstrap.sh</div></blockquote><br /><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;">生成b2可执行程序</blockquote><br /><ul><li><strong>编译Boost库<br /></strong><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #008000; ">//</span><span style="color: #008000; ">用Clang编译boost&nbsp;file&nbsp;sytem</span><span style="color: #008000; "><br /></span>./b2&nbsp;toolset=clang&nbsp;cxxflags="-arch&nbsp;x86_64"&nbsp;linkflags="-arch&nbsp;x86_64"&nbsp;--with-filesystem &nbsp; &nbsp; &nbsp;</div><br /><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />-->The&nbsp;Boost&nbsp;C++&nbsp;Libraries&nbsp;were&nbsp;successfully&nbsp;built!<br />The&nbsp;following&nbsp;directory&nbsp;should&nbsp;be&nbsp;added&nbsp;to&nbsp;compiler&nbsp;include&nbsp;paths:<br />&nbsp;&nbsp;&nbsp;&nbsp;/Users/liwei/DEV/Project/boost_1_50_0<br />The&nbsp;following&nbsp;directory&nbsp;should&nbsp;be&nbsp;added&nbsp;to&nbsp;linker&nbsp;library&nbsp;paths:<br />&nbsp;&nbsp;&nbsp;&nbsp;/Users/liwei/DEV/Project/boost_1_50_0/stage/lib</div><br /><br />最后生成的文件保存在./stage/lib目录<br /><br />&nbsp;<br />默认编译出来的是Release版本，编译debug版本：<br /><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />-->./b2&nbsp;toolset=clang&nbsp;cxxflags="-arch&nbsp;x86_64"&nbsp;linkflags="-arch&nbsp;x86_64"&nbsp;--with-filesystem&nbsp;variant=debug&nbsp;--stagedir=./stage/x64/debug</div><br /><br /><br /><br /><br />速度像飞一样！<br /><br /><br /><a href="http://www.cppblog.com/mythma/archive/2012/10/24/xcode_linking_dylib.html">在xcode中设置boost库</a></li></ul><img src ="http://www.cppblog.com/mythma/aggbug/193841.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/mythma/" target="_blank">力为</a> 2012-10-25 15:32 <a href="http://www.cppblog.com/mythma/archive/2012/10/25/build_boost_with_clang_mac.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>配置xcode使用第三方Library</title><link>http://www.cppblog.com/mythma/archive/2012/10/24/xcode_linking_dylib.html</link><dc:creator>力为</dc:creator><author>力为</author><pubDate>Wed, 24 Oct 2012 09:11:00 GMT</pubDate><guid>http://www.cppblog.com/mythma/archive/2012/10/24/xcode_linking_dylib.html</guid><wfw:comment>http://www.cppblog.com/mythma/comments/193799.html</wfw:comment><comments>http://www.cppblog.com/mythma/archive/2012/10/24/xcode_linking_dylib.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/mythma/comments/commentRss/193799.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/mythma/services/trackbacks/193799.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 刚开始使用xcode处处碰壁，要在项目中引用个第三方库都摸不着头脑。看着xcode里面那么多的设置，“元芳，你感觉如何？”&nbsp;&nbsp;<a href='http://www.cppblog.com/mythma/archive/2012/10/24/xcode_linking_dylib.html'>阅读全文</a><img src ="http://www.cppblog.com/mythma/aggbug/193799.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/mythma/" target="_blank">力为</a> 2012-10-24 17:11 <a href="http://www.cppblog.com/mythma/archive/2012/10/24/xcode_linking_dylib.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Mac远程桌面链接</title><link>http://www.cppblog.com/mythma/archive/2012/08/04/remote-desktop-connection-mac.html</link><dc:creator>力为</dc:creator><author>力为</author><pubDate>Sat, 04 Aug 2012 08:36:00 GMT</pubDate><guid>http://www.cppblog.com/mythma/archive/2012/08/04/remote-desktop-connection-mac.html</guid><wfw:comment>http://www.cppblog.com/mythma/comments/186264.html</wfw:comment><comments>http://www.cppblog.com/mythma/archive/2012/08/04/remote-desktop-connection-mac.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/mythma/comments/commentRss/186264.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/mythma/services/trackbacks/186264.html</trackback:ping><description><![CDATA[MS为Mac开发了免费的<strong>简洁的</strong>远程桌面链接Windows的工具Remote Desktop Connection 2。对我这个Mac新手而言，真是难用！因为太简洁！<br />1. 全屏显示<br />找了半天就是找不到全屏按钮。<br />只能使用快捷键：Command ＋ 2<br /><br />2 更改显示分辨率<br />同样没有选项。<br />打开Default.rdp修改：<br /><img src="http://www.cppblog.com/images/cppblog_com/mythma/D6F0F045-6673-4312-9121-4139400327B0.png" border="0" alt="" /><br /><br />还好只用这点功能。<br /><br /><br />又研究了下，发现设置的位置了：<br /><br /><img src="http://www.cppblog.com/images/cppblog_com/mythma/DDC6D29B-DF27-45B2-9E7F-C43B99E10A0D.png" border="0" alt="" width="503" height="423" /><img src ="http://www.cppblog.com/mythma/aggbug/186264.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/mythma/" target="_blank">力为</a> 2012-08-04 16:36 <a href="http://www.cppblog.com/mythma/archive/2012/08/04/remote-desktop-connection-mac.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>