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

Kim Bale kcbale at googlemail.com
Mon Nov 2 06:37:37 PST 2009


J-S,

> 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 :-)

Ah interesting, nothing to do with <windows.h> then.. either way it
was fixed a while ago.

> 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.

Since there has been some additional functionality and lots of bug
fixes, I'll tag the trunk as a 1.05 or something and direct to that. I
think it's better to have people using a tag for download instead of
the trunk because things do get broken from time to time in there.

Cheers,

K.



2009/11/2 Jean-Sébastien Guay <jean-sebastien.guay at cm-labs.com>:
> 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    jean-sebastien.guay at cm-labs.com
>                               http://www.cm-labs.com/
>                        http://whitestar02.webhop.org/
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>


More information about the osg-users mailing list