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

2009-11-02 Thread Jean-Sébastien Guay

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 Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.webhop.org/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


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

2009-11-02 Thread Kim Bale
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.g...@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.g...@cm-labs.com
                               http://www.cm-labs.com/
                        http://whitestar02.webhop.org/
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


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

2009-11-02 Thread Tian Ma
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





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


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

2009-10-31 Thread Tian Ma
Thank you, Kim!

THX a lot!

   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 did not know the meaning of  the trunk update clearly. And I 
just put the ocean code in MFC+OSG project's  function:InitSceanGraph().

Cheers,
mt



Kim Bale wrote:
 Hi MT,
 
 
  
   I found that: the two lines of error code in oceanscean.h  had not been 
   used in anywhere, so I just delete them.
   
  
 
 If the problem relates to lines 213 and 223 in the OceanScene header
 then those member variables are used to set and store the depth of
 field parameters..
 
 Was it those that you deleted? If the trunk update didn't solve it I'd
 be keen to find out what the real cause is.
 
 Cheers,
 
 Kim.
 
 
 
 2009/10/30 Tian Ma :
 
  
  Kim Bale wrote:
  
   Hi Tian,
   
   Try using the version in the trunk, there was a header conflict with
   windows.h in 1.0 that has since been resolved.
   
   Cheers.
   
   Kim.
   
   
   
   2009/10/30 Tian Ma :
   
   
Hi,

 I'am a new osgOcean user in China, My name is Tian Ma.

First,I established an empty osg+MFC project. NO ERROR!

  Then, I add oceanScene example files to the project, and delete
the main() function
in the application.cpp file. Then errors emerge:

 c:\...\osgocean\oceanScene(213) : error C2059 : syntax error : ;
 c:\...\osgocean\oceanScene(223) : error C2059 : syntax error : ;

 In order to find the problems, I delete all the oceanScene example
files,
and just add code #include oceanScene head file to stdafx.h. But 
the
same errors.

  Have you guys used osgOcean in MFC project? What may caused the 
problem?


Thank you!

    THX a lot!

   I have solve the porblems, by note off two lines of code in error.

   I found that: the two lines of error code in oceanscean.h  had not 
been used in anywhere, so I just delete them.


Cheers,
mt

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





___
osg-users mailing list

http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.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=18927#18927
  
  
  
  
  
  ___
  osg-users mailing list
  
  http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.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=18977#18977





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


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

2009-10-30 Thread Tian Ma
Hi,
 
 I'am a new osgOcean user in China, My name is Tian Ma.

First,I established an empty osg+MFC project. NO ERROR!

   Then, I add oceanScene example files to the project, and delete 
the main() function
in the application.cpp file. Then errors emerge:

  c:\...\osgocean\oceanScene(213) : error C2059 : syntax error : ;
  c:\...\osgocean\oceanScene(223) : error C2059 : syntax error : ;

  In order to find the problems, I delete all the oceanScene example 
files, 
and just add code #include oceanScene head file to stdafx.h. But the 
same errors.

   Have you guys used osgOcean in MFC project? What may caused the problem?


Thank you!

Cheers,
mt

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





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


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

2009-10-30 Thread Kim Bale
Hi Tian,

Try using the version in the trunk, there was a header conflict with
windows.h in 1.0 that has since been resolved.

Cheers.

Kim.



2009/10/30 Tian Ma tianxiao...@foxmail.com:
 Hi,

  I'am a new osgOcean user in China, My name is Tian Ma.

 First,I established an empty osg+MFC project. NO ERROR!

   Then, I add oceanScene example files to the project, and delete
 the main() function
 in the application.cpp file. Then errors emerge:

  c:\...\osgocean\oceanScene(213) : error C2059 : syntax error : ;
  c:\...\osgocean\oceanScene(223) : error C2059 : syntax error : ;

  In order to find the problems, I delete all the oceanScene example
 files,
 and just add code #include oceanScene head file to stdafx.h. But the
 same errors.

   Have you guys used osgOcean in MFC project? What may caused the problem?


 Thank you!

 Cheers,
 mt

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





 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


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

2009-10-30 Thread Tian Ma

Kim Bale wrote:
 Hi Tian,
 
 Try using the version in the trunk, there was a header conflict with
 windows.h in 1.0 that has since been resolved.
 
 Cheers.
 
 Kim.
 
 
 
 2009/10/30 Tian Ma :
 
  Hi,
  
   I'am a new osgOcean user in China, My name is Tian Ma.
  
  First,I established an empty osg+MFC project. NO ERROR!
  
    Then, I add oceanScene example files to the project, and delete
  the main() function
  in the application.cpp file. Then errors emerge:
  
   c:\...\osgocean\oceanScene(213) : error C2059 : syntax error : ;
   c:\...\osgocean\oceanScene(223) : error C2059 : syntax error : ;
  
   In order to find the problems, I delete all the oceanScene example
  files,
  and just add code #include oceanScene head file to stdafx.h. But the
  same errors.
  
    Have you guys used osgOcean in MFC project? What may caused the problem?
  
  
  Thank you!
  
  THX a lot!
  
 I have solve the porblems, by note off two lines of code in error.
  
 I found that: the two lines of error code in oceanscean.h  had not 
  been used in anywhere, so I just delete them.
  
  
  Cheers,
  mt
  
  --
  Read this topic online here:
  http://forum.openscenegraph.org/viewtopic.php?p=18916#18916
  
  
  
  
  
  ___
  osg-users mailing list
  
  http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.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=18927#18927





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


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

2009-10-30 Thread Tian Ma
Thank you!

THX a lot!

   I have solve the porblems, by note off two lines of code in error.

   I found that: the two lines of error code in oceanscean.h  had not been 
used in anywhere, so I just delete them.


Cheers,
mt


tianxiao888 wrote:
 
 Kim Bale wrote:
  Hi Tian,
  
  Try using the version in the trunk, there was a header conflict with
  windows.h in 1.0 that has since been resolved.
  
  Cheers.
  
  Kim.
  
  
  
  2009/10/30 Tian Ma :
  
   Hi,
   
    I'am a new osgOcean user in China, My name is Tian Ma.
   
   First,I established an empty osg+MFC project. NO ERROR!
   
     Then, I add oceanScene example files to the project, and delete
   the main() function
   in the application.cpp file. Then errors emerge:
   
    c:\...\osgocean\oceanScene(213) : error C2059 : syntax error : ;
    c:\...\osgocean\oceanScene(223) : error C2059 : syntax error : ;
   
    In order to find the problems, I delete all the oceanScene example
   files,
   and just add code #include oceanScene head file to stdafx.h. But the
   same errors.
   
     Have you guys used osgOcean in MFC project? What may caused the problem?
   
   
   
   
   --
   Read this topic online here:
   http://forum.openscenegraph.org/viewtopic.php?p=18916#18916
   
   
   
   
   
   ___
   osg-users mailing list
   
   http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.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=18928#18928





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org