From: Gerrit V. <vo...@ca...> - 2006-07-23 06:55:57
|
Hi, just a short question as I want to finalize the embedded OSG version. Currently I use name spaces to implement either fix or floating point math and OpenGL calls. The advantage is that one has detailed control over what is converted to fix point math and what remains floating point. A consequence is that everything based on Real32 that is affected must be change to use the name space, for example the Transform core would contain things like : GLP::SFMatrix *editSFMatrix(void); const GLP::SFMatrix *getSFMatrix (void) const; GLP::Matrix &editMatrix(void); const GLP::Matrix &getMatrix (void) const; or GLP::SFMatrix _sfMatrix; The alternative would be to directly change the Real32 definition. But for this I would tend to change RealXX to FloatXX so there is still the possibility to have fix and float math available. In this case I would basically like to have the following definitions : Float32 -> always a 32bit float Fixed32 -> always a 32bit fixed Real32 -> hardware dependent either 32bit float or 32bit fix as compared to the current #ifdef FIXED namespace GLP { typedef Fixed32 Real32; typedef Vec3fx Vec3f; . . } #else namespace GLP { typedef OSG::Real32 Real32; typedef OSG::Vec3f Vec3f; . . } #endif I'm currently kind of undecided, in general I lean a little bit towards the name space solution as it more clearly marks what is affected by the underlying hardware and what not. Any opinions or other solutions ?? kind regards, gerrit -- Is there anything bad about quantum computing ? Finding bugs in the code. We know how fast they're propagating but we don't know exactly where they are. |