<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"><style>body { line-height: 1.5; }blockquote { margin-top: 0px; margin-bottom: 0px; margin-left: 0.5em; }body { font-size: 10.5pt; font-family: 'Microsoft YaHei UI'; color: rgb(0, 0, 0); line-height: 1.5; }</style></head><body>
<div><span></span>Hi All,</div><div><span style="font-family: "" microsoft="" yahei="" ui'";="" font-size:="" 14px;="" color:="" rgb(0,="" 0,="" 0);="" background-color:="" rgba(0,="" font-weight:="" normal;="" font-style:="" normal;text-decoration:="" none;'=""> I'm trying to make osgEarth run on Android (OSG 3.2 & osgEarth 2.3). Now the earth can display on Android system. But I run into a problem with regard to std:istream. I tried to load an osgb file by the following code</span></div><div><span style="font-family: "" microsoft="" yahei="" ui'";="" font-size:="" 14px;="" color:="" rgb(0,="" 0,="" 0);="" background-color:="" rgba(0,="" font-weight:="" normal;="" font-style:="" normal;text-decoration:="" none;'=""><span style="font-family: "" microsoft="" yahei="" ui'";="" font-size:="" 14px;="" color:="" rgb(0,="" 0,="" 0);="" background-color:="" rgba(0,="" font-weight:="" normal;="" font-style:="" normal;text-decoration:="" none;'="">osg::ref_ptr<osg::Node> node = osgDB::readNodeFile("/sdcard/WV/Models/tk.osgb");</span></span></div><div>the variable node's value is always be NULL. I step into this line and traced down to file ReaderWriterOSG2.cpp</div><span style="font-family: "" microsoft="" yahei="" ui'";="" font-size:="" 14px;="" color:="" rgb(0,="" 0,="" 0);="" background-color:="" rgba(0,="" font-weight:="" normal;="" font-style:="" normal;text-decoration:="" none;'="">virtual ReadResult readNode( const std::string& file, const Options* options ) const<br> {<br> ReadResult result = ReadResult::FILE_LOADED;<br> std::string fileName = file;<br> std::ios::openmode mode = std::ios::in;<br> Options* local_opt = prepareReading( result, fileName, mode, options );<br> if ( !result.success() ) return result;<br><br> osgDB::ifstream istream( fileName.c_str(), mode );<br> return readNode( istream, local_opt );<br> }</span><div><br></div><div><span style="font-family: "" microsoft="" yahei="" ui'";="" font-size:="" 14px;="" color:="" rgb(0,="" 0,="" 0);="" background-color:="" rgba(0,="" font-weight:="" normal;="" font-style:="" normal;text-decoration:="" none;'="">virtual ReadResult readNode( std::istream& fin, const Options* options ) const<br> {<br> osg::ref_ptr<InputIterator> ii = readInputIterator(fin, options);<br> if ( !ii ) return ReadResult::FILE_NOT_HANDLED;<br><br> InputStream is( options );<br> if ( is.start(ii.get())!=InputStream::READ_SCENE )<br> {<br> CATCH_EXCEPTION(is);<br> return ReadResult::FILE_NOT_HANDLED;<br> }<br><br> is.decompress(); CATCH_EXCEPTION(is);<br> osg::Node* node = dynamic_cast<osg::Node*>(is.readObject()); CATCH_EXCEPTION(is);<br> return node;<br> }</span></div><div><br></div><div>the debugger couldn't step into the function readNode( std::istream& fin, const Options* options ). But on windows it works.</div><div><br></div><div>Can anybody tell me how to solve this problem?</div><div><br></div><div>Dev Environment:</div><div><span style="font-family: ''; font-size: 10.5pt; line-height: 1.5; background-color: window;"> </span>Visual Studio 2017</div><div><span style="font-family: ''; font-size: 10.5pt; line-height: 1.5; background-color: window;"> </span>Android 7.0</div><div><span style="font-family: ''; font-size: 10.5pt; line-height: 1.5; background-color: window;"> </span>Android NDK64 <span style="font-family: ''; font-size: 10.5pt; line-height: 1.5; background-color: window;">r13b</span></div><div><span style="font-family: ''; font-size: 10.5pt; line-height: 1.5; background-color: window;"> </span>Arch arm64-v8a</div><div><br></div><div>Best regards.</div><div><br></div><div>Glen</div><div><br></div><div><br><blockquote style="margin-top: 0px; margin-bottom: 0px; margin-left: 0.5em;"><div>
<div>_______________________________________________</div>
<div>osg-users mailing list</div>
<div>osg-users@lists.openscenegraph.org</div>
<div>http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org</div>
</div></blockquote>
</div></body></html>