From: Jason M. <ko...@gm...> - 2008-08-24 01:43:44
|
Henri Häkkinen wrote: > > > On Sun, Aug 24, 2008 at 4:19 AM, Jason McKesson <ko...@gm... > <mailto:ko...@gm...>> wrote: > > Henri Häkkinen wrote: >> Does anyone have anything to say on this, please? I am currently >> working hard on the GLM and I think we should resolve the issue >> of how we actually define the math types. > Well, the VC++ compiler issue pretty much ends #2 as a > possibility. If #1 doesn't work for you, that leaves #3. > > > Well no, this is not true at all. The VC compiler issues is only about > anonymous structures. For example, this generates a warning: > > typedef struct GLMvec2f_s { > union { > GLfloat v[2]; > struct { > GLfloat x, y; > } > }; > } GLMvec2f; > > While this does not: > > typedef struct GLMvec2f_s { > union { > GLfloat v[2]; > struct GLMvec2fcoords_s { > GLfloat x, y; > } > }; > } GLMvec2f; > Admittedly it's been a while since I last used pure C, but if I'm reading that right, to access the x or y members, I would need: GLMvec2f someValue; someValue.GLMvec3fcoords_s.x = 0.5f This is a pretty clear violation of design goal #2: Simplicity. And if the inner struct can't be accessed with a simple ".x", then what's the point in having it at all? |