From: H. H. <hen...@gm...> - 2008-08-24 01:53:32
|
On Sun, Aug 24, 2008 at 4:44 AM, Jason McKesson <ko...@gm...> wrote: > Henri Häkkinen wrote: > > > > On Sun, Aug 24, 2008 at 4:19 AM, Jason McKesson <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? > No that is not correct at all. There is a difference between the name of the structure and the name of the variable. When you write in C like this: struct FOO { int baz; } fizban; You access baz inside the struct like this: fizban.baz = 12; When we have the vector type: typedef struct GLMvec2f_s { union { GLfloat v[2]; struct GLMvec2fcoords_s { GLfloat x, y; }; }; } GLMvec2f; You access it normally; GLMvec2f v; v.x = 10.0f; The 'GLMvec2fcoords_s' is a structure name, nor a variable name. > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's > challenge > Build the coolest Linux based applications with Moblin SDK & win great > prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Glsdk-devel mailing list > Gls...@li... > https://lists.sourceforge.net/lists/listinfo/glsdk-devel > > -- Henri 'henux' Häkkinen |