I usually write a small class (or struct, same difference) such as:
struct MyPoint
{
float x;
float y;
};
To loop by index, I redefine the operator[] in C++ and/or write a
small ptr() method return the address of the first member.
Beyond the [] operator, it's highly convenient to have operators like
+ * etc defined and keeping the actual vector components private. That
way vector math is faster to type and easier to read. Also, it gives
you the option to do your vector math using SSE/AltiVec should it
become desirable at some point. Or you can easily switch it to fixed-
point or double precision math while still being able to provide a
GFloat accessor.
-Stefan
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Mac-opengl mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/mac-opengl/email@hidden