05 2013 档案

摘要:MYSRC_ROOT := $(LOCAL_PATH)/../../ClassesFILE_LIST := $(wildcard $(MYSRC_ROOT)/Actions/*.cpp)FILE_LIST += $(wildcard $(MYSRC_ROOT)/Constants/*.cpp)FILE_LIST += $(wildcard $(MYSRC_ROOT)/Helpers/*.cpp)FILE_LIST += $(wildcard $(MYSRC_ROOT)/*.cpp)LOCAL_SRC_FILES := helloworld/main.cppLOCAL_SRC_FILES += 阅读全文
posted @ 2013-05-30 17:38 酷熊 阅读(2873) 评论(0) 推荐(0) 编辑
摘要:#include<stdio.h>#include<tchar.h>#include<windows.h>#include"ConvertUTF.h"int_tmain(intargc,_TCHAR*argv[]){ConversionResultresult=sourceIllegal;UTF16utf16_buf[8] = {0};utf16_buf[0] = 0xd834;utf16_buf[1] = 0xdf00;utf16_buf[2] = 0xd834;utf16_buf[3] = 0xdf01;utf16_buf[4] = 阅读全文
posted @ 2013-05-27 18:28 酷熊 阅读(359) 评论(0) 推荐(0) 编辑
摘要:去工程的AndroidManifest.xml,添加或者在Eclipse中打开AndroidManifest.xml,选中"Permissions选项卡",Add...,选择"Uses Permission",在右侧的Name下拉列表中选择即可 阅读全文
posted @ 2013-05-27 18:23 酷熊 阅读(827) 评论(0) 推荐(0) 编辑
摘要:using namespace std;1、字符串中不含有汉字|--string-->wstringstring s("abc");wstring ws(s.begin(), s.end());//或者wstring ws; ws.assign(s.begin(), s.end());|--wstring-->stringwstring ws(L"ABC");string s(ws.begin(), ws.end());//或者string s; s.assign(ws.begin(), ws.end());2、字符串中含有汉字|--Wind 阅读全文
posted @ 2013-05-24 13:28 酷熊 阅读(1079) 评论(0) 推荐(0) 编辑
摘要:摘自:stackoverflowstring? wstring?std::string is a basic_string templated on a char, and std::wstring on a wchar_t.char vs. wchar_tchar is supposed to hold a character, usually a 1-byte character. wchar_t is supposed to hold a wide character, and then, things get tricky: On Linux, a wchar_t is 4-bytes 阅读全文
posted @ 2013-05-24 11:03 酷熊 阅读(864) 评论(0) 推荐(0) 编辑
摘要:Android版本的OSG不支持3ds插件(可以查看osg\src\osgPlugins\CmakeLists.txt文件,搜素’android’关键词,可以搜索到’IF(NOTANDROID)ADD_SUBDIRECTORY(3ds)ENDIF()’,可见,android下3ds被屏蔽了),也就是使用Android-ndk编译OSG的时候,不能编译osgdb_3ds.a插件,那么接下来展示一下手动编译osgdb_3ds.a的过程,假设OSG其他库已经编译完成,库文件位于c:/cygwin/usr/local/include,头文件位于c:/cygwin/usr/local/obj/local 阅读全文
posted @ 2013-05-23 10:15 酷熊 阅读(637) 评论(0) 推荐(0) 编辑
摘要:摘自:Notes的百度空间默认所有代码和文件在$project/jni下,否则特殊说明。情况一:编译静态库文件Android.mk:LOCAL_PATH:=$(callmy-dir)include$(CLEAR_VARS)LOCAL_MODULE:=hello-jniLOCAL_SRC_FILES:=hello-jni.cinclude$(BUILD_STATIC_LIBRARY)文件Application.mk:APP_MODULES:=hello-jni情况二:编译动态库文件Android.mk:LOCAL_PATH:=$(callmy-dir)include$(CLEAR_VARS)LO 阅读全文
posted @ 2013-05-22 16:06 酷熊 阅读(1071) 评论(0) 推荐(0) 编辑
摘要:参考:四维空间hanyezhiyu8的博客。使用ADT-Eclipse新建一个Android Application Project,功成名TestA,右击TestA,Android Tools-Add Native Support...,完成后工程中会增加一个jni文件夹,里面有TestA.cpp和Android.mk两个文件,其中TestA.cpp中只有#include <jni.h>一句话。--------------------------------------------------------在MainActivity.java中添加一个native函数public 阅读全文
posted @ 2013-05-22 11:48 酷熊 阅读(435) 评论(0) 推荐(0) 编辑
摘要:1、字符串转double、floatdouble osg::asciiToFloat(const char* str);位于\src\osg\Math.hdouble osg::asciiToDouble(const char* str);位于\src\osg\Math.cpp2、快速生成Geometry、GeodeGeode* osg::createGeodeForImage(osg::Image* image);位于\src\osg\image.cppGeometry* osg::createTexturedQuadGeometry(const Vec3&corner, const 阅读全文
posted @ 2013-05-20 14:53 酷熊 阅读(7289) 评论(0) 推荐(1) 编辑
摘要:osg::StateSet* ss=node->getOrCreateStateSet(); 1、光照 ss->setMode(GL_LIGHTING, osg::StateAttribute::OFF); 2、填充模式 ss->setAttributeAndModes(new osg::Polyg 阅读全文
posted @ 2013-05-17 13:17 酷熊 阅读(1646) 评论(0) 推荐(0) 编辑
摘要:当场景中存在一些孤立的点(POINT),默认是被裁减掉的,因为细节裁剪被默认打开。可以通过以下语句关闭细节裁剪osg::CullStack::CullingMode cullingMode = viewer.getCamera()->getCullingMode();cullingMode &= ~(osg::CullStack::SMALL_FEATURE_CULLING);viewer.getCamera()->setCullingMode(cullingMode); 阅读全文
posted @ 2013-05-14 14:37 酷熊 阅读(817) 评论(0) 推荐(0) 编辑
摘要:ReadyMap.org编码:使用OE工具osgearth_package从readyMap.org网站上下载的,(0,0)在左下角;编码格式:层/列/行,例如5/1/3WorldWind编码:(0,0)在左下角;编码格式:层/行/行_列,行、列号不足四位时用0补全,例如3/0002/0002_0001天地图编码:(0,0)在左上角;和以上两种数据的层数有一级之差,也就是说天地图的第2层对应着ReadyMap的第1层编码格式:层/行_列,行、列号不足四位时用0补全,例如10/0029_0003, 10/0029_0004osgearth加载瓦片的规则是:(0,0)在左上角,所以OE在读取Rea 阅读全文
posted @ 2013-05-10 12:54 酷熊 阅读(2001) 评论(0) 推荐(0) 编辑
摘要:#include #include stream.clear();stream.str(""); 阅读全文
posted @ 2013-05-09 15:19 酷熊 阅读(311) 评论(0) 推荐(0) 编辑
摘要:创建目录函数_mkdir(path),返回0表示成功,-1失败只能创建一级目录,即path倒数第二级必须是已经存在,否则创建不成功。举个例子。现在D盘下为空,什么都没有path="d:/A/B/C"int result=_mkdir(path);result值为-1,创建失败,因为"d:/A/B"不存在,所以必须一级一级的创建,即_mkdir("d:/A");_mkdir("d:/A/B");_mkdir("d:/A/B/C");检验路径或者文件是否存在,用_access(path,0)来检验, 阅读全文
posted @ 2013-05-09 12:55 酷熊 阅读(7561) 评论(0) 推荐(0) 编辑
摘要:可以追踪全局变量errno的值,判断错误类型,在errno.h中定义http://technet.microsoft.com/zh-cn/library/5814770t.aspx 阅读全文
posted @ 2013-05-08 18:18 酷熊 阅读(205) 评论(0) 推荐(0) 编辑
摘要:c++代码中可以使用system系统调用,很方便,例如我经常用system("copy C:\A\*.txt d:\A"),注意\不能写成/。将上述语句放在c++代码中,没有问题。程序运行时会弹出控制台窗口。如果只想使用system功能而不想显示控制台窗口,例如在MFC程序中,可以使用WinExec函数,上述代码可以写成WinExec("cmd.exe /c copy C:\A\*.txt d:\A", SW_HIDE);//隐藏控制若函数调用成功,则返回值大于31。若函数调用失败,则返回值为下列之一:等于 0 {内存不足}ERROR_FILE_NOT_ 阅读全文
posted @ 2013-05-08 17:26 酷熊 阅读(1827) 评论(0) 推荐(0) 编辑
摘要:在视图设计窗口,向一个combobox添加数据列表,在属性-data中,用分号";"分割。例如A;B;C;1;2;3要是想设置默认选中的项,需要在OnInitDialog()函数中使用SetCurSel(0);例如((CComboBox*)GetDlgItem(IDC_COMBO1))->SetCurSel(0);获取选择项的字符串内容CString text;GetDlgItemText(IDC_COMBO1,text);int i=((CComboBox*)GetDlgItem(IDC_COMBO1))->GetCurSel(); 阅读全文
posted @ 2013-05-08 14:37 酷熊 阅读(247) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示