Re: [osg-users] OSG and Qt GLdouble typedef conflicts with OpenGL ES2

2012-12-13 Thread Preet
Hi Robert,

Thanks for the quick reply. Just for anyone else who runs into this,
another way to get aorund this without changing order of includes is just
to add the osg defines before Qt is included in the application:

#define GL_DOUBLE 0x140A
#define GLdouble double

It was a bit of a pain to change up order of includes everywhere in my
application. Since both OSG and Qt have to check whether or not GLdouble is
defined by the GL implementation, I think its safe to do this [and it seems
to be working fine].


Regards,

Preet


On Wed, Dec 12, 2012 at 3:51 AM, Robert Osfield robert.osfi...@gmail.comwrote:

 Hi Preet,

 On 12 December 2012 05:59, Preet prismatic.proj...@gmail.com wrote:

 Hiya

 I'm using OSG with Qt to create an OpenGL ES 2 application. GL ES2 does
 not have GLdoubles.

 When building witHh against ES2, Qt typedefs GLdouble to GLfloat. OSG
 typedefs GLdouble to just 'double'. As a result I get an error when trying
 to compile my application.

 How do I get around this?


 It will be an order of include issue, so just be careful which order you
 include files, or keep the Qt GL code seperate from the OSG Qt code.
 Personally I'm surprised by the Qt downcasting GLdoube to GLfloat, this
 could break codes that rely on doubles.  On the OSG side we generally use
 floats for all key data that gets passed to OpenGL, it tends to be just
 things like glu (which is now part of the OSG) that uses doubles.

 Robert.

 ___
 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] OSG and Qt GLdouble typedef conflicts with OpenGL ES2

2012-12-12 Thread Robert Osfield
Hi Preet,

On 12 December 2012 05:59, Preet prismatic.proj...@gmail.com wrote:

 Hiya

 I'm using OSG with Qt to create an OpenGL ES 2 application. GL ES2 does
 not have GLdoubles.

 When building witHh against ES2, Qt typedefs GLdouble to GLfloat. OSG
 typedefs GLdouble to just 'double'. As a result I get an error when trying
 to compile my application.

 How do I get around this?


It will be an order of include issue, so just be careful which order you
include files, or keep the Qt GL code seperate from the OSG Qt code.
Personally I'm surprised by the Qt downcasting GLdoube to GLfloat, this
could break codes that rely on doubles.  On the OSG side we generally use
floats for all key data that gets passed to OpenGL, it tends to be just
things like glu (which is now part of the OSG) that uses doubles.

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


[osg-users] OSG and Qt GLdouble typedef conflicts with OpenGL ES2

2012-12-11 Thread Preet
Hiya

I'm using OSG with Qt to create an OpenGL ES 2 application. GL ES2 does not
have GLdoubles.

When building with against ES2, Qt typedefs GLdouble to GLfloat. OSG
typedefs GLdouble to just 'double'. As a result I get an error when trying
to compile my application.

How do I get around this?


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