[osg-users] [osgOcean] Error used osgOcean1.0 in MFC vc2005sp1

Tian Ma tianxiao888 at foxmail.com
Mon Nov 2 19:58:55 PST 2009


Hi Skylark,Kim:

Thx a lot

I know quit clearly now. 

Thank you again for giving me so many useful messages.

cheers,
MT


Skylark wrote:
> Hello Tian,
> 
> 
> > Was it those that you deleted? Yes, I just delet thems, because I found that these two "inline " functions had not been used in anywhere. And now my project just goes right,  the same with the "oceanExample".
> > 
> 
> Sorry I didn't pick up on this thread... I'm pretty darn busy so I just 
> glance over threads that I don't immediately have an answer for, but 
> looking at the OceanScene header in the osgOcean-1.0 tag, lines 213 and 
> 223, it was immediately obvious what the problem was. You do not need to 
> delete them. Just rename the variables called "near" and "far" to 
> something else, like this for example:
> 
> /** Set near DOF blur distance.
> * Updates the uniform is DOF state is valid.
> */
> inline void setDOFNear( float zNear ) {
> _dofNear = zNear;
> 
> if( _dofStateSet.valid() )
> 
> _dofStateSet->getUniform("osgOcean_DOF_Near")->set(_dofNear);
> }
> 
> /** Set far DOF blur distance
> * Updates the uniform is DOF state is valid.
> */
> inline void setDOFFar(float zFar ) {
> _dofFar = zFar;
> 
> if( _dofStateSet.valid() )
> 
> _dofStateSet->getUniform("osgOcean_DOF_Far")->set(_dofNear);
> }
> 
> Just for general reference, the problem was that on Windows compilers 
> (and previously DOS), "near" and "far" were once keywords used to refer 
> to memory inside the first 64k page, and outside, respectively (back 
> when you needed to address them differently, which is a long time ago). 
> Nowadays it's pretty obsolete, but some compilers on PC still carry that 
> legacy. And I get bitten by it every time I do OpenGL or raytracing code 
> that needs to have a frustum, with near and far planes :-)
> 
> And it doesn't matter that these methods are not used in osgOcean or the 
> oceanExample themselves, they're still useful methods to have in order 
> to be able to tweak osgOcean's rendering.
> 
> 
> > Sorry , I did not know the meaning of  "the trunk update" clearly.
> > 
> 
> Kim meant checking out from
> 
> http://osgocean.googlecode.com/svn/trunk/
> 
> instead of
> 
> http://osgocean.googlecode.com/svn/tags/osgOcean-1.0/
> 
> The 1.0 tag is pretty old now, people should not check out using it 
> anymore... Kim, is it possible to make changes on the googlecode site so 
> that it doesn't show up by default when people click on the "source" 
> tab? The default checkout should be from the trunk now. And the trunk 
> has the above fix already, btw.
> 
> Hope this helps,
> 
> J-S
> -- 
> ______________________________________________________
> Jean-Sebastien Guay    
> http://www.cm-labs.com/
> http://whitestar02.webhop.org/
> _______________________________________________
> osg-users mailing list
> 
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> 
>  ------------------
> Post generated by Mail2Forum


------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=19081#19081







More information about the osg-users mailing list